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

Commit

Permalink
feat: COR-1087: Applied a new button design (#4511)
Browse files Browse the repository at this point in the history
* feat: applied a new button design

* fix: resolved conversation

* fix: resolved conversation

* fix: fixing styling of the button outline

* fix: fixing styling of the button outline

Co-authored-by: VWSCoronaDashboard27 <[email protected]>
  • Loading branch information
DariaKwork and VWSCoronaDashboard27 authored Dec 1, 2022
1 parent 16d9c5c commit 88f5b49
Showing 1 changed file with 29 additions and 46 deletions.
75 changes: 29 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,26 @@ 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]};
'&:hover': {
borderColor: 'blue8',
},
&:focus:focus-visible {
outline: 2px dotted ${colors.blue8};
}
'&:focus': {
outline: '2px dotted',
outlineColor: '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-visible {
outline: 2px dotted ${colors.magenta3};
}
}
`;

0 comments on commit 88f5b49

Please sign in to comment.