Feat: started work with Mantine
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { ColorSchemeScript, MantineProvider } from "@mantine/core";
|
||||
import "@mantine/core/styles.css";
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.scss";
|
||||
@@ -25,10 +27,11 @@ export default function RootLayout({
|
||||
return (
|
||||
<html lang="ru" suppressHydrationWarning>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta charSet="utf-8" />
|
||||
<ColorSchemeScript />
|
||||
</head>
|
||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>{children}</body>
|
||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
|
||||
<MantineProvider>{children}</MantineProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,42 @@
|
||||
"use client";
|
||||
|
||||
import { AppShell, Burger, Button, Group, Skeleton, useMantineColorScheme } from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { LuSun } from "react-icons/lu";
|
||||
|
||||
export default function Home() {
|
||||
const [opened, { toggle }] = useDisclosure();
|
||||
const { setColorScheme, colorScheme } = useMantineColorScheme();
|
||||
return (
|
||||
<div>
|
||||
<p>Test</p>
|
||||
</div>
|
||||
<AppShell
|
||||
header={{ height: 60 }}
|
||||
navbar={{ width: 300, breakpoint: "sm", collapsed: { mobile: !opened } }}
|
||||
padding="md"
|
||||
>
|
||||
<AppShell.Header>
|
||||
<Group h="100%" px="md">
|
||||
<Burger opened={opened} onClick={toggle} size="sm" hiddenFrom="sm" />
|
||||
<div>Logo</div>
|
||||
</Group>
|
||||
</AppShell.Header>
|
||||
<AppShell.Navbar p="md">
|
||||
{Array(15)
|
||||
.fill(0)
|
||||
.map((_, index) => (
|
||||
<Skeleton key={index} h={28} mt="sm" animate={false} />
|
||||
))}
|
||||
<Button
|
||||
onClick={() => {
|
||||
setColorScheme(colorScheme === "light" ? "dark" : "light");
|
||||
}}
|
||||
>
|
||||
<LuSun />
|
||||
</Button>
|
||||
</AppShell.Navbar>
|
||||
<AppShell.Main>Main</AppShell.Main>
|
||||
<AppShell.Footer>
|
||||
<div>Footer</div>
|
||||
</AppShell.Footer>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user