Skip to content

Commit

Permalink
feat: add props ocupacao
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed May 6, 2022
1 parent 8d89fc7 commit 94e53ea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/Ocupacao/index.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import { OcupacaoProps } from 'types/IComponents';

import { useAuth } from 'hooks/useAuth';

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

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

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

{ocupacao === 'barbeiro' ? (
<div className={styles.active} onClick={() => setOcupacao('barbeiro')}>
<p>Sou barbeiro</p>
<p>{props.barbeiro ? props?.barbeiro : 'Sou Barbeiro'}</p>
</div>
) : (
<div onClick={() => setOcupacao('barbeiro')} className={styles.none}>
<p>Sou barbeiro</p>
<p>{props.barbeiro ? props?.barbeiro : 'Sou Barbeiro'}</p>
</div>
)}
</div>
Expand Down

0 comments on commit 94e53ea

Please sign in to comment.