change: disable unimplemented buttons

This commit is contained in:
Jordan Knott 2020-06-23 20:46:45 -05:00
parent 3ea95a662d
commit a3958595cd
3 changed files with 24 additions and 10 deletions

View File

@ -3,7 +3,7 @@ import React, { useState, useRef, useContext, useEffect } from 'react';
import { MENU_TYPES } from 'shared/components/TopNavbar'; import { MENU_TYPES } from 'shared/components/TopNavbar';
import updateApolloCache from 'shared/utils/cache'; import updateApolloCache from 'shared/utils/cache';
import GlobalTopNavbar, { ProjectPopup } from 'App/TopNavbar'; import GlobalTopNavbar, { ProjectPopup } from 'App/TopNavbar';
import styled from 'styled-components/macro'; import styled, { css } from 'styled-components/macro';
import { Bolt, ToggleOn, Tags, CheckCircle, Sort, Filter } from 'shared/icons'; import { Bolt, ToggleOn, Tags, CheckCircle, Sort, Filter } from 'shared/icons';
import { usePopup, Popup } from 'shared/components/PopupMenu'; import { usePopup, Popup } from 'shared/components/PopupMenu';
import { useParams, Route, useRouteMatch, useHistory, RouteComponentProps } from 'react-router-dom'; import { useParams, Route, useRouteMatch, useHistory, RouteComponentProps } from 'react-router-dom';
@ -238,7 +238,7 @@ const ProjectActions = styled.div`
align-items: center; align-items: center;
`; `;
const ProjectAction = styled.div` const ProjectAction = styled.div<{ disabled?: boolean }>`
cursor: pointer; cursor: pointer;
display: flex; display: flex;
align-items: center; align-items: center;
@ -252,6 +252,13 @@ const ProjectAction = styled.div`
&:hover { &:hover {
color: rgba(${props => props.theme.colors.text.secondary}); color: rgba(${props => props.theme.colors.text.secondary});
} }
${props =>
props.disabled &&
css`
opacity: 0.5;
cursor: default;
pointer-events: none;
`}
`; `;
const ProjectActionText = styled.span` const ProjectActionText = styled.span`
@ -551,15 +558,15 @@ const Project = () => {
/> />
<ProjectBar> <ProjectBar>
<ProjectActions> <ProjectActions>
<ProjectAction> <ProjectAction disabled>
<CheckCircle width={13} height={13} /> <CheckCircle width={13} height={13} />
<ProjectActionText>All Tasks</ProjectActionText> <ProjectActionText>All Tasks</ProjectActionText>
</ProjectAction> </ProjectAction>
<ProjectAction> <ProjectAction disabled>
<Filter width={13} height={13} /> <Filter width={13} height={13} />
<ProjectActionText>Filter</ProjectActionText> <ProjectActionText>Filter</ProjectActionText>
</ProjectAction> </ProjectAction>
<ProjectAction> <ProjectAction disabled>
<Sort width={13} height={13} /> <Sort width={13} height={13} />
<ProjectActionText>Sort</ProjectActionText> <ProjectActionText>Sort</ProjectActionText>
</ProjectAction> </ProjectAction>
@ -582,11 +589,11 @@ const Project = () => {
<Tags width={13} height={13} /> <Tags width={13} height={13} />
<ProjectActionText>Labels</ProjectActionText> <ProjectActionText>Labels</ProjectActionText>
</ProjectAction> </ProjectAction>
<ProjectAction> <ProjectAction disabled>
<ToggleOn width={13} height={13} /> <ToggleOn width={13} height={13} />
<ProjectActionText>Fields</ProjectActionText> <ProjectActionText>Fields</ProjectActionText>
</ProjectAction> </ProjectAction>
<ProjectAction> <ProjectAction disabled>
<Bolt width={13} height={13} /> <Bolt width={13} height={13} />
<ProjectActionText>Rules</ProjectActionText> <ProjectActionText>Rules</ProjectActionText>
</ProjectAction> </ProjectAction>

View File

@ -57,9 +57,16 @@ export const ProfileNameWrapper = styled.div`
line-height: 1.25; line-height: 1.25;
`; `;
export const IconContainer = styled.div` export const IconContainer = styled.div<{ disabled?: boolean }>`
margin-right: 20px; margin-right: 20px;
cursor: pointer; cursor: pointer;
${props =>
props.disabled &&
css`
opacity: 0.5;
cursor: default;
pointer-events: none;
`}
`; `;
export const ProfileNamePrimary = styled.div` export const ProfileNamePrimary = styled.div`

View File

@ -229,13 +229,13 @@ const NavBar: React.FC<NavBarProps> = ({
<IconContainer onClick={onDashboardClick}> <IconContainer onClick={onDashboardClick}>
<HomeDashboard width={20} height={20} /> <HomeDashboard width={20} height={20} />
</IconContainer> </IconContainer>
<IconContainer> <IconContainer disabled>
<CheckCircle width={20} height={20} /> <CheckCircle width={20} height={20} />
</IconContainer> </IconContainer>
<IconContainer onClick={onNotificationClick}> <IconContainer onClick={onNotificationClick}>
<Bell color="#c2c6dc" size={20} /> <Bell color="#c2c6dc" size={20} />
</IconContainer> </IconContainer>
<IconContainer> <IconContainer disabled>
<BarChart width={20} height={20} /> <BarChart width={20} height={20} />
</IconContainer> </IconContainer>