Skip to content

Commit

Permalink
Merge pull request #365 from dhis2/overview-card-styling
Browse files Browse the repository at this point in the history
fix(summarycard): adjust icon-less design
  • Loading branch information
cooper-joe authored Dec 21, 2023
2 parents ccd226c + 72289c7 commit 0fecea2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
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

0 comments on commit 0fecea2

Please sign in to comment.