From 67ac88856b4311d0416b517f3a949e2fbd2572ed Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Sun, 31 May 2020 00:15:10 -0500 Subject: [PATCH] change: hide project heading when project name is null --- web/src/App/TopNavbar.tsx | 2 +- web/src/Projects/Project/index.tsx | 2 +- web/src/Projects/index.tsx | 2 +- web/src/shared/components/TopNavbar/index.tsx | 30 ++++++++++--------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/web/src/App/TopNavbar.tsx b/web/src/App/TopNavbar.tsx index b246fb4..e0db757 100644 --- a/web/src/App/TopNavbar.tsx +++ b/web/src/App/TopNavbar.tsx @@ -6,7 +6,7 @@ import UserIDContext from 'App/context'; import { useMeQuery } from 'shared/generated/graphql'; type GlobalTopNavbarProps = { - name: string; + name: string | null; projectMembers?: null | Array; onSaveProjectName?: (projectName: string) => void; }; diff --git a/web/src/Projects/Project/index.tsx b/web/src/Projects/Project/index.tsx index f8f65b2..e577825 100644 --- a/web/src/Projects/Project/index.tsx +++ b/web/src/Projects/Project/index.tsx @@ -411,7 +411,7 @@ const Project = () => { if (loading) { return ( <> - {}} name="Loading..." /> + {}} name="" /> ); } diff --git a/web/src/Projects/index.tsx b/web/src/Projects/index.tsx index ca25ab9..865d69c 100644 --- a/web/src/Projects/index.tsx +++ b/web/src/Projects/index.tsx @@ -41,7 +41,7 @@ const Projects = () => { const { projects } = data; return ( <> - {}} name="Projects" /> + {}} name={null} /> {projects.map(project => ( diff --git a/web/src/shared/components/TopNavbar/index.tsx b/web/src/shared/components/TopNavbar/index.tsx index 19e7bbe..7ec7cb1 100644 --- a/web/src/shared/components/TopNavbar/index.tsx +++ b/web/src/shared/components/TopNavbar/index.tsx @@ -87,12 +87,18 @@ const ProjectHeading: React.FC = ({ projectName: initialPro {projectName} )} + + + + + + ); }; type NavBarProps = { - projectName: string; + projectName: string | null; onProfileClick: (bottom: number, right: number) => void; onSaveProjectName?: (projectName: string) => void; onNotificationClick: () => void; @@ -141,20 +147,16 @@ const NavBar: React.FC = ({ Projects - - - - - - - + {projectName && } - - Board - Calender - Timeline - Wiki - + {projectName && ( + + Board + Calender + Timeline + Wiki + + )} {projectMembers && (