change(ui): header settings menu order
This commit is contained in:
parent
b2172cbaaa
commit
089b257dc7
1 changed files with 16 additions and 12 deletions
|
|
@ -9,12 +9,15 @@ interface Props {
|
|||
className: string;
|
||||
account: any;
|
||||
}
|
||||
|
||||
function SettingsMenu(props: RouteComponentProps<Props>) {
|
||||
const { history, account, className }: any = props;
|
||||
const isAdmin = account.admin || account.superAdmin;
|
||||
const isEnterprise = account.edition === 'ee';
|
||||
const navigateTo = (path: any) => {
|
||||
switch (path) {
|
||||
case 'sessions-listing':
|
||||
return history.push(clientRoute(CLIENT_TABS.SESSIONS_LISTING));
|
||||
case 'projects':
|
||||
return history.push(clientRoute(CLIENT_TABS.SITES));
|
||||
case 'team':
|
||||
|
|
@ -38,23 +41,24 @@ function SettingsMenu(props: RouteComponentProps<Props>) {
|
|||
style={{ width: '160px', marginTop: '34px' }}
|
||||
className={cn(className, 'rounded absolute -right-4 top-0 bg-white border p-2 text-left')}
|
||||
>
|
||||
<MenuItem onClick={() => navigateTo('projects')} label="Projects" icon="folder2" />
|
||||
<MenuItem onClick={() => navigateTo('sessions-listing')} label='Sessions Listing' icon='folder2' />
|
||||
<MenuItem onClick={() => navigateTo('integrations')} label='Integrations' icon='puzzle' />
|
||||
<MenuItem onClick={() => navigateTo('metadata')} label='Metadata' icon='tags' />
|
||||
<MenuItem onClick={() => navigateTo('webhooks')} label='Webhooks' icon='link-45deg' />
|
||||
<MenuItem onClick={() => navigateTo('projects')} label='Projects' icon='folder2' />
|
||||
{isAdmin && (
|
||||
<MenuItem onClick={() => navigateTo('team')} label="Team" icon="users" />
|
||||
<MenuItem onClick={() => navigateTo('team')} label='Team' icon='users' />
|
||||
)}
|
||||
<MenuItem onClick={() => navigateTo('metadata')} label="Metadata" icon="tags" />
|
||||
<MenuItem onClick={() => navigateTo('webhooks')} label="Webhooks" icon="link-45deg" />
|
||||
<MenuItem onClick={() => navigateTo('integrations')} label="Integrations" icon="puzzle" />
|
||||
{isEnterprise && isAdmin && (
|
||||
<>
|
||||
<MenuItem onClick={() => navigateTo('roles')} label="Roles & Access" icon="diagram-3" />
|
||||
<MenuItem onClick={() => navigateTo('audit')} label="Audit" icon="list-ul" />
|
||||
<MenuItem onClick={() => navigateTo('roles')} label='Roles & Access' icon='diagram-3' />
|
||||
<MenuItem onClick={() => navigateTo('audit')} label='Audit' icon='list-ul' />
|
||||
</>
|
||||
)}
|
||||
<MenuItem
|
||||
onClick={() => navigateTo('notifications')}
|
||||
label="Notifications"
|
||||
icon="bell-slash"
|
||||
label='Notifications'
|
||||
icon='bell-slash'
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -65,11 +69,11 @@ export default withRouter(SettingsMenu);
|
|||
function MenuItem({ onClick, label, icon }: any) {
|
||||
return (
|
||||
<div
|
||||
className="rounded border border-transparent p-2 cursor-pointer flex items-center hover:bg-active-blue hover:!border-active-blue-border hover-teal"
|
||||
className='rounded border border-transparent p-2 cursor-pointer flex items-center hover:bg-active-blue hover:!border-active-blue-border hover-teal'
|
||||
onClick={onClick}
|
||||
>
|
||||
<Icon name={icon} size="16" />
|
||||
<button className="ml-2">{label}</button>
|
||||
<Icon name={icon} size='16' />
|
||||
<button className='ml-2'>{label}</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue