Skip to content

Commit

Permalink
🐎 (#187) Corrigindo redirecionamento
Browse files Browse the repository at this point in the history
  • Loading branch information
lipeaaraujo committed Dec 10, 2023
1 parent a5b0961 commit f96f695
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function App() {
<Route path="/cadastroimpressora" element={<RegisterPrinter />} />
<Route path="/editarimpressora" element={<EditPrinter />} />
<Route path="/padraoimpressora" element={<PatternPrinter />} />
<Route path="/editarpadrao" element={<EditPattern />} />
<Route path="/editarpadrao/:padrao" element={<EditPattern />} />
<Route path="/impressorascadastradas" element={<PrintersList />} />
<Route path="/padroescadastrados" element={<PatternList />} />
</Route>
Expand Down
2 changes: 1 addition & 1 deletion src/components/navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Navbar = () => {
<Link to="/cadastroimpressora">Cadastro de impressora</Link>
<Link to="/padraoimpressora">Cadastro de padrão de impressora</Link>
<Link to="/impressorascadastradas">Impressoras cadastradas</Link>
<Link to="/listapadroes">Padrões de impressora cadastrados</Link>
<Link to="/padroescadastrados">Padrões de impressora cadastrados</Link>
</div>
)}
</button>
Expand Down
14 changes: 3 additions & 11 deletions src/pages/PatternList.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,8 @@ export default function PatternList() {
{filteredPatterns.map(pattern => (
<div key={pattern.id_padrao} className="patternlist-pattern" style={{ color: pattern.status === "ATIVO" ? '' : 'gray' }}>
<div className="patternlist-model">
<h4
onKeyDown={(e) => {
if (e.key === 'enter') {
redirectToView(pattern);
}
}}
tabIndex={0}
onClick={() => redirectToView(pattern)}
>
Padrão {pattern.marca} - {pattern.modelo} - {pattern.tipo}
<h4>
<Link to={`/visualizarpadrao/${btoa(JSON.stringify(pattern))}`}>Padrão {pattern.marca} - {pattern.modelo} - {pattern.tipo}</Link>
</h4>
{pattern.status === 'DESATIVADO' && <h5>Desativado</h5>}
</div>
Expand All @@ -182,7 +174,7 @@ export default function PatternList() {
? <Link to="#" tabIndex="0" onClick={() => modalDeactivatePattern(pattern)}>Desativar</Link>
: <Link to="#" tabIndex="0" onClick={() => modalActivePattern(pattern)}>Ativar</Link>
}
<Link to="#" tabIndex="0">Editar</Link>
<Link to={`/editarpadrao/${btoa(JSON.stringify(pattern))}`} tabIndex="0">Editar</Link>
</div>
</div>
</div>
Expand Down
13 changes: 12 additions & 1 deletion src/style/pages/patternList.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@
width: 60vw;
margin: 0;
padding-left: lrem;
cursor: pointer;
}

.patternlist-model a{
text-decoration: none;
color: #003366;
}

.patternlist-model a:visited{
text-decoration: none;
color: #003366;
}

.patternlist-model h5{
Expand Down Expand Up @@ -169,4 +180,4 @@
/* Modal */
.deactivate-modal-buttons{
display: none;
}
}

0 comments on commit f96f695

Please sign in to comment.