mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-29 15:49:37 +02:00
Table component. Bookmarks edit view
This commit is contained in:
parent
4eaf9659d1
commit
bd5354a2e3
12 changed files with 281 additions and 137 deletions
|
@ -1,6 +1,10 @@
|
|||
import classes from './Layout.module.css';
|
||||
|
||||
export const Container = (props: any): JSX.Element => {
|
||||
interface ComponentProps {
|
||||
children: JSX.Element | JSX.Element[];
|
||||
}
|
||||
|
||||
export const Container = (props: ComponentProps): JSX.Element => {
|
||||
return (
|
||||
<div className={classes.Container}>
|
||||
{props.children}
|
||||
|
|
41
client/src/components/UI/Table/Table.module.css
Normal file
41
client/src/components/UI/Table/Table.module.css
Normal file
|
@ -0,0 +1,41 @@
|
|||
.TableContainer {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.Table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.Table th,
|
||||
.Table td {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* Head */
|
||||
|
||||
.Table th {
|
||||
--header-radius: 4px;
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-background);
|
||||
}
|
||||
|
||||
.Table th:first-child {
|
||||
border-top-left-radius: var(--header-radius);
|
||||
border-bottom-left-radius: var(--header-radius);
|
||||
}
|
||||
|
||||
.Table th:last-child {
|
||||
border-top-right-radius: var(--header-radius);
|
||||
border-bottom-right-radius: var(--header-radius);
|
||||
}
|
||||
|
||||
/* Body */
|
||||
|
||||
.Table td {
|
||||
/* opacity: 0.5; */
|
||||
transition: all 0.2s;
|
||||
}
|
25
client/src/components/UI/Table/Table.tsx
Normal file
25
client/src/components/UI/Table/Table.tsx
Normal file
|
@ -0,0 +1,25 @@
|
|||
import classes from './Table.module.css';
|
||||
|
||||
interface ComponentProps {
|
||||
children: JSX.Element | JSX.Element[];
|
||||
headers: string[];
|
||||
}
|
||||
|
||||
const Table = (props: ComponentProps): JSX.Element => {
|
||||
return (
|
||||
<div className={classes.TableContainer}>
|
||||
<table className={classes.Table}>
|
||||
<thead className={classes.TableHead}>
|
||||
<tr>
|
||||
{props.headers.map((header: string, index: number): JSX.Element => (<th key={index}>{header}</th>))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className={classes.TableBody}>
|
||||
{props.children}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Table;
|
Loading…
Add table
Add a link
Reference in a new issue