index.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { Outlet } from '@tanstack/react-router'
  2. import {
  3. IconBrowserCheck,
  4. IconNotification,
  5. IconPalette,
  6. IconTool,
  7. IconUser,
  8. } from '@tabler/icons-react'
  9. import { Separator } from '@/components/ui/separator'
  10. import { Header } from '@/components/layout/header'
  11. import { Main } from '@/components/layout/main'
  12. import { ProfileDropdown } from '@/components/profile-dropdown'
  13. import { Search } from '@/components/search'
  14. import { ThemeSwitch } from '@/components/theme-switch'
  15. import SidebarNav from './components/sidebar-nav'
  16. export default function Settings() {
  17. return (
  18. <>
  19. {/* ===== Top Heading ===== */}
  20. <Header>
  21. <Search />
  22. <div className='ml-auto flex items-center space-x-4'>
  23. <ThemeSwitch />
  24. <ProfileDropdown />
  25. </div>
  26. </Header>
  27. <Main fixed>
  28. <div className='space-y-0.5'>
  29. <h1 className='text-2xl font-bold tracking-tight md:text-3xl'>
  30. Settings
  31. </h1>
  32. <p className='text-muted-foreground'>
  33. Manage your account settings and set e-mail preferences.
  34. </p>
  35. </div>
  36. <Separator className='my-4 lg:my-6' />
  37. <div className='flex flex-1 flex-col space-y-2 md:space-y-2 overflow-hidden lg:flex-row lg:space-x-12 lg:space-y-0'>
  38. <aside className='top-0 lg:sticky lg:w-1/5'>
  39. <SidebarNav items={sidebarNavItems} />
  40. </aside>
  41. <div className='flex w-full p-1 pr-4 overflow-y-hidden'>
  42. <Outlet />
  43. </div>
  44. </div>
  45. </Main>
  46. </>
  47. )
  48. }
  49. const sidebarNavItems = [
  50. {
  51. title: 'Profile',
  52. icon: <IconUser size={18} />,
  53. href: '/settings',
  54. },
  55. {
  56. title: 'Account',
  57. icon: <IconTool size={18} />,
  58. href: '/settings/account',
  59. },
  60. {
  61. title: 'Appearance',
  62. icon: <IconPalette size={18} />,
  63. href: '/settings/appearance',
  64. },
  65. {
  66. title: 'Notifications',
  67. icon: <IconNotification size={18} />,
  68. href: '/settings/notifications',
  69. },
  70. {
  71. title: 'Display',
  72. icon: <IconBrowserCheck size={18} />,
  73. href: '/settings/display',
  74. },
  75. ]