mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-12 03:01:47 +00:00
Create Home page
This commit is contained in:
24
dashboard/src/states/Dashboard/pages/Home/Home.jsx
Normal file
24
dashboard/src/states/Dashboard/pages/Home/Home.jsx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import {Stack, Typography} from "@mui/material";
|
||||||
|
import {useContext} from "react";
|
||||||
|
import {UserContext} from "@contexts/User";
|
||||||
|
import {ProjectContext} from "@/states/Dashboard/contexts/Project";
|
||||||
|
import ProjectBox from "./components/ProjectBox";
|
||||||
|
|
||||||
|
export const Home = () => {
|
||||||
|
|
||||||
|
const {user} = useContext(UserContext);
|
||||||
|
const {projects} = useContext(ProjectContext);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack gap={2}>
|
||||||
|
<Typography variant="h2" fontWeight="bold">Dashboard</Typography>
|
||||||
|
<Typography variant="h5">Welcome back, <Typography variant="span"
|
||||||
|
color="primary">{user.username}</Typography>.</Typography>
|
||||||
|
|
||||||
|
<Typography variant="h4" fontWeight="bold" mt={3}>Your projects:</Typography>
|
||||||
|
<Stack direction="row" gap={2} flexWrap="wrap">
|
||||||
|
{projects.map((project, index) => <ProjectBox project={project} key={index}/>)}
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
)
|
||||||
|
}
|
||||||
1
dashboard/src/states/Dashboard/pages/Home/index.js
Normal file
1
dashboard/src/states/Dashboard/pages/Home/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {Home as default} from "./Home.jsx";
|
||||||
Reference in New Issue
Block a user