-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 style: Fix scroll layout and setting panel in mobile
- Loading branch information
1 parent
7a1a6ca
commit 2abac2d
Showing
7 changed files
with
159 additions
and
91 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,24 @@ | ||
import { Segmented } from 'antd'; | ||
import { memo } from 'react'; | ||
|
||
import { SettingsTabs } from '@/features/Setting/Sidebar/index'; | ||
import { useTabItems } from '@/features/Setting/Sidebar/useTabItems'; | ||
|
||
interface SidebarProps { | ||
setTab: (tab: SettingsTabs) => void; | ||
tab: string; | ||
} | ||
|
||
const MobileSidebar = memo<SidebarProps>(({ tab, setTab }) => { | ||
const items = useTabItems(); | ||
return ( | ||
<Segmented | ||
block | ||
onChange={setTab as any} | ||
options={items.map(({ value, label }) => ({ label, value }))} | ||
value={tab} | ||
/> | ||
); | ||
}); | ||
|
||
export default MobileSidebar; |
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
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,15 @@ | ||
import { Brush, FlaskConical, Layout, PanelRight } from 'lucide-react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { SettingsTabs } from '@/features/Setting/Sidebar/index'; | ||
|
||
export const useTabItems = () => { | ||
const { t } = useTranslation(); | ||
|
||
return [ | ||
{ icon: Brush, label: t('setting.tab.appearance'), value: SettingsTabs.Appearance }, | ||
{ icon: Layout, label: t('setting.tab.layout'), value: SettingsTabs.Layout }, | ||
{ icon: PanelRight, label: t('setting.tab.sidebar'), value: SettingsTabs.Sidebar }, | ||
{ icon: FlaskConical, label: t('setting.tab.experimental'), value: SettingsTabs.Experimental }, | ||
]; | ||
}; |
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
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