index.tsx 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import { Outlet } from 'react-router-dom'
  2. import {
  3. IconBrowserCheck,
  4. IconExclamationCircle,
  5. IconNotification,
  6. IconPalette,
  7. IconTool,
  8. IconUser,
  9. } from '@tabler/icons-react'
  10. import { Search } from '@/components/search'
  11. import { Separator } from '@/components/ui/separator'
  12. import ThemeSwitch from '@/components/theme-switch'
  13. import { UserNav } from '@/components/user-nav'
  14. import { Layout, LayoutBody, LayoutHeader } from '@/components/custom/layout'
  15. import SidebarNav from './components/sidebar-nav'
  16. export default function Settings() {
  17. return (
  18. <Layout fadedBelow fixedHeight>
  19. {/* ===== Top Heading ===== */}
  20. <LayoutHeader>
  21. <Search />
  22. <div className='ml-auto flex items-center space-x-4'>
  23. <ThemeSwitch />
  24. <UserNav />
  25. </div>
  26. </LayoutHeader>
  27. <LayoutBody className='flex flex-col' fixedHeight>
  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-6' />
  37. <div className='flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0'>
  38. <aside className='sticky top-0 lg:w-1/5'>
  39. <SidebarNav items={sidebarNavItems} />
  40. </aside>
  41. <div className='w-full p-1 pr-4 lg:max-w-xl'>
  42. <div className='pb-16'>
  43. <Outlet />
  44. </div>
  45. </div>
  46. </div>
  47. </LayoutBody>
  48. </Layout>
  49. )
  50. }
  51. const sidebarNavItems = [
  52. {
  53. title: 'Profile',
  54. icon: <IconUser size={18} />,
  55. href: '/settings',
  56. },
  57. {
  58. title: 'Account',
  59. icon: <IconTool size={18} />,
  60. href: '/settings/account',
  61. },
  62. {
  63. title: 'Appearance',
  64. icon: <IconPalette size={18} />,
  65. href: '/settings/appearance',
  66. },
  67. {
  68. title: 'Notifications',
  69. icon: <IconNotification size={18} />,
  70. href: '/settings/notifications',
  71. },
  72. {
  73. title: 'Display',
  74. icon: <IconBrowserCheck size={18} />,
  75. href: '/settings/display',
  76. },
  77. {
  78. title: 'Error Example',
  79. icon: <IconExclamationCircle size={18} />,
  80. href: '/settings/error-example',
  81. },
  82. ]