add Block component; copyright refactoring
This commit is contained in:
1 parent
19b54c56e4
commit
01eaffaf14
4 files changed
+46
-27
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { createElement } from 'react'
|
||||
|
||||
export type BlockProps = {
|
||||
style?: React.CSSProperties
|
||||
direction: 'horizontal' | 'vertical'
|
||||
}
|
||||
|
||||
export const Block: React.FC<BlockProps> = props => {
|
||||
return (
|
||||
<div style={props.style}>
|
||||
<style jsx>{`
|
||||
div {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: baseline;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
`}</style>
|
||||
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export const Spacer: React.FC<{ as?: string }> = ({ as = 'div' }) => createElement(as, {
|
||||
style: {
|
||||
flex: 1,
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user