Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bielefeld-CeBiTec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
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
2024 Competition
Bielefeld-CeBiTec
Commits
97452270
Commit
97452270
authored
7 months ago
by
Liliana Sanfilippo
Browse files
Options
Downloads
Patches
Plain Diff
deleted RouteManager
parent
3214070c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#403576
passed
7 months ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/RoutManager.tsx
+0
-56
0 additions, 56 deletions
src/components/RoutManager.tsx
with
0 additions
and
56 deletions
src/components/RoutManager.tsx
deleted
100644 → 0
+
0
−
56
View file @
3214070c
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
{
Routes
,
Route
,
useLocation
}
from
"
react-router-dom
"
;
import
LoadingScreen
from
"
../components/LoadingScreen
"
;
import
{
getPathMapping
}
from
"
../utils/getPathMapping
"
;
import
{
stringToSlug
}
from
"
../utils/stringToSlug
"
;
import
{
NotFound
}
from
"
../components/NotFound
"
;
import
{
Villbuttonrow
}
from
"
../components/Buttons
"
;
const
RouteManager
=
()
=>
{
const
location
=
useLocation
();
const
[
isLoading
,
setIsLoading
]
=
useState
(
true
);
// Start with true to show the loading screen initially
const
pathMapping
=
getPathMapping
();
useEffect
(()
=>
{
// Start loading when the route changes
setIsLoading
(
true
);
const
timer
=
setTimeout
(()
=>
{
// Simulate content loading delay or wait for content to load here
setIsLoading
(
false
);
},
3000
);
// Adjust or replace with actual content loading logic
return
()
=>
clearTimeout
(
timer
);
},
[
location
.
pathname
]);
return
(
<>
{
isLoading
&&
<
LoadingScreen
/>
}
<
Routes
>
{
Object
.
entries
(
pathMapping
).
map
(([
path
,
{
header
:
Header
,
component
:
Component
,
navlist
:
Sidebar
}])
=>
(
<
Route
key
=
{
path
}
path
=
{
path
}
element
=
{
<>
<
Header
/>
<
div
className
=
"container-fluid"
onLoad
=
{
()
=>
setIsLoading
(
false
)
}
>
<
div
className
=
"row"
>
<
Sidebar
/>
<
div
className
=
"col"
>
<
Component
/>
<
Villbuttonrow
/>
</
div
>
</
div
>
</
div
>
</>
}
/>
))
}
<
Route
path
=
"*"
element
=
{
<
NotFound
/>
}
/>
</
Routes
>
</>
);
};
export
default
RouteManager
;
\ No newline at end of file
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