-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): UI Kit Docs 페이지 와꾸 추가 (#62)
* feat(docs): 대략적인 레이아웃 추가 * feat(docs): BasicLayout 추가 * Docs Ui Kit 버전 업 * feat(docs): 사이드 메뉴 대충 와꾸 잡음 * feat(docs): Getting Started 추가
- Loading branch information
Showing
25 changed files
with
420 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
import App from 'next/app'; | ||
import React from 'react'; | ||
import { AppProps } from 'next/app'; | ||
import { LubyconUIKitProvider } from '@lubycon/ui-kit'; | ||
|
||
import 'normalize.css'; | ||
import '@lubycon/ui-kit/css/lubycon-ui-kit.min.css'; | ||
import Head from 'next/head'; | ||
|
||
export default App; | ||
export default function LubyconUIKitDocsApp({ Component, pageProps }: AppProps) { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Lubycon UI Kit</title> | ||
<meta charSet="utf-8" /> | ||
<meta name="viewport" content="initial-scale=1.0, width=device-width" /> | ||
</Head> | ||
<LubyconUIKitProvider> | ||
<Component {...pageProps} /> | ||
</LubyconUIKitProvider> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import Document, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'; | ||
|
||
class LubyconUIKitDocsDocument extends Document { | ||
static async getInitialProps(ctx: DocumentContext) { | ||
const initialProps = await Document.getInitialProps(ctx); | ||
return { ...initialProps }; | ||
} | ||
|
||
render() { | ||
return ( | ||
<Html lang="ko"> | ||
<Head /> | ||
<body> | ||
<Main /> | ||
<NextScript /> | ||
</body> | ||
</Html> | ||
); | ||
} | ||
} | ||
|
||
export default LubyconUIKitDocsDocument; |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'pages/GettingStartedPage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'pages/HomePage'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Row, Column, Container } from '@lubycon/ui-kit'; | ||
import GlobalHeader from 'components/GlobalHeader'; | ||
import GlobalSidebar from 'components/GlobalSidebar'; | ||
import React, { PropsWithChildren, useState, useEffect, useRef } from 'react'; | ||
|
||
const BasicLayout = ({ children }: PropsWithChildren<unknown>) => { | ||
const headerRef = useRef<HTMLElement>(null); | ||
const [headerHeight, setHeaderHeight] = useState(0); | ||
|
||
const contentsHeight = `calc(100vh - ${headerHeight}px)`; | ||
|
||
useEffect(() => { | ||
if (headerRef.current != null) { | ||
const rect = headerRef.current.getBoundingClientRect(); | ||
setHeaderHeight(rect.height); | ||
} | ||
}, [headerRef.current]); | ||
|
||
return ( | ||
<div> | ||
<header | ||
ref={headerRef} | ||
css={{ | ||
position: 'fixed', | ||
top: 0, | ||
left: 0, | ||
width: '100%', | ||
zIndex: 100, | ||
}} | ||
> | ||
<GlobalHeader /> | ||
</header> | ||
<div | ||
css={{ | ||
paddingTop: headerHeight, | ||
}} | ||
> | ||
<Container> | ||
<Row css={{ height: contentsHeight }}> | ||
<Column | ||
as="aside" | ||
xs="auto" | ||
css={{ | ||
width: 300, | ||
overflowY: 'scroll', | ||
height: '100%', | ||
}} | ||
> | ||
<GlobalSidebar /> | ||
</Column> | ||
<Column | ||
css={{ | ||
overflowY: 'scroll', | ||
height: '100%', | ||
}} | ||
> | ||
{children} | ||
</Column> | ||
</Row> | ||
</Container> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BasicLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react'; | ||
import { Menu, menu } from 'constants/menu'; | ||
import Link from 'next/link'; | ||
import { isLinkMenu } from 'utils/menu'; | ||
import { colors, Text } from '@lubycon/ui-kit'; | ||
import styled from '@emotion/styled'; | ||
|
||
const StyledList = styled.ul` | ||
margin: 0; | ||
padding: 0; | ||
`; | ||
const StyledListItem = styled.li` | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
`; | ||
|
||
const Item = ({ menu }: { menu: Menu }) => { | ||
return isLinkMenu(menu) ? ( | ||
<Link href={menu.link}> | ||
<Text as="a" css={{ cursor: 'pointer' }}> | ||
{menu.title} | ||
</Text> | ||
</Link> | ||
) : ( | ||
<div> | ||
<Text>{menu.title}</Text> | ||
<StyledList> | ||
{menu.children.map((childrenMenu, index) => ( | ||
<StyledListItem | ||
key={index} | ||
css={{ | ||
paddingLeft: 16, | ||
borderLeft: `1px solid ${colors.gray20}`, | ||
color: colors.gray70, | ||
}} | ||
> | ||
<Item menu={childrenMenu} /> | ||
</StyledListItem> | ||
))} | ||
</StyledList> | ||
</div> | ||
); | ||
}; | ||
|
||
const GlobalSidebar = () => { | ||
return ( | ||
<div css={{ boxShadow: '0px 3px 5px rgba(0, 0, 0, 0.1)', height: '100%', padding: 16 }}> | ||
<StyledList> | ||
{menu.map((item, index) => ( | ||
<StyledListItem key={index} css={{ marginBottom: 8 }}> | ||
<Item menu={item} /> | ||
</StyledListItem> | ||
))} | ||
</StyledList> | ||
</div> | ||
); | ||
}; | ||
|
||
export default GlobalSidebar; |
Oops, something went wrong.