fix: Correct session creation flow
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"types": ["node", "jest"],
|
"types": ["node", "jest"],
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": "./src",
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import { ThemeProvider, CssBaseline } from '@mui/material';
|
import { ThemeProvider, CssBaseline } from '@mui/material';
|
||||||
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
||||||
import theme from './theme';
|
import theme from './theme';
|
||||||
|
import StartPage from './pages/StartPage';
|
||||||
import CreateSession from './pages/CreateSession';
|
import CreateSession from './pages/CreateSession';
|
||||||
|
|
||||||
import SessionPage from './pages/SessionPage';
|
import SessionPage from './pages/SessionPage';
|
||||||
@@ -12,7 +13,8 @@ function App() {
|
|||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
<Router>
|
<Router>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<CreateSession />} />
|
<Route path="/" element={<StartPage />} />
|
||||||
|
<Route path="/create" element={<CreateSession />} />
|
||||||
{/* Other routes will be added here */}
|
{/* Other routes will be added here */}
|
||||||
<Route path="/session/:sessionId" element={<SessionPage />} />
|
<Route path="/session/:sessionId" element={<SessionPage />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
42
frontend/src/pages/StartPage.tsx
Normal file
42
frontend/src/pages/StartPage.tsx
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Box, Typography, Container, Button } from '@mui/material';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
|
const StartPage = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const handleCreateClick = () => {
|
||||||
|
navigate('/create');
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Container maxWidth="sm">
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
marginTop: 8,
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
alignItems: 'center',
|
||||||
|
textAlign: 'center'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography component="h1" variant="h4" gutterBottom>
|
||||||
|
Welcome to Agree on Desires
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="h6" color="text.secondary" paragraph>
|
||||||
|
A simple tool to help groups of people make decisions together.
|
||||||
|
</Typography>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
size="large"
|
||||||
|
sx={{ mt: 4 }}
|
||||||
|
onClick={handleCreateClick}
|
||||||
|
>
|
||||||
|
Create a New Session
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default StartPage;
|
||||||
Reference in New Issue
Block a user