mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-09 14:03:11 +08:00
Added CompactTable and ActionIcons UI components
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
.ActionIcons {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ActionIcons svg {
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.ActionIcons svg:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
10
client/src/components/UI/Icons/ActionIcons/ActionIcons.tsx
Normal file
10
client/src/components/UI/Icons/ActionIcons/ActionIcons.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ReactNode } from 'react';
|
||||
import styles from './ActionIcons.module.css';
|
||||
|
||||
interface Props {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export const ActionIcons = ({ children }: Props): JSX.Element => {
|
||||
return <span className={styles.ActionIcons}>{children}</span>;
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
.CompactTable {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.CompactTable span {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.CompactTable span:last-child {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.Separator {
|
||||
border-bottom: 1px solid var(--color-primary);
|
||||
margin: 10px 0;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { ReactNode } from 'react';
|
||||
import classes from './CompactTable.module.css';
|
||||
|
||||
interface Props {
|
||||
headers: string[];
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export const CompactTable = ({ headers, children }: Props): JSX.Element => {
|
||||
return (
|
||||
<div
|
||||
className={classes.CompactTable}
|
||||
style={{ gridTemplateColumns: `repeat(${headers.length}, 1fr)` }}
|
||||
>
|
||||
{headers.map((h, idx) => (
|
||||
<span key={idx}>{h}</span>
|
||||
))}
|
||||
|
||||
<div
|
||||
className={classes.Separator}
|
||||
style={{ gridColumn: `1 / ${headers.length + 1}` }}
|
||||
></div>
|
||||
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,10 +1,12 @@
|
||||
export * from './Table/Table';
|
||||
export * from './Tables/Table/Table';
|
||||
export * from './Tables/CompactTable/CompactTable';
|
||||
export * from './Spinner/Spinner';
|
||||
export * from './Notification/Notification';
|
||||
export * from './Modal/Modal';
|
||||
export * from './Layout/Layout';
|
||||
export * from './Icons/Icon/Icon';
|
||||
export * from './Icons/WeatherIcon/WeatherIcon';
|
||||
export * from './Icons/ActionIcons/ActionIcons';
|
||||
export * from './Headlines/Headline/Headline';
|
||||
export * from './Headlines/SectionHeadline/SectionHeadline';
|
||||
export * from './Headlines/SettingsHeadline/SettingsHeadline';
|
||||
|
||||
Reference in New Issue
Block a user