Skip to content

Commit

Permalink
Rota para grade
Browse files Browse the repository at this point in the history
  • Loading branch information
gustaallves committed Dec 6, 2023
1 parent 80b359f commit 7f3b00d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frontend/src/pages/Materias.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import ReactDOM from 'react-dom';
import turmasData from '../data/turmas-professores.json';
import Navbar from '../components/Navbar.js';
import '../styleheets/Materias.css'; // Certifique-se de que o caminho do arquivo CSS está correto
import { useNavigate } from 'react-router-dom';
import { BrowserRouter } from 'react-router-dom'; // Importe o BrowserRouter

import { Grid } from '@mui/material';

function extrairParteDoHorario(horarioBanco) {
Expand Down Expand Up @@ -66,6 +69,7 @@ function Materias() {
const [horarioConflitante, setHorarioConflitante] = useState(false);
const [isSubmitting, setIsSubmitting] = useState(false);
const [error, setError] = useState(null);
const navigate = useNavigate();
const [isLoaded, setIsLoaded] = useState(false);
const [items, setItems] = useState([]);
const [q, setQ] = useState('');
Expand Down Expand Up @@ -172,6 +176,7 @@ function Materias() {
console.log('Success:', data);
// Limpar as matérias temporariamente selecionadas após o sucesso
setTempSelectedMaterias([]);
navigate('/Grade');
})
.catch((error) => {
console.error('Error:', error);
Expand Down Expand Up @@ -346,6 +351,11 @@ function Materias() {
}
}

ReactDOM.render(<Materias />, document.getElementById('root'));
ReactDOM.render(
<BrowserRouter>
<Materias />
</BrowserRouter>,
document.getElementById('root')
);

export default Materias;

0 comments on commit 7f3b00d

Please sign in to comment.