From ce20d3d542e2fb20ce249100be4f03ded808c493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Frnka?= Date: Sat, 13 Apr 2024 10:19:51 +0200 Subject: [PATCH] SMA-36: frontend updates --- frontend/sportsmatch-app/src/App.tsx | 2 - .../src/components/HostEventComponent.tsx | 2 +- .../sportsmatch-app/src/pages/UserPage.tsx | 104 ------------------ 3 files changed, 1 insertion(+), 107 deletions(-) delete mode 100644 frontend/sportsmatch-app/src/pages/UserPage.tsx diff --git a/frontend/sportsmatch-app/src/App.tsx b/frontend/sportsmatch-app/src/App.tsx index a73ac628..153a1ab8 100644 --- a/frontend/sportsmatch-app/src/App.tsx +++ b/frontend/sportsmatch-app/src/App.tsx @@ -5,7 +5,6 @@ import Login from './pages/Login' import Signup from './pages/Signup' import Wrapper from './pages/AppWrapper' import { AllSportsList } from './pages/AllSportsList' -import UserPage from './pages/UserPage' import Index from './pages/Index' import PrivateRoute from './components/PrivateRoute' import NotFound from './pages/NotFound' @@ -43,7 +42,6 @@ function App() { path="/user/:id/ratings" element={} />} /> - }> } />} /> { navigate('/app') diff --git a/frontend/sportsmatch-app/src/pages/UserPage.tsx b/frontend/sportsmatch-app/src/pages/UserPage.tsx deleted file mode 100644 index a2c4db2d..00000000 --- a/frontend/sportsmatch-app/src/pages/UserPage.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import '../styles/UserPage.css' -import Match from '../components/Match' -import EventHistoryItem from '../components/EventHistoryItem' -import SportEvent from '../components/SportEvent' -import { Link } from 'react-router-dom' - -export default function UserPage() { - const sampleUserWithEvent = { - id: 1, - username: `johndoe87`, - event: { - id: 1, - maxElo: 2000, - minElo: 1200, - dateEnd: '2024-05-02', - dateStart: '2024-05-01', - location: 'Prague, Stadium A', - title: 'Badminton match', - sport: 'Badminton', - playerOne: 'johndoe87', - playerTwo: 'jess_ward', - }, - } - - const sampleAllEventsDTO = [ - { - id: 1, - name: 'Event 1', - date: '2024-02-10', - location: 'Location 1', - userScore: 1, - opponentScore: 2, - }, - { - id: 2, - name: 'Event 1', - date: '2024-02-10', - location: 'Location 1', - userScore: 1, - opponentScore: 2, - }, - { - id: 3, - name: 'Event 1', - date: '2024-02-10', - location: 'Location 1', - userScore: 1, - opponentScore: 2, - }, - ] - - const { event } = sampleUserWithEvent - - return ( - <> -
-
- {event === null ?
: <>} -
- {event === null ? ( -
-
-

No upcoming match

- Find or Host a Match -
-
- ) : ( - - )} -
-
- {event === null ?
: <>} -
-
-

History

-
-
- View all -
-
-
-
-
-
- {sampleAllEventsDTO === null ? ( -

No match history

- ) : ( - sampleAllEventsDTO.map((e) => ( - - )) - )} -
-
-
-
-

Nearby

-
- - -
-
- - ) -}