-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use StudioContentMenu in SettingsModal (#13899)
Co-authored-by: Jonas Dyrlie <[email protected]> Co-authored-by: Lars <[email protected]>
- Loading branch information
1 parent
604dd65
commit e0deecc
Showing
5 changed files
with
68 additions
and
50 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
43 changes: 43 additions & 0 deletions
43
...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,43 @@ | ||
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 = | ||
(): StudioContentMenuButtonTabProps<SettingsModalTabId>[] => { | ||
const { t } = useTranslation(); | ||
|
||
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 />, | ||
}, | ||
]; | ||
}; |
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'; |