Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/linea-it/tno into separated…
Browse files Browse the repository at this point in the history
…_frontend
  • Loading branch information
glaubervila committed Feb 15, 2024
2 parents e81f0ce + 35f7b8a commit bd8cea2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 327 deletions.
1 change: 0 additions & 1 deletion frontend/src/DashboardApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react'
import { ThemeProvider } from '@mui/styles';
import { BrowserRouter } from 'react-router-dom'
import light from './themes/light'
// import AppRoutes from './routes'
import history from './services/history'
import { AuthProvider } from './contexts/AuthContext.js'
import { QueryClient, QueryClientProvider } from 'react-query'
Expand Down
1 change: 0 additions & 1 deletion frontend/src/PublicApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function PublicApp() {
<AuthProvider>
<PredictionEventsProvider>
<BrowserRouter history={history}>
{/* <AppRoutes /> */}
<PublicRoutes />
</BrowserRouter>
</PredictionEventsProvider>
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/pages/PredictionEvents/Detail.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import moment from 'moment';
import { useParams } from 'react-router-dom'
import Grid from '@mui/material/Grid'
import Card from '@mui/material/Card'
import CardHeader from '@mui/material/CardHeader'
import Grid from '@mui/material/Grid';
import Card from '@mui/material/Card';
import CardHeader from '@mui/material/CardHeader';
import CardContent from '@mui/material/CardContent'
import Box from '@mui/material/Box';
import List from '../../components/List';
Expand Down Expand Up @@ -253,7 +253,7 @@ function PredictionEventDetail() {
<>
<Grid container spacing={2}>
<Grid item xs={12} md={6}>
<Card>
<Card sx={{ height: '100%' }}>
<CardHeader title="Occultation Prediction Circumstances" />
<CardContent>
<List data={circumstances} />
Expand All @@ -268,15 +268,15 @@ function PredictionEventDetail() {
</Grid>
)}
<Grid item xs={12} md={6}>
<Card>
<Card sx={{ height: '100%' }}>
<CardHeader title="Occulted Star" />
<CardContent>
<List data={star} />
</CardContent>
</Card>
</Grid>
<Grid item xs={12} md={6}>
<Card>
<Card sx={{ height: '100%' }}>
<CardHeader title="Object" />
<CardContent>
<List data={object} />
Expand Down
319 changes: 0 additions & 319 deletions frontend/src/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,329 +1,10 @@
import React from 'react'
import { Routes, Route, Navigate } from 'react-router-dom'

import Dashboard from '../pages/Dashboard'
// import Skybot from '../pages/Skybot'
// import SkybotDetail from '../pages/Skybot/Detail'
// import SkybotAsteroid from '../pages/Skybot/Asteroid'
// import SkybotStatistics from '../pages/Skybot/Statistics'
// import OrbitTrace from '../pages/OrbitTrace/'
// import DesManagement from '../pages/DesManagement'

import PredictOccultation from '../pages/PredictOccultation'
import PredictDetail from '../pages/PredictOccultation/Detail'
import PredictionAsteroid from '../pages/PredictOccultation/Asteroid'


import Home from '../pages/LandingPage/Home'
import { useAuth } from '../contexts/AuthContext.js'
import Header from '../components/LandingPage/Header'
import Footer from '../components/LandingPage/Footer'
import PersistentDrawerLeft from '../components/Drawer'
// import OrbitTraceDetail from '../pages/OrbitTrace/Detail'
// import OrbitTraceAsteroid from '../pages/OrbitTrace/Asteroid'
import PublicHeader from '../pages/PublicPortal/Header/index'
import PublicHome from '../pages/PublicPortal/Home'
import PublicAboutUs from '../pages/PublicPortal/AboutUs/index'
import PublicDocumentation from '../pages/PublicPortal/documentation/index'
import PublicContact from '../pages/PublicPortal/Contact/index'
import FooterSupporters from '../pages/PublicPortal/Footer/FooterSupporters'

import PredictionEvents from '../pages/PredictionEvents/index'
import PredictionEventDetail from '../pages/PredictionEvents/Detail'

import AsteroidJob from '../pages/AsteroidJob/index'
import AsteroidJobDetail from '../pages/AsteroidJob/AsteroidJobDetail'

import { PublicPageRoutes } from './public_page'
import { DashboardPageRoutes } from './dashboard'

export default function AppRoutes() {
const { isAuthenticated, signIn } = useAuth()

// const PrivateRoute = ({ auth: { isAuthenticated }, children }) => {
// return isAuthenticated ? children : signIn()
// }

// const LandingPage = ({ children }) => {
// return (
// <>
// <Header />
// {children}
// <Footer />
// </>
// )
// }

// const PublicPortalPage = ({ children }) => {
// return (
// <>
// <PublicHeader />
// {children}
// <FooterSupporters />
// </>
// )
// }



// const PublicPageRoutes = () => {
// return (
// <>
// {/* Public Portal Layout*/}
// <Route
// isHomePage
// exact
// path='/'
// element={
// <PublicPortalPage>
// <PublicHome />
// </PublicPortalPage>
// }
// />
// <Route
// exact
// path='/prediction-event-detail/:id'
// element={
// <PublicPortalPage>
// <PredictionEventDetail />
// </PublicPortalPage>
// }
// />

// <Route
// isHomePage
// exact
// path='/about-us'
// element={
// <PublicPortalPage>
// <PublicAboutUs />
// </PublicPortalPage>
// }
// />
// <Route
// isHomePage
// exact
// path='/contact-us'
// element={
// <PublicPortalPage>
// <PublicContact />
// </PublicPortalPage>
// }
// />
// <Route
// isHomePage
// exact
// path='/documentation'
// element={
// <PublicPortalPage>
// <PublicDocumentation />
// </PublicPortalPage>
// }
// />
// {/* Landing Page Layout*/}
// <Route
// isHomePage
// exact
// path='/'
// element={
// <PublicPortalPage>
// <PublicHome />
// </PublicPortalPage>
// }
// />
// <Route
// isHomePage
// exact
// path='/dashboard'
// element={
// <LandingPage>
// <Home />
// </LandingPage>
// }
// />
// </>
// )
// }

// const DashboardPage = ({ children }) => {
// return (
// <>
// <PrivateRoute auth={{ isAuthenticated }}>
// <PersistentDrawerLeft>{children}</PersistentDrawerLeft>
// </PrivateRoute>
// </>
// )
// }

// const DashboardPageRoutes = () => {
// return (
// <>
// {/* Dashboard Layout*/}
// <Route
// isHomePage
// isPrivate
// exact
// path='/dashboard/stats'
// element={
// <DashboardPage>
// <Dashboard />
// </DashboardPage>
// }
// />
// {/* <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/discovery'
// element={
// <DashboardPage>
// <Skybot />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/discovery/:id'
// element={
// <DashboardPage>
// <SkybotDetail />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/statistics'
// element={
// <DashboardPage>
// <SkybotStatistics />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/orbittrace-detail/:id'
// element={
// <DashboardPage>
// <OrbitTraceDetail />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/discovery/asteroid/:id'
// element={
// <DashboardPage>
// <SkybotAsteroid />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/orbittrace/asteroid/:id'
// element={
// <DashboardPage>
// <OrbitTraceAsteroid />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/orbittrace'
// element={
// <DashboardPage>
// <OrbitTrace />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/management'
// element={
// <DashboardPage>
// <DesManagement />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/des/management'
// element={
// <DashboardPage>
// <DesManagement />
// </DashboardPage>
// }
// /> */}
// <Route
// isPrivate
// exact
// path='/dashboard/prediction-of-occultation'
// element={
// <DashboardPage>
// <PredictOccultation />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/predict-detail/:id'
// element={
// <DashboardPage>
// <PredictDetail />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/data-preparation/predict-asteroid/:id'
// element={
// <DashboardPage>
// <PredictionAsteroid />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/occultation'
// element={
// <DashboardPage>
// <PredictionEvents />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/asteroid_job'
// element={
// <DashboardPage>
// <AsteroidJob />
// </DashboardPage>
// }
// />
// <Route
// isPrivate
// exact
// path='/dashboard/asteroid_job/:id'
// element={
// <DashboardPage>
// <AsteroidJobDetail />
// </DashboardPage>
// }
// />
// </>
// )
// }

return (
<Routes>
{PublicPageRoutes()}
Expand Down

0 comments on commit bd8cea2

Please sign in to comment.