diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 02c0a3db..79f47959 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -11,14 +11,14 @@ RUN yarn -v RUN yarn --non-interactive --ignore-optional --network-timeout 500000 # RUN yarn run build -FROM builder as builder_public -RUN yarn run build_public +# FROM builder as builder_public +# RUN yarn run build_public -FROM builder as builder_dashboard -RUN yarn run build_dashboard +# FROM builder as builder_dashboard +# RUN yarn run build_dashboard -# FROM builder as builder_all -# RUN yarn run build +FROM builder as builder_all +RUN yarn run build # Ngnix FROM nginx:latest @@ -30,11 +30,11 @@ RUN chmod -R g+w /var/cache/nginx/ # Write the PID file to a location where regular users have write access. RUN sed --regexp-extended --in-place=.bak 's%^pid\s+/var/run/nginx.pid;%pid /var/tmp/nginx.pid;%' /etc/nginx/nginx.conf -COPY --from=builder_public /build/public_page /var/www/html -COPY --from=builder_dashboard /build/dashboard /var/www/html/dashboard -# COPY --from=builder_all /app/build /var/www/frontend +# COPY --from=builder_public --chmod=775 /build/public_page /var/www/html/home +# COPY --from=builder_dashboard --chmod=775 /build/dashboard /var/www/html/dashboard +COPY --from=builder_all /app/build /var/www/frontend -RUN chgrp nginx /var/www -RUN chmod -R g+w /var/www +RUN chgrp nginx /var/www/frontend +RUN chmod -R g+w /var/www/frontend # ADD ./nginx/production.conf /etc/nginx/conf.d/default.conf USER nginx diff --git a/frontend/src/components/GeoFilter/index.js b/frontend/src/components/GeoFilter/index.js index 9385e58a..bcf498b3 100644 --- a/frontend/src/components/GeoFilter/index.js +++ b/frontend/src/components/GeoFilter/index.js @@ -1,7 +1,6 @@ import PropTypes from 'prop-types'; import TextField from '@mui/material/TextField'; -import Stack from '@mui/material/Stack'; import FormControlLabel from '@mui/material/FormControlLabel'; import Switch from '@mui/material/Switch'; import { useEffect, useState } from 'react'; @@ -11,7 +10,6 @@ import Select from '@mui/material/Select'; import MenuItem from '@mui/material/MenuItem'; import { geoFilterIsValid } from '../../services/api/Occultation'; import Grid from '@mui/material/Grid' -import Typography from '@mui/material/Typography'; import Alert from '@mui/material/Alert'; function GeoFilter({ value, onChange }) { diff --git a/frontend/src/components/PredictionEventsDataGrid/CardEvent.js b/frontend/src/components/PredictionEventsDataGrid/CardEvent.js index a1e004fa..e1c9672d 100644 --- a/frontend/src/components/PredictionEventsDataGrid/CardEvent.js +++ b/frontend/src/components/PredictionEventsDataGrid/CardEvent.js @@ -44,7 +44,7 @@ function PredictEventCard({ data }) { } const handleShare = () => { - const url = getDetailUrl(); + // const url = getDetailUrl(); // TODO: Copiar a url para area de transferencia e avisar. } const getDetailUrl = () => { diff --git a/frontend/src/components/PredictionEventsDataGrid/Toolbar.js b/frontend/src/components/PredictionEventsDataGrid/Toolbar.js index db5d66f5..e127d14d 100644 --- a/frontend/src/components/PredictionEventsDataGrid/Toolbar.js +++ b/frontend/src/components/PredictionEventsDataGrid/Toolbar.js @@ -7,15 +7,12 @@ import SearchAsteroid from '../SearchAsteroid' import ViewListIcon from '@mui/icons-material/ViewList'; import ViewModuleIcon from '@mui/icons-material/ViewModule'; import { PredictionEventsContext } from '../../contexts/PredictionContext'; -import useBreakpoint from '../../hooks/useBreakpoint'; -function PredictEventToolbar({ }) { +function PredictEventToolbar() { const { viewLayoyt, setViewLayoyt, isMobile } = useContext(PredictionEventsContext) - // const currentBreakpoint = useBreakpoint() - // const isMobile = ['xs', 'sm', 'md', 'lg'].indexOf(currentBreakpoint.getBreakPointName()) !== -1 ? true : false - // console.log("isMobile: %o", isMobile) + const handleChangeLayout = (e, value) => { if (value !== null) { setViewLayoyt(value) diff --git a/frontend/src/pages/PublicPortal/Header/index.js b/frontend/src/pages/PublicPortal/Header/index.js index d2507dc7..1d060d99 100644 --- a/frontend/src/pages/PublicPortal/Header/index.js +++ b/frontend/src/pages/PublicPortal/Header/index.js @@ -1,9 +1,11 @@ import React from 'react' -import { AppBar, Toolbar, IconButton, Button, Box } from '@mui/material' -import { Brightness4, Brightness7 } from '@mui/icons-material' import { useNavigate } from 'react-router-dom' +import AppBar from '@mui/material/AppBar' +import Toolbar from '@mui/material/Toolbar' +import Button from '@mui/material/Button' +import Box from '@mui/material/Box' -const PublicHeader = ({ darkMode, toggleTheme }) => { +const PublicHeader = () => { const navigate = useNavigate() const menus = [ @@ -13,10 +15,6 @@ const PublicHeader = ({ darkMode, toggleTheme }) => { { description: 'Contact', href: '/contact-us', target: '_self' }, ] - const handleToggleDarkMode = () => { - toggleTheme() - } - const handleCardClick = (pathname) => navigate(pathname) return ( diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js index a7aa7b87..31c43c5d 100644 --- a/frontend/src/routes/index.js +++ b/frontend/src/routes/index.js @@ -3,10 +3,10 @@ import { Routes, Route, Navigate } from 'react-router-dom' import { PublicPageRoutes } from './public_page' import { DashboardPageRoutes } from './dashboard' -export default function AppRoutes({ toggleTheme, darkMode }) { +export default function AppRoutes() { return ( - {PublicPageRoutes({ toggleTheme, darkMode })} + {PublicPageRoutes()} {DashboardPageRoutes()} } /> diff --git a/frontend/src/routes/public_page.js b/frontend/src/routes/public_page.js index ca5c8400..3dd86dc3 100644 --- a/frontend/src/routes/public_page.js +++ b/frontend/src/routes/public_page.js @@ -9,10 +9,11 @@ import FooterSupporters from '../pages/PublicPortal/Footer/FooterSupporters' import PredictionEventDetail from '../pages/PredictionEvents/Detail' import Container from '@mui/material/Container' -const PublicPortalPage = ({ children, toggleTheme, darkMode }) => { + +const PublicPortalPage = ({ children}) => { return ( <> - + {children} @@ -21,7 +22,8 @@ const PublicPortalPage = ({ children, toggleTheme, darkMode }) => { ) } -export function PublicPageRoutes({ toggleTheme, darkMode }) { + +export function PublicPageRoutes() { return ( <> {/* Public Portal Layout*/} @@ -30,7 +32,7 @@ export function PublicPageRoutes({ toggleTheme, darkMode }) { exact path='/' element={ - + } @@ -39,7 +41,7 @@ export function PublicPageRoutes({ toggleTheme, darkMode }) { exact path='/prediction-event-detail/:id' element={ - + } @@ -50,7 +52,7 @@ export function PublicPageRoutes({ toggleTheme, darkMode }) { exact path='/about-us' element={ - + } @@ -60,7 +62,7 @@ export function PublicPageRoutes({ toggleTheme, darkMode }) { exact path='/contact-us' element={ - + } @@ -70,30 +72,19 @@ export function PublicPageRoutes({ toggleTheme, darkMode }) { exact path='/documentation' element={ - + } /> - {/* Landing Page Layout*/} - - - - } - /> ) } -export default function PublicRoutes({ toggleTheme, darkMode }) { +export default function PublicRoutes() { return ( - + } /> )