Skip to content

Commit

Permalink
change: disable unimplemented buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanKnott committed Jun 24, 2020
1 parent 3ea95a6 commit a395859
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
21 changes: 14 additions & 7 deletions web/src/Projects/Project/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState, useRef, useContext, useEffect } from 'react';
import { MENU_TYPES } from 'shared/components/TopNavbar';
import updateApolloCache from 'shared/utils/cache';
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 { usePopup, Popup } from 'shared/components/PopupMenu';
import { useParams, Route, useRouteMatch, useHistory, RouteComponentProps } from 'react-router-dom';
Expand Down Expand Up @@ -238,7 +238,7 @@ const ProjectActions = styled.div`
align-items: center;
`;

const ProjectAction = styled.div`
const ProjectAction = styled.div<{ disabled?: boolean }>`
cursor: pointer;
display: flex;
align-items: center;
Expand All @@ -252,6 +252,13 @@ const ProjectAction = styled.div`
&:hover {
color: rgba(${props => props.theme.colors.text.secondary});
}
${props =>
props.disabled &&
css`
opacity: 0.5;
cursor: default;
pointer-events: none;
`}
`;

const ProjectActionText = styled.span`
Expand Down Expand Up @@ -551,15 +558,15 @@ const Project = () => {
/>
<ProjectBar>
<ProjectActions>
<ProjectAction>
<ProjectAction disabled>
<CheckCircle width={13} height={13} />
<ProjectActionText>All Tasks</ProjectActionText>
</ProjectAction>
<ProjectAction>
<ProjectAction disabled>
<Filter width={13} height={13} />
<ProjectActionText>Filter</ProjectActionText>
</ProjectAction>
<ProjectAction>
<ProjectAction disabled>
<Sort width={13} height={13} />
<ProjectActionText>Sort</ProjectActionText>
</ProjectAction>
Expand All @@ -582,11 +589,11 @@ const Project = () => {
<Tags width={13} height={13} />
<ProjectActionText>Labels</ProjectActionText>
</ProjectAction>
<ProjectAction>
<ProjectAction disabled>
<ToggleOn width={13} height={13} />
<ProjectActionText>Fields</ProjectActionText>
</ProjectAction>
<ProjectAction>
<ProjectAction disabled>
<Bolt width={13} height={13} />
<ProjectActionText>Rules</ProjectActionText>
</ProjectAction>
Expand Down
9 changes: 8 additions & 1 deletion web/src/shared/components/TopNavbar/Styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,16 @@ export const ProfileNameWrapper = styled.div`
line-height: 1.25;
`;

export const IconContainer = styled.div`
export const IconContainer = styled.div<{ disabled?: boolean }>`
margin-right: 20px;
cursor: pointer;
${props =>
props.disabled &&
css`
opacity: 0.5;
cursor: default;
pointer-events: none;
`}
`;

export const ProfileNamePrimary = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions web/src/shared/components/TopNavbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ const NavBar: React.FC<NavBarProps> = ({
<IconContainer onClick={onDashboardClick}>
<HomeDashboard width={20} height={20} />
</IconContainer>
<IconContainer>
<IconContainer disabled>
<CheckCircle width={20} height={20} />
</IconContainer>
<IconContainer onClick={onNotificationClick}>
<Bell color="#c2c6dc" size={20} />
</IconContainer>
<IconContainer>
<IconContainer disabled>
<BarChart width={20} height={20} />
</IconContainer>

Expand Down

0 comments on commit a395859

Please sign in to comment.