1
0
Fork 0
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:
muerwre 2019-07-26 18:26:35 +07:00
parent bdf7ba1ccb
commit 2a6604afaf
18 changed files with 340 additions and 12 deletions

View 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 };

View 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;
}
}