created Homepage
This commit is contained in:
@@ -22,6 +22,7 @@ import { PhotoShow } from "./components/photos/PhotoShow.tsx";
|
||||
import { TodoList } from "./components/todos/TodoList.tsx";
|
||||
import { TodoEdit } from "./components/todos/TodoEdit.tsx";
|
||||
import { TodoShow } from "./components/todos/TodoShow.tsx";
|
||||
import {HomePage} from "./components/HomePage.tsx";
|
||||
|
||||
export const App = () => (
|
||||
<Admin
|
||||
@@ -29,6 +30,7 @@ export const App = () => (
|
||||
dataProvider={dataProvider}
|
||||
authProvider={authProvider}
|
||||
requireAuth
|
||||
dashboard={HomePage}
|
||||
>
|
||||
<Resource name="users" list={UserList} edit={UserEdit} show={UserShow} />
|
||||
<Resource
|
||||
|
||||
@@ -6,7 +6,7 @@ export const authProvider: AuthProvider = {
|
||||
const user = data.users.find(
|
||||
(u) => u.username === username && u.password === password,
|
||||
);
|
||||
|
||||
|
||||
if (user) {
|
||||
const { password, ...userToPersist } = user;
|
||||
localStorage.setItem("user", JSON.stringify(userToPersist));
|
||||
|
||||
26
src/components/HomePage.tsx
Normal file
26
src/components/HomePage.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Card, CardContent, Typography, Box } from "@mui/material";
|
||||
|
||||
export const HomePage = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
height: "100vh",
|
||||
}}
|
||||
>
|
||||
<Card sx={{ maxWidth: 400, padding: 2, textAlign: "center" }}>
|
||||
<CardContent>
|
||||
<Typography variant="h4" component="div" gutterBottom>
|
||||
Welcome to the Dashboard
|
||||
</Typography>
|
||||
<Typography variant="body1" color="text.secondary">
|
||||
Manage your table effortlessly with the tools provided. Navigate
|
||||
through the menu to get started.
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user