Add Page component
This commit is contained in:
parent
b8d3b0578a
commit
4f63ec8ee9
24
src/components/Page/Page.stories.tsx
Normal file
24
src/components/Page/Page.stories.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import "../../styles/globals.css";
|
||||
import "../../styles/components.css";
|
||||
|
||||
import React from "react";
|
||||
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||
|
||||
import { Page } from "./Page";
|
||||
import { Navigation, NavigationItem } from "../Navigation";
|
||||
|
||||
export default {
|
||||
title: "Components/Page",
|
||||
component: Page,
|
||||
} as ComponentMeta<typeof Page>;
|
||||
|
||||
export const Example: ComponentStory<typeof Page> = (args) => (
|
||||
<Page>
|
||||
<div style={{ display: "flex", height: "100%" }}>
|
||||
<div style={{ margin: "auto" }}>Content goes here</div>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
Example.parameters = {
|
||||
layout: "fullscreen",
|
||||
};
|
15
src/components/Page/Page.tsx
Normal file
15
src/components/Page/Page.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import { PropsWithChildren, ReactNode } from "react";
|
||||
import { Navigation } from "../Navigation";
|
||||
|
||||
export interface PageProps {}
|
||||
|
||||
export function Page({ children }: PropsWithChildren<PageProps>) {
|
||||
return (
|
||||
<div className="page">
|
||||
<header>
|
||||
<Navigation />
|
||||
</header>
|
||||
<main>{children}</main>
|
||||
</div>
|
||||
);
|
||||
}
|
0
src/components/Page/index.ts
Normal file
0
src/components/Page/index.ts
Normal file
@ -1,3 +1,21 @@
|
||||
/* Page */
|
||||
|
||||
.page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
height: 100vh;
|
||||
margin: auto;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.page > main {
|
||||
background-color: lavender;
|
||||
display: block;
|
||||
flex: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Navigation */
|
||||
|
||||
.navigation {
|
||||
|
Loading…
Reference in New Issue
Block a user