mirror of
https://github.com/joinmarket-webui/jam.git
synced 2026-08-19 13:18:30 +02:00
chore(ui): add close button to sidebar
This commit is contained in:
parent
a4dedd49a1
commit
11782f61c3
2 changed files with 10 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
SettingsIcon,
|
||||
UploadIcon,
|
||||
WalletIcon,
|
||||
XIcon,
|
||||
} from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
|
@ -17,6 +18,7 @@ import {
|
|||
SidebarContent,
|
||||
SidebarFooter,
|
||||
SidebarGroup,
|
||||
SidebarGroupAction,
|
||||
SidebarGroupContent,
|
||||
SidebarGroupLabel,
|
||||
SidebarMenu,
|
||||
|
|
@ -25,12 +27,14 @@ import {
|
|||
SidebarMenuSub,
|
||||
SidebarMenuSubButton,
|
||||
SidebarMenuSubItem,
|
||||
useSidebar,
|
||||
} from '@/components/ui/sidebar'
|
||||
import { routes } from '@/constants/routes'
|
||||
import { useFeatures } from '@/hooks/useFeatures'
|
||||
|
||||
export function AppSidebar({ side }: Pick<React.ComponentProps<typeof Sidebar>, 'side'>) {
|
||||
const { t } = useTranslation()
|
||||
const { toggleSidebar } = useSidebar()
|
||||
|
||||
const { isLogsEnabled } = useFeatures()
|
||||
const mainItems = useMemo(
|
||||
|
|
@ -97,6 +101,10 @@ export function AppSidebar({ side }: Pick<React.ComponentProps<typeof Sidebar>,
|
|||
{/*TODO: i18n t('sidebar.title')*/}
|
||||
{t('navbar.title')}
|
||||
</SidebarGroupLabel>
|
||||
<SidebarGroupAction className="cursor-pointer" title={t('global.close')} onClick={() => toggleSidebar()}>
|
||||
<XIcon />
|
||||
<span className="sr-only">{t('global.close')}</span>
|
||||
</SidebarGroupAction>
|
||||
<SidebarGroupContent>
|
||||
<SidebarMenu>
|
||||
{mainItems.map((item) => (
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ import {
|
|||
MoonIcon,
|
||||
DollarSignIcon,
|
||||
KeyIcon,
|
||||
UnlockIcon,
|
||||
FileTextIcon,
|
||||
BookIcon,
|
||||
ExternalLinkIcon,
|
||||
TerminalIcon,
|
||||
PackageSearchIcon,
|
||||
ArrowLeftRightIcon,
|
||||
LockKeyholeIcon,
|
||||
} from 'lucide-react'
|
||||
import { useTheme } from 'next-themes'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
|
@ -146,7 +146,7 @@ export const SettingsPage = ({ walletFileName }: SettingPageProps) => {
|
|||
/>
|
||||
<Separator className="opacity-50" />
|
||||
<SettingItem
|
||||
icon={UnlockIcon}
|
||||
icon={LockKeyholeIcon}
|
||||
title={t('settings.button_lock_wallet')}
|
||||
action={handleLockWallet}
|
||||
disabled={lockWalletQuery.isFetching}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue