feat(sidebar): remove user data from AppSidebar and update NavUser component usage; refactor ThemeSwitcher to export function

This commit is contained in:
ngc2207 2025-02-04 14:48:36 +08:00
parent c39dd21278
commit 22e4580bc9
2 changed files with 2 additions and 7 deletions

View File

@ -28,11 +28,6 @@ import {
// This is sample data.
const data = {
user: {
name: "shadcn",
email: "m@example.com",
avatar: "/avatars/shadcn.jpg",
},
teams: [
{
name: "Acme Inc",
@ -167,7 +162,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
<NavProjects projects={data.projects} />
</SidebarContent>
<SidebarFooter>
<NavUser user={data.user} />
<NavUser />
</SidebarFooter>
<SidebarRail />
</Sidebar>

View File

@ -13,7 +13,7 @@ const items = [
{ value: "system", label: "System", image: "/ui-system.png" },
];
export default function ThemeSwitcher() {
export function ThemeSwitcher() {
const { theme, setTheme } = useTheme();
const [mounted, setMounted] = useState(false);