forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 style: Fix setting modal on responsive and some other style problem (…
- Loading branch information
1 parent
d108280
commit f6b4ca4
Showing
8 changed files
with
52 additions
and
81 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
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
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
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
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,16 +1,20 @@ | ||
import { usePathname } from 'next/navigation'; | ||
|
||
import { useQuery } from '@/hooks/useQuery'; | ||
import { SettingsTabs } from '@/store/global/initialState'; | ||
|
||
/** | ||
* Returns the active setting page key (common/sync/agent/...) | ||
*/ | ||
export const useActiveSettingsKey = () => { | ||
const pathname = usePathname(); | ||
const { tab } = useQuery(); | ||
|
||
const tabs = pathname.split('/').at(-1); | ||
|
||
if (tabs === 'settings') return SettingsTabs.Common; | ||
|
||
if (tabs === 'modal') return tab as SettingsTabs; | ||
|
||
return tabs as SettingsTabs; | ||
}; |