Skip to content

Commit

Permalink
feat: add component ocupação
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Mar 30, 2022
1 parent ffa4bd1 commit 53c17bc
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/components/Ocupacao/Ocupacao.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.ocupacao {
display: flex;
width: 100%;
height: 30px;
justify-content: space-around;
align-items: center;
text-align: center;

p {
color: var(--gray);
cursor: pointer;
margin-top: 0;
}
}

.active {
color: var(--orange) !important;
text-decoration: underline;
}
27 changes: 27 additions & 0 deletions src/components/Ocupacao/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useAuth } from 'hooks/useAuth';

import styles from './Ocupacao.module.scss';

export function Ocupacao() {
const { ocupacao, setOcupacao } = useAuth();

return (
<div className={styles.ocupacao}>
{ocupacao === 'cliente' ? (
<p className={styles.active} onClick={() => setOcupacao('cliente')}>
Sou cliente
</p>
) : (
<p onClick={() => setOcupacao('cliente')}>Sou cliente</p>
)}

{ocupacao === 'barbeiro' ? (
<p className={styles.active} onClick={() => setOcupacao('barbeiro')}>
Sou barbeiro
</p>
) : (
<p onClick={() => setOcupacao('barbeiro')}>Sou barbeiro</p>
)}
</div>
);
}

0 comments on commit 53c17bc

Please sign in to comment.