-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use StudioContentMenu in SettingsModal
- Loading branch information
Showing
5 changed files
with
70 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
.leftNavWrapper { | ||
overflow-y: auto; | ||
width: 250px; | ||
} | ||
|
||
.contentWrapper { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...ader/SubHeader/SettingsModalButton/SettingsModal/hooks/useSettingsModalMenuTabConfigs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import type { SettingsModalTabId } from '../../../../../../types/SettingsModalTabId'; | ||
import { | ||
InformationSquareIcon, | ||
SidebarBothIcon, | ||
ShieldLockIcon, | ||
TimerStartIcon, | ||
} from '@studio/icons'; | ||
import { useTranslation } from 'react-i18next'; | ||
import type { StudioContentMenuButtonTabProps } from '@studio/components'; | ||
|
||
const aboutTabId: SettingsModalTabId = 'about'; | ||
const setupTabId: SettingsModalTabId = 'setup'; | ||
const policyTabId: SettingsModalTabId = 'policy'; | ||
const accessControlTabId: SettingsModalTabId = 'access_control'; | ||
|
||
export const useSettingsModalMenuTabConfigs = () => { | ||
const { t } = useTranslation(); | ||
|
||
const getMenuTabConfigs = (): StudioContentMenuButtonTabProps<SettingsModalTabId>[] => { | ||
return [ | ||
{ | ||
tabId: aboutTabId, | ||
tabName: t(`settings_modal.left_nav_tab_${aboutTabId}`), | ||
icon: <InformationSquareIcon />, | ||
}, | ||
{ | ||
tabId: setupTabId, | ||
tabName: t(`settings_modal.left_nav_tab_${setupTabId}`), | ||
icon: <SidebarBothIcon />, | ||
}, | ||
{ | ||
tabId: policyTabId, | ||
tabName: t(`settings_modal.left_nav_tab_${policyTabId}`), | ||
icon: <ShieldLockIcon />, | ||
}, | ||
{ | ||
tabId: accessControlTabId, | ||
tabName: t(`settings_modal.left_nav_tab_${accessControlTabId}`), | ||
icon: <TimerStartIcon />, | ||
}, | ||
]; | ||
}; | ||
|
||
return { getMenuTabConfigs }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import type { SettingsModalTab } from './SettingsModalTab'; | ||
import type { SettingsModalTabId } from './SettingsModalTabId'; | ||
|
||
export type SettingsModalHandle = { | ||
openSettings: (tab?: SettingsModalTab) => void; | ||
openSettings: (tab?: SettingsModalTabId) => void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type SettingsModalTabId = 'about' | 'setup' | 'policy' | 'access_control'; |