Hide settings items for non admins

Update image uploader for use with team logo
Fix can't cancel cropping modal
This commit is contained in:
Tom Moor
2018-05-31 12:52:03 -07:00
parent 10a0ffe472
commit 0b3feef47a
3 changed files with 48 additions and 27 deletions

View File

@ -29,8 +29,8 @@ class SettingsSidebar extends React.Component<Props> {
};
render() {
const { team } = this.props.auth;
if (!team) return;
const { team, user } = this.props.auth;
if (!team || !user) return;
return (
<Sidebar>
@ -54,21 +54,25 @@ class SettingsSidebar extends React.Component<Props> {
</Section>
<Section>
<Header>Team</Header>
<SidebarLink to="/settings/details" icon={<SettingsIcon />}>
Details
</SidebarLink>
{user.isAdmin && (
<SidebarLink to="/settings/details" icon={<SettingsIcon />}>
Details
</SidebarLink>
)}
<SidebarLink to="/settings/members" icon={<UserIcon />}>
Members
</SidebarLink>
<SidebarLink to="/settings/shares" icon={<LinkIcon />}>
Share Links
</SidebarLink>
<SidebarLink
to="/settings/integrations/slack"
icon={<SettingsIcon />}
>
Integrations
</SidebarLink>
{user.isAdmin && (
<SidebarLink
to="/settings/integrations/slack"
icon={<SettingsIcon />}
>
Integrations
</SidebarLink>
)}
</Section>
</Scrollable>
</Flex>