2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2019-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-12-17 20:25:57 +00:00
|
|
|
import * as React from 'react';
|
|
|
|
import * as styles from './StoryRow.scss';
|
|
|
|
|
2020-09-14 21:56:35 +00:00
|
|
|
type Props = {
|
2019-12-17 20:25:57 +00:00
|
|
|
left?: boolean;
|
|
|
|
right?: boolean;
|
|
|
|
top?: boolean;
|
|
|
|
bottom?: boolean;
|
|
|
|
};
|
|
|
|
|
|
|
|
const getClassName = ({ left, right, top, bottom }: Props) => {
|
|
|
|
if (left) {
|
|
|
|
return styles.left;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (right) {
|
|
|
|
return styles.right;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (top) {
|
|
|
|
return styles.top;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bottom) {
|
|
|
|
return styles.bottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
return styles.base;
|
|
|
|
};
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function StoryRow({
|
2020-09-14 21:56:35 +00:00
|
|
|
children,
|
|
|
|
...props
|
2022-11-18 00:45:19 +00:00
|
|
|
}: React.PropsWithChildren<Props>): JSX.Element {
|
|
|
|
return <div className={getClassName(props)}>{children}</div>;
|
|
|
|
}
|