mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
comments mock
This commit is contained in:
parent
bdf7ba1ccb
commit
2a6604afaf
18 changed files with 340 additions and 12 deletions
39
src/components/containers/Group/index.tsx
Normal file
39
src/components/containers/Group/index.tsx
Normal file
|
@ -0,0 +1,39 @@
|
|||
import React, { FC } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as styles from './styles.scss';
|
||||
|
||||
type IProps = React.HTMLAttributes<HTMLDivElement> & {
|
||||
horizontal?: boolean;
|
||||
top?: boolean;
|
||||
bottom?: boolean;
|
||||
wrap?: boolean;
|
||||
};
|
||||
|
||||
const Group: FC<IProps> = ({
|
||||
children,
|
||||
className = '',
|
||||
horizontal = false,
|
||||
top = false,
|
||||
bottom = false,
|
||||
wrap = false,
|
||||
...props
|
||||
}) => (
|
||||
<div
|
||||
className={classNames(
|
||||
styles.group,
|
||||
{
|
||||
[styles.horizontal]: horizontal,
|
||||
[styles.vertical]: !horizontal,
|
||||
[styles.top]: top,
|
||||
[styles.bottom]: bottom,
|
||||
[styles.wrap]: wrap,
|
||||
},
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
||||
export { Group };
|
42
src/components/containers/Group/styles.scss
Normal file
42
src/components/containers/Group/styles.scss
Normal file
|
@ -0,0 +1,42 @@
|
|||
.group {
|
||||
display: flex;
|
||||
|
||||
> :global(.group_filler) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
&.vertical {
|
||||
flex-direction: column;
|
||||
|
||||
& > * {
|
||||
margin: $gap/2 0;
|
||||
|
||||
&:first-child { margin-top: 0; }
|
||||
&:last-child { margin-bottom: 0; }
|
||||
}
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
&.top {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
&.bottom {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
& > * {
|
||||
margin: 0 $gap;
|
||||
|
||||
&:first-child { margin-left: 0; }
|
||||
&:last-child { margin-right: 0; }
|
||||
}
|
||||
}
|
||||
|
||||
&.wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue