-
-
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.
fix(layout): adjust new note button on mobile (#182)
* fix(layout) Adjust new note button on mobile * Use hamburger on mobile * Continue building mobile nav bar menu * Lint * Fix Dropdown menu sub trigger * Revert "fix(layout) Adjust new note button on mobile" This reverts commit 37c63c8. * Remove empty keys
- Loading branch information
Showing
7 changed files
with
94 additions
and
33 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
44 changes: 44 additions & 0 deletions
44
packages/app-client/src/modules/ui/components/navbar-sub-menus.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,44 @@ | ||
import { useI18n } from '@/modules/i18n/i18n.provider'; | ||
import { cn } from '@/modules/shared/style/cn'; | ||
import { useThemeStore } from '@/modules/theme/theme.store'; | ||
import { DropdownMenuItem, DropdownMenuSeparator } from './dropdown-menu'; | ||
|
||
export function ThemeSwitcher() { | ||
const themeStore = useThemeStore(); | ||
const { t } = useI18n(); | ||
return ( | ||
<> | ||
<DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'light' })} class="flex items-center gap-2 cursor-pointer"> | ||
<div class="i-tabler-sun text-lg"></div> | ||
{t('navbar.theme.light-mode')} | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'dark' })} class="flex items-center gap-2 cursor-pointer"> | ||
<div class="i-tabler-moon text-lg"></div> | ||
{t('navbar.theme.dark-mode')} | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => themeStore.setColorMode({ mode: 'system' })} class="flex items-center gap-2 cursor-pointer"> | ||
<div class="i-tabler-device-laptop text-lg"></div> | ||
{t('navbar.theme.system-mode')} | ||
</DropdownMenuItem> | ||
</> | ||
); | ||
} | ||
|
||
export function LanguageSwitcher() { | ||
const { t, getLocale, setLocale, locales } = useI18n(); | ||
return ( | ||
<> | ||
{locales.map(locale => ( | ||
<DropdownMenuItem onClick={() => setLocale(locale.key)} class={cn('flex items-center gap-2 cursor-pointer', { 'font-semibold': getLocale() === locale.key })}> | ||
{locale.name} | ||
</DropdownMenuItem> | ||
))} | ||
|
||
<DropdownMenuSeparator /> | ||
|
||
<DropdownMenuItem as="a" class="flex items-center gap-2 cursor-pointer" target="_blank" rel="noopener noreferrer" href="https://github.com/CorentinTh/enclosed/tree/main/packages/app-client/src/locales"> | ||
{t('navbar.settings.contribute-to-i18n')} | ||
</DropdownMenuItem> | ||
</> | ||
); | ||
} |
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