diff --git a/pages/document/[slug].tsx b/pages/document/[slug].tsx index 09fa387c..32c7d4f5 100644 --- a/pages/document/[slug].tsx +++ b/pages/document/[slug].tsx @@ -28,7 +28,12 @@ const Index: NextPage = props => { {props.data.name} - + ) diff --git a/src/components/Block/index.tsx b/src/components/Block/index.tsx index 75c5c64c..02a5910e 100644 --- a/src/components/Block/index.tsx +++ b/src/components/Block/index.tsx @@ -1,4 +1,4 @@ -import './styles.css' +import s from './styles.module.css' import cx from 'classnames' import { createElement } from 'react' @@ -10,7 +10,13 @@ export type BlockProps = { } export const Block: React.FC = ({ as = 'div', style, direction, ...props }) => { - const newProps = { className: cx('block', direction), style } + const directionClass = direction === 'horizontal' + ? s.horizontal + : s.vertical + const newProps = { + className: cx(s.block, directionClass), + style, + } return createElement(as, newProps, props.children) } diff --git a/src/components/Block/styles.css b/src/components/Block/styles.module.css similarity index 81% rename from src/components/Block/styles.css rename to src/components/Block/styles.module.css index 13b9cb72..9676ac32 100644 --- a/src/components/Block/styles.css +++ b/src/components/Block/styles.module.css @@ -5,10 +5,10 @@ justify-content: flex-start; } -.block.horizontal { +.horizontal { flex-direction: row; } -.block.vertical { +.vertical { flex-direction: column; } diff --git a/src/components/Breadcrumbs/index.tsx b/src/components/Breadcrumbs/index.tsx index ee5ba6a7..b86b5e68 100644 --- a/src/components/Breadcrumbs/index.tsx +++ b/src/components/Breadcrumbs/index.tsx @@ -1,4 +1,4 @@ -import './styles.css' +import s from './styles.module.css' import { IBreadcumbsPart } from 'src/types' import { Button } from '../Button' @@ -14,7 +14,7 @@ export const Breadcrumbs: React.FC = props => { const items = insertBetween(props.items, () => '/') return ( -