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

Commit

Permalink
removed anchor tag (#4385)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorrik-Klijnsma-Work authored and VWSCoronaDashboard24 committed Aug 29, 2022
1 parent 9754892 commit a2eb4f4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 25 deletions.
44 changes: 44 additions & 0 deletions packages/app/src/domain/topical/components/text-with-chevron.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Box } from '~/components/base';
import css from '@styled-system/css';
import styled from 'styled-components';
import { ChevronRight } from '@corona-dashboard/icons';
import { colors } from '@corona-dashboard/common';
import { Text } from '~/components/typography';

type TextWithChevronProps = {
label: string;
};

export const TextWithChevron = ({ label }: TextWithChevronProps) => {
return (
<Box
display="flex"
justifyContent="center"
alignItems="center"
bg={colors.lightBlue}
color={colors.blue}
padding={3}
className="topical-tile-cta"
css={css({
transition: 'background .1s ease-in-out',
})}
>
<Text>{label}</Text>
<IconSmall>
<ChevronRight />
</IconSmall>
</Box>
);
}

const IconSmall = styled.div(
css({
display: 'inline',
textDecoration: 'inherit',
svg: {
width: 11,
height: 10,
},
marginLeft: 1,
})
);
28 changes: 3 additions & 25 deletions packages/app/src/domain/topical/components/topical-tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { space } from '~/style/theme';
import css from '@styled-system/css';
import styled from 'styled-components';
import { Heading } from '~/components/typography';
import { LinkWithIcon } from '~/components/link-with-icon';
import { TextWithChevron } from './text-with-chevron';
import { asResponsiveArray } from '~/style/utils';
import { colors } from '@corona-dashboard/common';
import DynamicIcon from '~/components/get-icon-by-name';
import { ChevronRight, Down, Up } from '@corona-dashboard/icons';
import { Down, Up } from '@corona-dashboard/icons';
import { Markdown } from '~/components/markdown';
import { TopicalIcon } from '@corona-dashboard/common/src/types';

Expand Down Expand Up @@ -55,8 +55,6 @@ export function TopicalTile({
css={css({
'&:hover .topical-tile-cta': {
bg: colors.blue,
},
'&:hover .topical-tile-cta a': {
textDecoration: 'underline',
color: colors.white,
},
Expand Down Expand Up @@ -113,27 +111,7 @@ export function TopicalTile({
</Box>
</Box>

{cta ? (
<Box
display="flex"
justifyContent={'center'}
bg={colors.lightBlue}
color={colors.blue}
padding={3}
className="topical-tile-cta"
css={css({
transition: 'background .1s ease-in-out',
})}
>
<LinkWithIcon
href={cta.href}
icon={<ChevronRight />}
iconPlacement="right"
>
{cta.label}
</LinkWithIcon>
</Box>
) : null}
{cta && <TextWithChevron label={cta.label}></TextWithChevron>}
</>
</Box>
);
Expand Down

0 comments on commit a2eb4f4

Please sign in to comment.