change: hide project heading when project name is null

This commit is contained in:
Jordan Knott 2020-05-31 00:15:10 -05:00
parent e87a2ea0b7
commit 67ac88856b
4 changed files with 19 additions and 17 deletions

View File

@ -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<TaskUser>;
onSaveProjectName?: (projectName: string) => void;
};

View File

@ -411,7 +411,7 @@ const Project = () => {
if (loading) {
return (
<>
<GlobalTopNavbar onSaveProjectName={projectName => {}} name="Loading..." />
<GlobalTopNavbar onSaveProjectName={projectName => {}} name="" />
</>
);
}

View File

@ -41,7 +41,7 @@ const Projects = () => {
const { projects } = data;
return (
<>
<GlobalTopNavbar onSaveProjectName={() => {}} name="Projects" />
<GlobalTopNavbar onSaveProjectName={() => {}} name={null} />
<ProjectGrid>
{projects.map(project => (
<ProjectLink key={project.id} to={`/projects/${project.id}`}>

View File

@ -87,12 +87,18 @@ const ProjectHeading: React.FC<ProjectHeadingProps> = ({ projectName: initialPro
{projectName}
</ProjectName>
)}
<ProjectSettingsButton>
<AngleDown color="#c2c6dc" />
</ProjectSettingsButton>
<ProjectSettingsButton>
<Star width={16} height={16} color="#c2c6dc" />
</ProjectSettingsButton>
</>
);
};
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<NavBarProps> = ({
<ProjectActions>
<ProjectMeta>
<ProjectSwitcher>Projects</ProjectSwitcher>
<ProjectHeading projectName={projectName} onSaveProjectName={onSaveProjectName} />
<ProjectSettingsButton>
<AngleDown color="#c2c6dc" />
</ProjectSettingsButton>
<ProjectSettingsButton>
<Star width={16} height={16} color="#c2c6dc" />
</ProjectSettingsButton>
{projectName && <ProjectHeading projectName={projectName} onSaveProjectName={onSaveProjectName} />}
</ProjectMeta>
<ProjectTabs>
<ProjectTab active>Board</ProjectTab>
<ProjectTab>Calender</ProjectTab>
<ProjectTab>Timeline</ProjectTab>
<ProjectTab>Wiki</ProjectTab>
</ProjectTabs>
{projectName && (
<ProjectTabs>
<ProjectTab active>Board</ProjectTab>
<ProjectTab>Calender</ProjectTab>
<ProjectTab>Timeline</ProjectTab>
<ProjectTab>Wiki</ProjectTab>
</ProjectTabs>
)}
</ProjectActions>
<GlobalActions>
{projectMembers && (