Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(summarycard): adjust icon-less design #365

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions src/pages/overview/card/SummaryCard.module.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
.cardGroup {
display: grid;
grid-template-columns: repeat(auto-fill, 320px);
grid-gap: var(--spacers-dp16);
grid-gap: var(--spacers-dp12);
}

.cardGroupHeader {
font-size: 22px;
padding: 12px 0;
font-size: 20px;
padding: var(--spacers-dp24) 0 var(--spacers-dp12) 0;
color: var(--colors-grey900);
line-height: 40px;
line-height: 28px;
}

.cardWrapper {
display: flex;
flex-direction: column;
padding: 16px;
align-content: space-between;
width: 320px;
height: 100%;
background: var(--colors-white);
border-radius: 3px;
border: 1px solid var(--colors-grey400);
}

.cardTopLink {
padding: 12px;
}

.cardTopLink:hover .cardHeader {
text-decoration: underline;
}

.cardIcon svg {
width: 32px;
height: 32px;
display: none;
}

.cardHeader {
padding: 12px 0px;
padding: 0 0 6px 0;
color: var(--colors-grey900);
font-size: 16px;
font-weight: 500;
Expand All @@ -43,9 +55,10 @@
.cardActions {
/* margin-auto pushes this to the bottom (extends margin to occupy extra space) */
margin-top: auto;
padding-top: 12px;
padding: 8px 12px;
display: flex;
gap: var(--spacers-dp8);
border-top: 1px solid var(--colors-grey300);
}

.cardActions a {
Expand Down
18 changes: 10 additions & 8 deletions src/pages/overview/card/SummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@ export const SummaryCard = ({
}: SummaryCardProps) => {
const title = section.title
return (
<Card dataTest={`card-${title}`}>
<div className={styles.cardWrapper}>
<Link to={`/${getSectionPath(section)}`}>
<div className={styles.cardIcon}>{icon}</div>
<div data-test={`card-${title}`} className={styles.cardWrapper}>
<Link
className={styles.cardTopLink}
to={`/${getSectionPath(section)}`}
>
<div className={styles.cardTop}>
<SummaryCardHeader>{title}</SummaryCardHeader>
<SummaryCardContent>{children}</SummaryCardContent>
</Link>
<SummaryCardActions section={section} />
</div>
</Card>
</div>
</Link>
<SummaryCardActions section={section} />
</div>
)
}

Expand Down
Loading