Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feat: COR-1087: Applied a new button design #4511

Merged
merged 5 commits into from
Dec 1, 2022
Merged
Changes from 2 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
74 changes: 28 additions & 46 deletions packages/app/src/components/article-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';
import { ArrowIconLeft } from '~/components/arrow-icon';
import { Box } from '~/components/base';
import { ContentBlock } from '~/components/cms/content-block';
import { Heading, InlineText } from '~/components/typography';
import { Heading, InlineText, Anchor } from '~/components/typography';
import { ArticleCategoryType } from '~/domain/topical/common/categories';
import { useIntl } from '~/intl';
import { SiteText } from '~/locale';
Expand All @@ -15,6 +15,8 @@ import { RichContent } from './cms/rich-content';
import { LinkWithIcon } from './link-with-icon';
import { PublicationDate } from './publication-date';
import { useBreakpoints } from '~/utils/use-breakpoints';
import { colors } from '@corona-dashboard/common';
import { space } from '~/style/theme';
interface ArticleDetailProps {
article: Article;
text: SiteText['pages']['topical_page']['shared'];
Expand Down Expand Up @@ -50,29 +52,17 @@ export function ArticleDetail({ article, text }: ArticleDetailProps) {
<RichContent blocks={article.intro} contentWrapper={ContentBlock} />
</Box>

<ContentImage
node={article.cover}
contentWrapper={ContentBlock}
sizes={imageSizes}
/>
<ContentImage node={article.cover} contentWrapper={ContentBlock} sizes={imageSizes} />
</ContentBlock>
{!breakpoints.xs
? article.imageMobile && (
<Box mt={4}>
<ContentImage
node={article.imageMobile}
contentWrapper={ContentBlock}
sizes={imageSizes}
/>
<ContentImage node={article.imageMobile} contentWrapper={ContentBlock} sizes={imageSizes} />
</Box>
)
: article.imageDesktop && (
<Box mt={4}>
<ContentImage
node={article.imageDesktop}
contentWrapper={ContentBlock}
sizes={imageSizes}
/>
<ContentImage node={article.imageDesktop} contentWrapper={ContentBlock} sizes={imageSizes} />
</Box>
)}
{!!article.content?.length && (
Expand All @@ -93,9 +83,7 @@ export function ArticleDetail({ article, text }: ArticleDetailProps) {
{article.categories && (
<ContentBlock>
<Box pb={2} pt={4}>
<InlineText color="gray7">
{text.secties.artikelen.tags}
</InlineText>
<InlineText color="gray7">{text.secties.artikelen.tags}</InlineText>
</Box>
<Box
as="ul"
Expand All @@ -117,13 +105,7 @@ export function ArticleDetail({ article, text }: ArticleDetailProps) {
}}
passHref={true}
>
<TagAnchor>
{
text.secties.artikelen.categorie_filters[
item as ArticleCategoryType
]
}
</TagAnchor>
<StyledTagAnchor>{text.secties.artikelen.categorie_filters[item as ArticleCategoryType]}</StyledTagAnchor>
</Link>
</li>
))}
Expand All @@ -134,25 +116,25 @@ export function ArticleDetail({ article, text }: ArticleDetailProps) {
);
}

const TagAnchor = styled.a(
css({
display: 'block',
border: '2px solid transparent',
mb: 3,
px: 3,
py: 2,
backgroundColor: 'blue3',
color: 'blue8',
textDecoration: 'none',
transition: '0.1s border-color',
const StyledTagAnchor = styled(Anchor)`
border-radius: 5px;
border: 2px solid ${colors.gray4};
color: ${colors.black};
display: block;
margin-bottom: ${space[3]};
padding: ${space[2]} ${space[3]};
DariaKwork marked this conversation as resolved.
Show resolved Hide resolved

'&:hover': {
borderColor: 'blue8',
},
&:hover {
background: ${colors.blue8};
border: 2px solid ${colors.blue8};
color: ${colors.white};
text-shadow: 0.5px 0px 0px ${colors.white}, -0.5px 0px 0px ${colors.white};
}

'&:focus': {
outline: '2px dotted',
outlineColor: 'blue8',
},
})
);
&:focus {
background: ${colors.blue8};
border: 2px solid ${colors.blue8};
color: ${colors.white};
text-shadow: 0.5px 0px 0px ${colors.white}, -0.5px 0px 0px ${colors.white};
}
DariaKwork marked this conversation as resolved.
Show resolved Hide resolved
`;