Skip to content

Commit d3e8084

Browse files
committed
fix: Temporary homepage
1 parent caae61e commit d3e8084

File tree

20 files changed

+105
-21
lines changed

20 files changed

+105
-21
lines changed

client/src/HomeView.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Card, CardContent } from '@mui/material';
2+
import React from 'react';
3+
import Page from './components/Page';
4+
5+
const HomeView = () => (
6+
<Page
7+
title="User list"
8+
>
9+
<Card>
10+
<CardContent>Hello !</CardContent>
11+
</Card>
12+
</Page>
13+
);
14+
15+
export default HomeView;

client/src/api/RequestRoutes.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
import { Request as _Request } from '@fullstack-typescript-monorepo/prisma';
1+
import { Request } from '@fullstack-typescript-monorepo/prisma';
22
import Super from './Super';
33

4-
// Typescript reference error hack
5-
export type Request = {
6-
[key in keyof _Request]: Request[key];
7-
};
8-
94
const RequestRoutes = {
105
...Super<Request>('request'),
116
};

client/src/api/Super.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TableState } from '../components/Datatable';
22
import Fetch from '../utils/fetcher';
33

4-
type RecursivePartial<T> = {
4+
export type RecursivePartial<T> = {
55
[P in keyof T]?: RecursivePartial<T[P]>;
66
};
77

client/src/layouts/AdminLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useAuth } from '../hooks/useAuth';
66
const AdminLayout = () => {
77
const auth = useAuth();
88

9-
return auth.user.admin ? <Outlet /> : <Navigate to="/app/data/table/lptp/sites" />;
9+
return auth.user.admin ? <Outlet /> : <Navigate to="/app/home" />;
1010
};
1111

1212
export default AdminLayout;

client/src/layouts/DashboardLayout/DashboardLayout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const DashboardLayout = () => {
2424
if (!auth.authed) {
2525
const user = localStorage.getItem('user');
2626
const token = localStorage.getItem('token') || '';
27+
2728
if (user) {
2829
auth.signin(user, token).catch((error: ErrorType) => {
2930
localStorage.removeItem('user');

client/src/layouts/DashboardLayout/TopBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const TopBar = ({
2929
{...rest}
3030
>
3131
<Toolbar>
32-
<RouterLink to="/app/data/table/lptp/sites">
32+
<RouterLink to="/app/home">
3333
<Logo sx={{ height: 50 }} />
3434
</RouterLink>
3535
<Box flexGrow={1} />

client/src/layouts/MainLayout/TopBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const TopBar = ({ ...rest }) => (
99
{...rest}
1010
>
1111
<Toolbar sx={{ height: 64 }}>
12-
<RouterLink to="/app/data/table/lptp/sites">
12+
<RouterLink to="/app/home">
1313
<Logo sx={{ height: 50 }} />
1414
</RouterLink>
1515
</Toolbar>

client/src/routes.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { Navigate } from 'react-router-dom';
3+
import HomeView from './HomeView';
34
import AdminLayout from './layouts/AdminLayout';
45
import DashboardLayout from './layouts/DashboardLayout/DashboardLayout';
56
import MainLayout from './layouts/MainLayout/MainLayout';
@@ -15,6 +16,7 @@ const routes = [
1516
path: 'app',
1617
element: <DashboardLayout />,
1718
children: [
19+
{ path: 'home', element: <HomeView /> },
1820
{ path: 'account', element: <AccountView /> },
1921
{
2022
path: 'admin',

client/src/views/auth/LoginView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const LoginView = () => {
4141
Loader.open();
4242
auth.signin(formData.login, formData.password).then(() => {
4343
Loader.close();
44-
navigate('/app/data/table/lptp/sites', { replace: true });
44+
navigate('/app/home', { replace: true });
4545
}).catch((response: string) => {
4646
catchError(Alert, t)(response);
4747
Loader.close();
@@ -64,7 +64,7 @@ const LoginView = () => {
6464
});
6565
}
6666
if (auth.authed) {
67-
navigate('/app/data/table/lptp/sites', { replace: true });
67+
navigate('/app/home', { replace: true });
6868
}
6969
}, [Alert, Loader, auth, navigate, t]);
7070

client/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
"noEmit": true,
2626
"jsx": "react"
2727
},
28+
"include": [
29+
"src"
30+
],
2831
"references": [
2932
{ "path": "../core" },
3033
{ "path": "../prisma" }

0 commit comments

Comments
 (0)