routing
This commit is contained in:
parent
eda38247ba
commit
28882e7038
10 changed files with 190 additions and 33 deletions
|
|
@ -1,11 +1,22 @@
|
|||
import React from 'react';
|
||||
import './App.css'
|
||||
import Questions from './pages/Questions.tsx'
|
||||
import {BrowserRouter, Navigate, Route, Routes} from "react-router-dom";
|
||||
import {SurveyEditingPage} from "./pages/SurveyEditingPage/SurveyEditingPage.tsx";
|
||||
import Survey from "./components/Survey/Survey.tsx";
|
||||
import SettingSurvey from "./components/SettingSurvey/SettingSurvey.tsx";
|
||||
|
||||
const App: React.FC = () => {
|
||||
return (
|
||||
<Questions />
|
||||
)
|
||||
const App = () => {
|
||||
return(
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/" element={<Navigate to="/survey/edit/questions" replace />} />
|
||||
|
||||
<Route path="survey/edit" element={<SurveyEditingPage />}>
|
||||
<Route path="questions" element={<Survey />} />
|
||||
<Route path="settings" element={<SettingSurvey />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue