CB-4417 :refactor Version to module styles

This commit is contained in:
s.teleshev
2023-12-19 11:33:03 +01:00
parent bb76f01886
commit 0a9e8a7a0c
2 changed files with 12 additions and 15 deletions
@@ -0,0 +1,3 @@
.tableColumnValueExpand {
cursor: pointer;
}
@@ -6,34 +6,28 @@
* you may not use this file except in compliance with the License.
*/
import { observer } from 'mobx-react-lite';
import styled, { css } from 'reshadow';
import { TableColumnValue, TableItem, TableItemExpand, useStyles } from '@cloudbeaver/core-blocks';
import { s, TableColumnValue, TableItem, TableItemExpand, useS } from '@cloudbeaver/core-blocks';
import type { IVersion } from '@cloudbeaver/core-version';
import styles from './Version.m.css';
import { VersionInfo } from './VersionInfo';
const styles = css`
TableColumnValue[expand] {
cursor: pointer;
}
TableColumnValue[|gap] {
gap: 16px;
}
`;
interface Props {
version: IVersion;
}
export const Version = observer<Props>(function Version({ version }) {
return styled(useStyles(styles))(
const style = useS(styles);
return (
<TableItem item={version.number} expandElement={VersionInfo}>
<TableColumnValue centerContent flex expand>
<TableColumnValue className={s(style, { tableColumnValueExpand: true })} centerContent flex expand>
<TableItemExpand />
</TableColumnValue>
<TableColumnValue expand>{version.number}</TableColumnValue>
<TableColumnValue className={s(style, { tableColumnValueExpand: true })} expand>
{version.number}
</TableColumnValue>
<TableColumnValue>{version.date}</TableColumnValue>
</TableItem>,
</TableItem>
);
});