Card container components for a cleaner dashboard
This commit is contained in:
9
src/components/CardContainers/CardContainers.tsx
Normal file
9
src/components/CardContainers/CardContainers.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import style from "./style.module.css";
|
||||||
|
|
||||||
|
export function CardRow({ children }) {
|
||||||
|
return <div className={style.cardRow}>{children}</div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CardColumn({ children }) {
|
||||||
|
return <div className={style.cardColumn}>{children}</div>;
|
||||||
|
}
|
||||||
17
src/components/CardContainers/style.module.css
Normal file
17
src/components/CardContainers/style.module.css
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
.cardColumn {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: stretch;
|
||||||
|
gap: 30px;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cardRow {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: stretch;
|
||||||
|
gap: 30px;
|
||||||
|
}
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
import Card from "@/components/Card/Card";
|
import Card from "@/components/Card/Card";
|
||||||
|
import {
|
||||||
|
CardColumn,
|
||||||
|
CardRow,
|
||||||
|
} from "@/components/CardContainers/CardContainers";
|
||||||
import CardHeader from "@/components/CardHeader/CardHeader";
|
import CardHeader from "@/components/CardHeader/CardHeader";
|
||||||
import Datetime from "@/components/Datetime/Datetime";
|
import Datetime from "@/components/Datetime/Datetime";
|
||||||
import Flatastic from "@/components/Flatastic/Flatastic";
|
import Flatastic from "@/components/Flatastic/Flatastic";
|
||||||
@@ -38,23 +42,24 @@ export default function Dashboard() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${style.dashboard} ${scheme}`}>
|
<div className={`${style.dashboard} ${scheme}`}>
|
||||||
<div className={style.cardWrapper}>
|
<CardColumn>
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader icon="🚊" content="Timetable" />
|
<CardHeader icon="🚊" content="Timetable" />
|
||||||
<Timetable />
|
<Timetable />
|
||||||
</Card>
|
</Card>
|
||||||
<div className={style.clockAndWeather}>
|
|
||||||
<div className={style.small}>
|
<CardRow>
|
||||||
<Card>
|
|
||||||
<CardHeader icon="🕐" content="Clock" />
|
|
||||||
<Datetime />
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader icon="🌤️" content="Weather" />
|
<CardHeader icon="🕐" content="Clock" />
|
||||||
|
<Datetime />
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card>
|
||||||
|
<CardHeader icon="🌤" content="Weather" />
|
||||||
<Weather />
|
<Weather />
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</CardRow>
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader icon="🔔" content="Terminal" active={true} />
|
<CardHeader icon="🔔" content="Terminal" active={true} />
|
||||||
<Terminal />
|
<Terminal />
|
||||||
@@ -64,10 +69,9 @@ export default function Dashboard() {
|
|||||||
<CardHeader icon="🧹" content="Flatastic" />
|
<CardHeader icon="🧹" content="Flatastic" />
|
||||||
<Flatastic />
|
<Flatastic />
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</CardColumn>
|
||||||
<div className={style.footer}>
|
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,29 +19,3 @@
|
|||||||
.night {
|
.night {
|
||||||
background-color: #2a3f55;
|
background-color: #2a3f55;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clockAndWeather {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cardWrapper {
|
|
||||||
margin: 30px;
|
|
||||||
height: 100%;
|
|
||||||
gap: 30px;
|
|
||||||
flex-direction: column;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small {
|
|
||||||
width: 45%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.terminal {
|
|
||||||
margin: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
background-color: #c0c0c0;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
.container {
|
.container {
|
||||||
|
background-color: #c0c0c0;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.taskbar {
|
.taskbar {
|
||||||
|
|||||||
Reference in New Issue
Block a user