Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fahrtenbuch
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWP WS21_22 - Fahrtenbuch
Team Einhorn
fahrtenbuch
Commits
82810cc5
Commit
82810cc5
authored
3 years ago
by
Leander Tolksdorf
Browse files
Options
Downloads
Patches
Plain Diff
Add page components to router
parent
1548922c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/Router.tsx
+9
-5
9 additions, 5 deletions
client/src/Router.tsx
with
9 additions
and
5 deletions
client/src/Router.tsx
+
9
−
5
View file @
82810cc5
import
React
from
"
react
"
;
import
{
BrowserRouter
,
Route
,
Routes
}
from
"
react-router-dom
"
;
import
UserLayout
from
"
./components/UserLayout
"
;
import
Book
from
"
./pages/Book
"
;
import
BookingForm
from
"
./pages/BookingForm
"
;
import
BookingSignOut
from
"
./pages/BookingSignOut
"
;
import
BookingSignOutSuccess
from
"
./pages/BookingSignOutSuccess
"
;
import
BookingSuccessful
from
"
./pages/BookingSuccessful
"
;
import
Home
from
"
./pages/Home
"
;
function
Router
()
{
...
...
@@ -12,15 +15,16 @@ function Router() {
{
/* Home page (user) */
}
<
Route
index
element
=
{
<
Home
/>
}
/>
{
/* Book a boat (user) */
}
<
Route
path
=
"book"
element
=
{
<
Book
/>
}
>
<
Route
path
=
"book"
>
<
Route
index
element
=
{
<
BookingForm
/>
}
/>
{
/* After booking (user) */
}
<
Route
path
=
"success"
element
=
{
null
}
/>
<
Route
path
=
"success"
element
=
{
<
BookingSuccessful
/>
}
/>
</
Route
>
{
/* Sign out (user) */
}
<
Route
path
=
"signout"
>
<
Route
path
=
":id"
element
=
{
null
}
/>
<
Route
path
=
":id"
element
=
{
<
BookingSignOut
/>
}
/>
{
/* After Sign out (user) */
}
<
Route
path
=
"success"
element
=
{
null
}
/>
<
Route
path
=
"success"
element
=
{
<
BookingSignOutSuccess
/>
}
/>
</
Route
>
</
Route
>
</
Routes
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment