chore(ui): add close button to sidebar

This commit is contained in:
theborakompanioni 2026-01-10 19:35:38 +01:00
parent a4dedd49a1
commit 11782f61c3
No known key found for this signature in database
GPG key ID: E8070AF0053AAC0D
2 changed files with 10 additions and 2 deletions

View file

@ -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) => (

View file

@ -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}