refactor: remove 'show only link names in navbar' in settings on mobile

This commit is contained in:
Kentai Radiquum 2025-03-27 20:54:43 +05:00
parent bf67b5d928
commit 1959fcd437
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
2 changed files with 20 additions and 19 deletions

View file

@ -87,7 +87,7 @@ export const Navbar = () => {
return ( return (
<> <>
<header className="fixed bottom-0 left-0 z-50 w-full text-white bg-black rounded-t-lg sm:sticky sm:top-0 sm:rounded-t-none sm:rounded-b-lg"> <header className="fixed bottom-0 left-0 z-50 w-full text-white bg-black rounded-t-lg sm:sticky sm:top-0 sm:rounded-t-none sm:rounded-b-lg">
<div className="container flex items-center justify-center gap-4 mx-auto sm:gap-0 sm:justify-between"> <div className="container flex items-center min-h-[76px] justify-center gap-4 mx-auto sm:gap-0 sm:justify-between">
<div className="flex items-center gap-8 px-2 py-4 sm:gap-4"> <div className="flex items-center gap-8 px-2 py-4 sm:gap-4">
{menuItems.map((item) => { {menuItems.map((item) => {
return ( return (

View file

@ -33,7 +33,7 @@ const NavbarTitles = {
links: "Только ссылки", links: "Только ссылки",
selected: "Только выбранные", selected: "Только выбранные",
never: "Никогда", never: "Никогда",
} };
export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {
const preferenceStore = usePreferencesStore(); const preferenceStore = usePreferencesStore();
@ -169,24 +169,25 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {
</p> </p>
<Dropdown <Dropdown
color="blue" color="blue"
label={ label={NavbarTitles[preferenceStore.flags.showNavbarTitles]}
NavbarTitles[preferenceStore.flags.showNavbarTitles]
}
> >
{Object.keys(NavbarTitles).map((key: "always" | "links" | "selected" | "never") => { {Object.keys(NavbarTitles).map(
return ( (key: "always" | "links" | "selected" | "never") => {
<Dropdown.Item return (
key={`navbar-titles-${key}`} <Dropdown.Item
onClick={() => className={`${key == "links" ? "hidden lg:flex" : ""}`}
preferenceStore.setFlags({ key={`navbar-titles-${key}`}
showNavbarTitles: key, onClick={() =>
}) preferenceStore.setFlags({
} showNavbarTitles: key,
> })
{NavbarTitles[key]} }
</Dropdown.Item> >
); {NavbarTitles[key]}
})} </Dropdown.Item>
);
}
)}
</Dropdown> </Dropdown>
</div> </div>
<HR className="my-4 dark:bg-slate-400" /> <HR className="my-4 dark:bg-slate-400" />