Skip to content

Commit

Permalink
refactor: get sidebar data from json
Browse files Browse the repository at this point in the history
  • Loading branch information
shervinchen committed Jun 16, 2024
1 parent 4489fe6 commit e7575ab
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 141 deletions.
140 changes: 0 additions & 140 deletions data/sidebars.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { SIDEBARS } from '@/data/sidebars';
import SIDEBARS from '../sidebars.json';

export default function Sidebar() {
const pathname = usePathname();
Expand Down
140 changes: 140 additions & 0 deletions src/app/sidebars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
[
{
"name": "guide",
"children": [
{
"name": "Getting Started",
"children": [
{
"name": "Introduction",
"url": "/guide/introduction"
},
{
"name": "Installation",
"url": "/guide/installation"
},
{
"name": "Server Render",
"url": "/guide/server-render"
}
]
},
{
"name": "Customization",
"children": [
{
"name": "Colors",
"url": "/guide/colors"
},
{
"name": "Theming",
"url": "/guide/theming"
},
{
"name": "Custom Styles",
"url": "/guide/custom-styles"
}
]
}
]
},
{
"name": "components",
"children": [
{
"name": "General",
"children": [
{
"name": "Button",
"url": "/components/button"
},
{
"name": "Icon",
"url": "/components/icon"
}
]
},
{
"name": "Layout",
"children": [
{
"name": "Grid",
"url": "/components/grid"
},
{
"name": "Layout",
"url": "/components/layout"
}
]
},
{
"name": "Data Entry",
"children": [
{
"name": "Button Group",
"url": "/components/button-group"
},
{
"name": "Checkbox",
"url": "/components/checkbox"
},
{
"name": "Input",
"url": "/components/input"
},
{
"name": "Radio",
"url": "/components/radio"
},
{
"name": "Select",
"url": "/components/select"
},
{
"name": "Toggle",
"url": "/components/toggle"
}
]
},
{
"name": "Data Display",
"children": [
{
"name": "Popover",
"url": "/components/popover"
},
{
"name": "Tooltip",
"url": "/components/tooltip"
}
]
},
{
"name": "Feedback",
"children": [
{
"name": "Loading",
"url": "/components/loading"
},
{
"name": "Modal",
"url": "/components/modal"
}
]
},
{
"name": "Navigation",
"children": [
{
"name": "Pagination",
"url": "/components/pagination"
},
{
"name": "Tabs",
"url": "/components/tabs"
}
]
}
]
}
]

0 comments on commit e7575ab

Please sign in to comment.