-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat 177] : router and skeleton for ExercisePage & HomePage (#33)
* generate structure skeleton for ExercisePage and HomePage * isolating route logic
- Loading branch information
Showing
38 changed files
with
289 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,22 @@ | ||
import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client"; | ||
import { StrictMode } from "react"; | ||
import { createRoot } from "react-dom/client"; | ||
import { RouterProvider, createBrowserRouter } from "react-router-dom"; | ||
import { RouterProvider } from "react-router-dom"; | ||
import "./i18n"; | ||
|
||
import App from "./App.tsx"; | ||
import SignUp from "./pages/SignUp"; | ||
import router from "./routes"; | ||
|
||
import "./index.css"; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <App />, | ||
}, | ||
{ | ||
path: "/sign-up", | ||
element: <SignUp />, | ||
}, | ||
]); | ||
|
||
const client = new ApolloClient({ | ||
uri: "http://localhost:4000", | ||
cache: new InMemoryCache(), | ||
uri: "http://localhost:4000", | ||
cache: new InMemoryCache(), | ||
}); | ||
|
||
// biome-ignore lint/style/noNonNullAssertion: <explanation> | ||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
<ApolloProvider client={client}> | ||
<RouterProvider router={router} /> | ||
</ApolloProvider> | ||
</StrictMode> | ||
<StrictMode> | ||
<ApolloProvider client={client}> | ||
<RouterProvider router={router} /> | ||
</ApolloProvider> | ||
</StrictMode>, | ||
); |
Empty file.
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions
12
frontend/src/pages/HomePage/Views/HomePageView/Views/DashBoardHeaderView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import "./DashBoardHeaderView.scss"; | ||
|
||
// Existe seulement en phone | ||
const DashBoardHeaderView = () => { | ||
return ( | ||
<div> | ||
<p>DashBoardHeaderView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DashBoardHeaderView; |
Empty file.
11 changes: 11 additions & 0 deletions
11
frontend/src/pages/HomePage/Views/HomePageView/Views/ProgramListView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "./ProgramListView.scss"; | ||
|
||
const ProgramListView = () => { | ||
return ( | ||
<div> | ||
<p>ProgramListView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProgramListView; |
2 changes: 2 additions & 0 deletions
2
frontend/src/pages/HomePage/Views/HomePageView/Views/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as DashBoardHeaderView } from "./DashBoardHeaderView"; | ||
export { default as ProgramListView } from "./ProgramListView"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { DashBoardHeaderView, ProgramListView } from "./Views"; | ||
import "./HomePageView.scss"; | ||
|
||
const HomePageView = () => { | ||
return ( | ||
<div> | ||
<DashBoardHeaderView /> | ||
<ProgramListView /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HomePageView; |
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions
11
frontend/src/pages/HomePage/Views/UserProfileView/Views/DashBoardView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "./DashBoardView.scss"; | ||
|
||
const DashBoardView = () => { | ||
return ( | ||
<div> | ||
<p>DashBoardView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DashBoardView; |
Empty file.
11 changes: 11 additions & 0 deletions
11
frontend/src/pages/HomePage/Views/UserProfileView/Views/HistoryView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "./HistoryView.scss"; | ||
|
||
const HistoryView = () => { | ||
return ( | ||
<div> | ||
<p>HistoryView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HistoryView; |
2 changes: 2 additions & 0 deletions
2
frontend/src/pages/HomePage/Views/UserProfileView/Views/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as DashBoardView } from "./DashBoardView"; | ||
export { default as HistoryView } from "./HistoryView"; |
13 changes: 13 additions & 0 deletions
13
frontend/src/pages/HomePage/Views/UserProfileView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { DashBoardView, HistoryView } from "./Views"; | ||
import "./UserProfileView.scss"; | ||
|
||
const UserProfileView = () => { | ||
return ( | ||
<div> | ||
<DashBoardView /> | ||
<HistoryView /> {/* apparait onClick et remplace DashBoardView */} | ||
</div> | ||
); | ||
}; | ||
|
||
export default UserProfileView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as HomePageView } from "./HomePageView"; | ||
export { default as UserProfileView } from "./UserProfileView"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { HomePageView, UserProfileView } from "./Views"; | ||
import "./HomePage.scss"; | ||
const HomePage = () => { | ||
return ( | ||
<> | ||
{/*if screen size = phone */} | ||
<section> | ||
<HomePageView />{" "} | ||
{/* même URL mais on fait toggle entre les 2 vues HomePageView et UserProfilView */} | ||
<UserProfileView /> | ||
</section> | ||
|
||
{/*if screen size = desktop */} | ||
<section> | ||
<UserProfileView />{" "} | ||
{/* colonne de gauche avec le dashboard de l'utilisateur toujours visible */} | ||
</section> | ||
<section> | ||
<HomePageView /> {/* colonne de droite avec la liste des programmes*/} | ||
</section> | ||
</> | ||
); | ||
}; | ||
|
||
export default HomePage; |
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions
11
frontend/src/pages/ProgramPage/Views/CurrentExerciseView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "./CurrentExerciceView.scss"; | ||
|
||
const CurrentExerciceView = () => { | ||
return ( | ||
<div> | ||
<p>CurrentExerciceView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CurrentExerciceView; |
Empty file.
13 changes: 13 additions & 0 deletions
13
...es/ProgramPage/Views/ExerciseListView/ExerciseListDesktopView/ExerciseListDesktopView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import "./ExerciseListDesktopView.scss"; | ||
|
||
const ExerciseListDesktopView = () => { | ||
return ( | ||
<> | ||
<div> | ||
<p>ExerciseListDesktopView</p> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default ExerciseListDesktopView; |
Empty file.
13 changes: 13 additions & 0 deletions
13
...ages/ProgramPage/Views/ExerciseListView/ExerciseListMobileView/ExerciseListMobileView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import "./ExerciseListMobileView.scss"; | ||
|
||
const ExerciseListMobileView = () => { | ||
return ( | ||
<> | ||
<div> | ||
<p>ExerciseListMobileView</p> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default ExerciseListMobileView; |
Empty file.
20 changes: 20 additions & 0 deletions
20
frontend/src/pages/ProgramPage/Views/ExerciseListView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import ExerciseListDesktopView from "./ExerciseListDesktopView/ExerciseListDesktopView"; | ||
import ExerciseListMobileView from "./ExerciseListMobileView/ExerciseListMobileView"; | ||
import "./ExerciseListView.scss"; | ||
|
||
const ExerciseListView = () => { | ||
return ( | ||
<> | ||
{/* if phone size */} | ||
<div> | ||
<ExerciseListMobileView /> | ||
</div> | ||
{/* if desktop size */} | ||
<div> | ||
<ExerciseListDesktopView /> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default ExerciseListView; |
Empty file.
11 changes: 11 additions & 0 deletions
11
frontend/src/pages/ProgramPage/Views/ExitProgramView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "./ExitProgramView.scss"; | ||
|
||
const ExitProgramView = () => { | ||
return ( | ||
<div> | ||
<p>ExitProgramView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ExitProgramView; |
Empty file.
11 changes: 11 additions & 0 deletions
11
frontend/src/pages/ProgramPage/Views/FinishedProgramView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "./FinishedProgramView.scss"; | ||
|
||
const FinishedProgramView = () => { | ||
return ( | ||
<div> | ||
<p>ExitProgramView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FinishedProgramView; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "./RestView.scss"; | ||
const RestView = () => { | ||
return ( | ||
<div> | ||
<p>RestView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default RestView; |
Empty file.
12 changes: 12 additions & 0 deletions
12
frontend/src/pages/ProgramPage/Views/StartProgramView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import "./StartProgramView.scss"; | ||
|
||
//EXISTE UNIQUEMENT EN VERSION DESKTOP (C'EST L'IMAGE AU CENTRE DU FRAME 'Exercice List - Desktop' + texte 'Démarre ta séance' + bouton 'Démarrer' SUR FIGMA) | ||
const StartProgramView = () => { | ||
return ( | ||
<div> | ||
<p>StartProgramView</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StartProgramView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { default as CurrentExerciceView } from "./CurrentExerciseView"; | ||
export { default as ExerciseListView } from "./ExerciseListView"; | ||
export { default as ExitProgramView } from "./ExitProgramView"; | ||
export { default as FinishedProgramView } from "./FinishedProgramView"; | ||
export { default as RestView } from "./RestView"; | ||
export { default as StartProgramView } from "./StartProgramView"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { | ||
CurrentExerciceView, | ||
ExerciseListView, | ||
ExitProgramView, | ||
FinishedProgramView, | ||
RestView, | ||
StartProgramView, | ||
} from "./Views"; | ||
import "./ProgramPage.scss"; | ||
const ProgramPage = () => { | ||
return ( | ||
<> | ||
{/*if screen size = phone */} | ||
<section> | ||
<ExerciseListView />{" "} | ||
{/* on fait défiler une à une les vues avec un state*/} | ||
<CurrentExerciceView /> | ||
<RestView /> | ||
<ExitProgramView /> | ||
<FinishedProgramView /> | ||
</section> | ||
|
||
{/*if screen size = desktop */} | ||
<section> | ||
<ExerciseListView />{" "} | ||
{/* colonne de gauche de l'écran avec liste des exos reste visible tout le temps pendant le process*/} | ||
</section> | ||
<section> | ||
<StartProgramView /> | ||
<CurrentExerciceView />{" "} | ||
{/* colonne de droite de l'écran qui fait défiler les vues avec un state*/} | ||
<RestView /> | ||
<ExitProgramView /> | ||
<FinishedProgramView /> | ||
</section> | ||
</> | ||
); | ||
}; | ||
|
||
export default ProgramPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { createBrowserRouter } from "react-router-dom"; | ||
import App from "./App"; | ||
import HomePage from "./pages/HomePage"; | ||
import ProgramPage from "./pages/ProgramPage"; | ||
import SignUp from "./pages/SignUp"; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <App />, | ||
}, | ||
{ | ||
path: "/sign-up", | ||
element: <SignUp />, | ||
}, | ||
{ | ||
path: "/program/:id", | ||
element: <ProgramPage />, | ||
}, | ||
{ | ||
path: "/home", | ||
element: <HomePage />, | ||
}, | ||
// Page 404 à faire | ||
{ | ||
path: "*", | ||
element: <div>404 - Page Not Found</div>, | ||
}, | ||
]); | ||
|
||
export default router; |