Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add templates for menu, header, footer, sider #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@ant-design/icons": "^5.3.5",
"@ant-design/nextjs-registry": "^1.0.0",
"antd": "^5.15.4",
"next": "14.1.4",
Expand Down
Empty file added page.ts
Empty file.
Empty file added src/app/clients/[uid]/page.tsx
Empty file.
Empty file added src/app/clients/page.tsx
Empty file.
7 changes: 6 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from "react";
import { AntdRegistry } from "@ant-design/nextjs-registry";
import PageLayout from "@/components/page-layout/PageLayout";

import "../lib/styles/main.css";

const RootLayout = ({ children }: React.PropsWithChildren) => (
<html lang="en">
<body>
<AntdRegistry>{children}</AntdRegistry>
<AntdRegistry>
<PageLayout>{children}</PageLayout>
</AntdRegistry>
</body>
</html>
);
Expand Down
Empty file added src/app/offers/[uid]/page.tsx
Empty file.
Empty file added src/app/offers/page.tsx
Empty file.
8 changes: 2 additions & 6 deletions src/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
justify-content: space-between;
align-items: center;
padding: 6rem;
min-height: 100vh;
/* min-height: 100vh; */
}

.description {
Expand Down Expand Up @@ -194,11 +194,7 @@
inset: auto 0 0;
padding: 2rem;
height: 200px;
background: linear-gradient(
to bottom,
transparent 0%,
rgb(var(--background-end-rgb)) 40%
);
background: linear-gradient(to bottom, transparent 0%, rgb(var(--background-end-rgb)) 40%);
z-index: 1;
}
}
Expand Down
Empty file.
17 changes: 17 additions & 0 deletions src/components/menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import { Menu } from "antd";
import { UploadOutlined, UserOutlined, VideoCameraOutlined } from "@ant-design/icons";
import styles from "./Menu.module.css";

const items = [UserOutlined, VideoCameraOutlined, UploadOutlined, UserOutlined].map(
(icon, index) => ({
key: String(index + 1),
icon: React.createElement(icon),
label: `nav ${index + 1}`,
}),
);

const PageMenu = (props) => {
return <Menu theme="dark" mode="inline" defaultSelectedKeys={["4"]} items={items} />;
};
export default PageMenu;
Empty file.
Empty file.
37 changes: 37 additions & 0 deletions src/components/page-layout/PageLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"use client";
import React, { useState } from "react";
import Layout, { Content, Footer, Header } from "antd/es/layout/layout";
import Sider from "../sider/Sider";

const PageLayout = ({ children }: React.PropsWithChildren) => {
return (
<Layout
style={{
height: "100vh",
}}>
<Sider />
<Layout>
<Header
style={{
padding: 0,
background: "#f5f5f5",
borderBottom: "1px solid #ddd",
boxShadow: "1px 5px 15px rgba(0, 0, 0, 0.25)",
}}
/>
<Content style={{ margin: "24px 16px 0" }}>
<div
style={{
padding: 24,
minHeight: 360,
}}>
{children}
</div>
</Content>
<Footer style={{ textAlign: "center" }}>Ant Design ©{new Date().getFullYear()}</Footer>
</Layout>
</Layout>
);
};

export default PageLayout;
15 changes: 15 additions & 0 deletions src/components/sider/Sider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React, { useState } from "react";
import Sider from "antd/es/layout/Sider";
import PageMenu from "../menu/Menu";

const PageSider: React.FC = () => {
const [collapsed, setCollapsed] = useState(false);

return (
<Sider breakpoint="lg" collapsedWidth="0" collapsed={collapsed}>
<PageMenu />
</Sider>
);
};

export default PageSider;
4 changes: 4 additions & 0 deletions src/lib/styles/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
margin: 0;
padding: 0;
}