Skip to content

Commit

Permalink
Apply SectionHeader logic for indicators group
Browse files Browse the repository at this point in the history
  • Loading branch information
lilia1891 committed Nov 26, 2024
1 parent 482a614 commit 9ba1b2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/contentblocks/ActionListBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ActionListSection = styled.div`
padding: ${(props) => props.theme.spaces.s400} 0;
`;

const SectionHeader = styled.h2`
export const SectionHeader = styled.h2`
text-align: center;
padding: ${(props) => props.theme.spaces.s100};
border-radius: ${(props) => props.theme.cardBorderRadius};
Expand Down
7 changes: 6 additions & 1 deletion components/contentblocks/IndicatorGroupBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import IndicatorHighlightCard from 'components/indicators/IndicatorHighlightCard
import IndicatorVisualisation from 'components/indicators/IndicatorVisualisation';
import Button from 'components/common/Button';
import { useTranslations } from 'next-intl';
import { SectionHeader } from 'components/contentblocks/ActionListBlock';

const IndicatorGraphSection = styled.div`
background-color: ${(props) => props.theme.neutralLight};
Expand Down Expand Up @@ -92,10 +93,14 @@ type Props = {
const IndicatorGroupBlock = ({ id = '', title, indicators }: Props) => {
const t = useTranslations();

const displayHeader = title && title !== '-' ? title : t('indicators');

return (
<IndicatorGraphSection id={id}>
<Container>
<h2>{title ?? t('indicators')}</h2>
{displayHeader && displayHeader !== '-' ? (
<SectionHeader>{displayHeader}</SectionHeader>
) : null}
<Row className="justify-content-center">
{indicators.map((item) => (
<IndicatorItem
Expand Down

0 comments on commit 9ba1b2a

Please sign in to comment.