File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import styled from 'styled-components' ;
2+ import styled , { css } from 'styled-components' ;
33import theme from '../styles/theme' ;
44import { 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
4754export const Quote : React . FC < QuoteProps > = ( { author, url, children } ) => {
4855 return (
Original file line number Diff line number Diff line change 66 TeamMemberPhoto ,
77 TeamMemberWrapper ,
88} from './TeamMember.components' ;
9+ import { Caption } from '../../components/Typography' ;
910
1011const 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 }
Original file line number Diff line number Diff line change 55 ThumbnailContent ,
66 ThumbnailImg ,
77} from './PostThumbnail.components' ;
8- import { Caption } from '../../components/Typography' ;
8+ import { CaptionWithLink } from '../../components/Typography' ;
99
1010const 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 ) ;
You can’t perform that action at this time.
0 commit comments