Skip to content

Commit

Permalink
refactor: adjust the accordio tab header (#590)
Browse files Browse the repository at this point in the history
* refactor: adjust the accordio tab header

* refactor: add the change accordion tab header  icon

* refactor: adjust side paddings
  • Loading branch information
JpBurgarelli authored Aug 20, 2024
1 parent a4d8b88 commit 893a84e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
15 changes: 6 additions & 9 deletions src/components/AccordionTab/AccordionTab.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
display: none;

color: $primaryWhite;
font-size: 4rem;
font-weight: 900;

margin-right: 2rem;
margin-top: 0.2rem;

cursor: pointer;
}
Expand Down Expand Up @@ -57,19 +55,18 @@
font-size: 1.6rem;
line-height: 1;

padding: 1.2rem;
padding: 1.3rem 2.2rem;

position: relative;

background-color: $secondaryPurple;
border-radius: 17px 17px 0 0;

&::before {
font-size: 1.8rem;
.innerHeader {
display: flex;
gap: 1.5rem;

margin-right: 1rem;

content: '';
align-items: center;
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/components/AccordionTab/AccordionTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ function AccordionTab({
const handleClose = (): void => {
if (props.onChangeOpen) props.onChangeOpen(!isOpen);
};

const renderCloseButton = (): ReactNode => (
<button className={scss.closeButton} onClick={handleClose} type="button">
<Icon icon="minus" size={16} />
<Icon icon={isOpen ? 'minus' : 'plus'} size={16} />
</button>
);

const renderHeader = (): ReactNode => (
<div className={scss.header}>
<p className={scss.headerTitle}>{props.title}</p>
<div className={scss.innerHeader}>
<Icon icon="circle" size={12} />
<p className={scss.headerTitle}>{props.title}</p>
</div>
{hideCloseButton ? null : renderCloseButton()}
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Alert from './icons/alert.svg?react';
import ArrowRight from './icons/arrow-right.svg?react';
import Check from './icons/check.svg?react';
import Circle from './icons/circle.svg?react';
import Close from './icons/close.svg?react';
import TriangleDropArrow from './icons/drop-down.svg?react';
import Hamburguer from './icons/hamburguer.svg?react';
Expand All @@ -18,6 +19,7 @@ export const icons = {
alert: Alert,
'arrow-right': ArrowRight,
check: Check,
circle: Circle,
close: Close,
hamburguer: Hamburguer,
'left-arrow': LeftArrow,
Expand Down
3 changes: 3 additions & 0 deletions src/components/Icon/icons/circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 893a84e

Please sign in to comment.