mirror of
https://github.com/dzeiocom/components.git
synced 2025-08-14 23:21:59 +00:00
9
src/Container/Container.module.styl
Normal file
9
src/Container/Container.module.styl
Normal file
@@ -0,0 +1,9 @@
|
||||
.container
|
||||
padding 0 32px
|
||||
width 100%
|
||||
max-width 1280px + @padding[1] * 2
|
||||
margin auto auto
|
||||
> *:not(:first-child)
|
||||
margin-top 48px
|
||||
&.main
|
||||
margin 48px auto
|
19
src/Container/Container.stories.tsx
Normal file
19
src/Container/Container.stories.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Meta } from '@storybook/react/types-6-0'
|
||||
import React from 'react'
|
||||
import Component from '.'
|
||||
import Text from '../Text'
|
||||
|
||||
export default {
|
||||
title: 'DZEIO/Container',
|
||||
component: Component,
|
||||
argTypes: {
|
||||
title: { control: 'text'}
|
||||
},
|
||||
parameters: {
|
||||
layout: 'fullscreen'
|
||||
}
|
||||
} as Meta
|
||||
|
||||
export const Basic = (args: any) => (
|
||||
<Component {...args}><Text>Test</Text></Component>
|
||||
)
|
16
src/Container/index.tsx
Normal file
16
src/Container/index.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import React from 'react'
|
||||
import { buildClassName } from '../Util'
|
||||
|
||||
import css from './Container.module.styl'
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode
|
||||
className?: string
|
||||
mainContainer?: boolean
|
||||
}
|
||||
|
||||
export default class Container extends React.Component<Props> {
|
||||
|
||||
public render = () => React.createElement(this.props.mainContainer ? 'main' : 'div', {className: buildClassName(css.container, this.props.className, [css.main, this.props.mainContainer]), children: this.props.children})
|
||||
|
||||
}
|
Reference in New Issue
Block a user