Skip to content

Commit

Permalink
feat: ocupacao select register
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 7, 2022
1 parent 4fa09e0 commit f71a453
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
28 changes: 24 additions & 4 deletions src/components/Ocupacao/Ocupacao.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,23 @@
}

.active {
color: var(--orange) !important;
text-decoration: underline;
border-bottom: 2px solid var(--orange);
width: 8rem;

p {
color: var(--orange) !important;
margin-bottom: 5px;
}
}

.none {
border-bottom: 2px solid var(--gray);
width: 8rem;

p {
color: var(--gray) !important;
margin-bottom: 5px;
}
}

@media screen and (min-width: 839px) {
Expand All @@ -35,7 +50,12 @@
}

.active {
color: var(--orange) !important;
text-decoration: underline;
border-bottom: 2px solid var(--orange);
width: 8rem;

p {
color: var(--orange) !important;
margin-bottom: 5px;
}
}
}
20 changes: 12 additions & 8 deletions src/components/Ocupacao/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ export function Ocupacao() {
return (
<div className={styles.ocupacao}>
{ocupacao === 'cliente' ? (
<p className={styles.active} onClick={() => setOcupacao('cliente')}>
Sou cliente
</p>
<div className={styles.active} onClick={() => setOcupacao('cliente')}>
<p>Sou cliente</p>
</div>
) : (
<p onClick={() => setOcupacao('cliente')}>Sou cliente</p>
<div onClick={() => setOcupacao('cliente')} className={styles.none}>
<p>Sou cliente</p>
</div>
)}

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

0 comments on commit f71a453

Please sign in to comment.