From dfa8937df5aa8206a363b5139486accf79f78820 Mon Sep 17 00:00:00 2001 From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com> Date: Wed, 11 Jan 2023 18:59:31 +0530 Subject: [PATCH] style: added cta at the bottom of sidebar, added missing icons as well, showing dynamic workspace member count on workspace dropdown (#166) --- .../components/sidebar/workspace-options.tsx | 4 +- apps/app/layouts/navbar/main-sidebar.tsx | 83 +++++++++++++++++-- apps/app/types/workspace.d.ts | 1 + apps/app/ui/icons/bolt-icon.tsx | 18 ++++ apps/app/ui/icons/comment-icon.tsx | 18 ++++ apps/app/ui/icons/discord-icon.tsx | 25 ++++++ apps/app/ui/icons/document-icon.tsx | 18 ++++ apps/app/ui/icons/github-icon.tsx | 30 +++++++ apps/app/ui/icons/index.ts | 6 ++ .../ui/icons/question-mark-circle-icon.tsx | 22 +++++ yarn.lock | 6 +- 11 files changed, 222 insertions(+), 9 deletions(-) create mode 100644 apps/app/ui/icons/bolt-icon.tsx create mode 100644 apps/app/ui/icons/comment-icon.tsx create mode 100644 apps/app/ui/icons/discord-icon.tsx create mode 100644 apps/app/ui/icons/document-icon.tsx create mode 100644 apps/app/ui/icons/github-icon.tsx create mode 100644 apps/app/ui/icons/question-mark-circle-icon.tsx diff --git a/apps/app/components/sidebar/workspace-options.tsx b/apps/app/components/sidebar/workspace-options.tsx index 52fcfa9ac..10da3eaad 100644 --- a/apps/app/components/sidebar/workspace-options.tsx +++ b/apps/app/components/sidebar/workspace-options.tsx @@ -185,7 +185,9 @@ const WorkspaceOptions: React.FC = ({ sidebarCollapse }) => {
{workspace.name}
-
1 members
+
+ {workspace.total_members} members +
)} diff --git a/apps/app/layouts/navbar/main-sidebar.tsx b/apps/app/layouts/navbar/main-sidebar.tsx index e453bbddb..a0f961ac3 100644 --- a/apps/app/layouts/navbar/main-sidebar.tsx +++ b/apps/app/layouts/navbar/main-sidebar.tsx @@ -1,4 +1,8 @@ -import React from "react"; +import React, { useState } from "react"; + +import Link from "next/link"; + +import { Transition } from "@headlessui/react"; // hooks import useTheme from "lib/hooks/useTheme"; @@ -10,16 +14,46 @@ import { Cog6ToothIcon, RectangleStackIcon, ArrowLongLeftIcon, - QuestionMarkCircleIcon, RectangleGroupIcon, } from "@heroicons/react/24/outline"; -import { CyclesIcon } from "ui/icons"; +import { + CyclesIcon, + QuestionMarkCircleIcon, + BoltIcon, + DocumentIcon, + DiscordIcon, + GithubIcon, + CommentIcon, +} from "ui/icons"; type Props = { toggleSidebar: boolean; setToggleSidebar: React.Dispatch>; }; +const helpOptions = [ + { + name: "Documentation", + href: "https://docs.plane.so/", + Icon: DocumentIcon, + }, + { + name: "Join our Discord", + href: "https://discord.com/invite/A92xrEGCge", + Icon: DiscordIcon, + }, + { + name: "Report a bug", + href: "https://github.com/makeplane/plane/issues/new/choose", + Icon: GithubIcon, + }, + { + name: "Chat with us", + href: "mailto:hello@plane.so", + Icon: CommentIcon, + }, +]; + const navigation = (workspaceSlug: string, projectId: string) => [ { name: "Issues", @@ -46,6 +80,8 @@ const navigation = (workspaceSlug: string, projectId: string) => [ const Sidebar: React.FC = ({ toggleSidebar, setToggleSidebar }) => { const { collapsed: sidebarCollapse, toggleCollapsed } = useTheme(); + const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); + return (