correct popUpMessenge in MyEntries

This commit is contained in:
Mateusz Tylka 2023-06-30 14:05:14 +02:00
parent 3610415657
commit d645964266
4 changed files with 52 additions and 13 deletions

View File

@ -18,7 +18,6 @@ const App = () => {
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<BrowserRouter> <BrowserRouter>
<PopUpMessageManager> <PopUpMessageManager>
<NavigationManager> <NavigationManager>
<RoutingManager /> <RoutingManager />
</NavigationManager> </NavigationManager>

View File

@ -16,15 +16,30 @@ const RoutingManager = (props) => {
<Routes> <Routes>
<Route <Route
path={`${CHALLENGE_PAGE}/:challengeId`} path={`${CHALLENGE_PAGE}/:challengeId`}
element={<Challenge section={CHALLENGE_SECTIONS.LEADERBOARD} />} element={
<Challenge
section={CHALLENGE_SECTIONS.LEADERBOARD}
popUpMessageHandler={props.popUpMessageHandler}
/>
}
/> />
<Route <Route
path={`${CHALLENGE_PAGE}/:challengeId/leaderboard`} path={`${CHALLENGE_PAGE}/:challengeId/leaderboard`}
element={<Challenge section={CHALLENGE_SECTIONS.LEADERBOARD} />} element={
<Challenge
section={CHALLENGE_SECTIONS.LEADERBOARD}
popUpMessageHandler={props.popUpMessageHandler}
/>
}
/> />
<Route <Route
path={`${CHALLENGE_PAGE}/:challengeId/allentries`} path={`${CHALLENGE_PAGE}/:challengeId/allentries`}
element={<Challenge section={CHALLENGE_SECTIONS.ALL_ENTRIES} popUpMessageHandler={props.popUpMessageHandler} />} element={
<Challenge
section={CHALLENGE_SECTIONS.ALL_ENTRIES}
popUpMessageHandler={props.popUpMessageHandler}
/>
}
/> />
<Route <Route
path={`${CHALLENGE_PAGE}/:challengeId/readme`} path={`${CHALLENGE_PAGE}/:challengeId/readme`}
@ -41,13 +56,26 @@ const RoutingManager = (props) => {
/> />
<Route <Route
path={`${CHALLENGE_PAGE}/:challengeId/myentries`} path={`${CHALLENGE_PAGE}/:challengeId/myentries`}
element={<Challenge section={CHALLENGE_SECTIONS.MY_ENTRIES} popUpMessageHandler={props.popUpMessageHandler} />} element={
<Challenge
section={CHALLENGE_SECTIONS.MY_ENTRIES}
popUpMessageHandler={props.popUpMessageHandler}
/>
}
/> />
<Route <Route
path={`${CHALLENGE_PAGE}/:challengeId/submit`} path={`${CHALLENGE_PAGE}/:challengeId/submit`}
element={<Challenge section={CHALLENGE_SECTIONS.SUBMIT} />} element={
<Challenge
section={CHALLENGE_SECTIONS.SUBMIT}
popUpMessageHandler={props.popUpMessageHandler}
/>
}
/>
<Route
path={CHALLENGES_PAGE}
element={<Challenges popUpMessageHandler={props.popUpMessageHandler} />}
/> />
<Route path={CHALLENGES_PAGE} element={<Challenges popUpMessageHandler={props.popUpMessageHandler} />} />
<Route <Route
path={POLICY_PRIVACY_PAGE} path={POLICY_PRIVACY_PAGE}
element={ element={
@ -74,8 +102,18 @@ const RoutingManager = (props) => {
/> />
{KeyCloakService.isLoggedIn() ? ( {KeyCloakService.isLoggedIn() ? (
<> <>
<Route exact path="/" element={<Challenges popUpMessageHandler={props.popUpMessageHandler} />} /> <Route
<Route element={<Challenges popUpMessageHandler={props.popUpMessageHandler} />} /> exact
path="/"
element={
<Challenges popUpMessageHandler={props.popUpMessageHandler} />
}
/>
<Route
element={
<Challenges popUpMessageHandler={props.popUpMessageHandler} />
}
/>
</> </>
) : ( ) : (
<> <>

View File

@ -2,6 +2,7 @@ import styled from 'styled-components';
const TableStyle = styled.table` const TableStyle = styled.table`
border-collapse: separate; border-collapse: separate;
border-spacing: 12px 0;
width: 100%; width: 100%;
.TableStyle__th { .TableStyle__th {

View File

@ -112,6 +112,7 @@ const MyEntries = (props) => {
items={elements} items={elements}
orderedKeys={orderKeys(myEntries[0])} orderedKeys={orderKeys(myEntries[0])}
sortByUpdate={sortByUpdate} sortByUpdate={sortByUpdate}
popUpMessageHandler={props.popUpMessageHandler}
/> />
</div> </div>
)} )}