Skip to content

Commit aa974a7

Browse files
author
Tiko
committed
changed caption to paragraph and added a CaptionWithLink Component
1 parent a390a04 commit aa974a7

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/components/Typography.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import styled from 'styled-components';
2+
import styled, { css } from 'styled-components';
33
import theme from '../styles/theme';
44
import { QuoteProps } from './Typography.types';
55

@@ -35,14 +35,21 @@ export const Subtitle = styled.p`
3535
margin-bottom: 0.5em;
3636
`;
3737

38-
export const Caption = styled.a`
38+
const captionStyle = css`
3939
font-size: ${caption.size};
4040
line-height: ${caption.height};
4141
letter-spacing: ${caption.spacing};
4242
font-family: ${caption.font};
4343
font-weight: ${caption.weight};
4444
color: ${caption.color};
4545
`;
46+
export const CaptionWithLink = styled.a`
47+
${captionStyle}
48+
`;
49+
50+
export const Caption = styled.p`
51+
${captionStyle}
52+
`;
4653

4754
export const Quote: React.FC<QuoteProps> = ({ author, url, children }) => {
4855
return (

src/containers/TeamMember/TeamMember.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
TeamMemberPhoto,
77
TeamMemberWrapper,
88
} from './TeamMember.components';
9+
import { Caption } from '../../components/Typography';
910

1011
const getAltText = (name: string, alt?: string) => {
1112
if (alt) {
@@ -48,7 +49,7 @@ const TeamMember: React.FC<TeamMemberProps> = ({
4849
<img src={img} alt={getAltText(name, alt)} />
4950
</TeamMemberPhoto>
5051
<TeamMemberName>{name}</TeamMemberName>
51-
<p className="caption">{title}</p>
52+
<Caption>{title}</Caption>
5253
<AllSocials
5354
link={link}
5455
email={email}

src/containers/Thumbnails/PostThumbnail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ThumbnailContent,
66
ThumbnailImg,
77
} from './PostThumbnail.components';
8-
import { Caption } from '../../components/Typography';
8+
import { CaptionWithLink } from '../../components/Typography';
99

1010
const cutOffText = (string: string, maxLength: number) => {
1111
if (string.length > maxLength) {
@@ -35,7 +35,7 @@ const PostThumbnail: React.FC<PostThumbnailProps> = ({
3535
<ThumbnailContent big={big}>
3636
<StyledSubtitle>{category}</StyledSubtitle>
3737
<h5>{cutOffText(title, 80)}</h5>
38-
<Caption href={slug}>Lees meer</Caption>
38+
<CaptionWithLink href={slug}>Lees meer</CaptionWithLink>
3939
</ThumbnailContent>
4040
</ThumbnailBase>
4141
);

0 commit comments

Comments
 (0)