Skip to content

Commit 275d139

Browse files
author
Tiko
committed
changed subtitle to be a paragraph and be used by blogpost and credits
1 parent 13b9859 commit 275d139

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

src/components/Typography.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from 'styled-components';
33
import theme from '../styles/theme';
44
import { QuoteProps } from './Typography.types';
55

6-
const { fontWeights, fonts } = theme;
6+
const { fontWeights, fonts, typography } = theme;
77
const QuoteText = styled.blockquote`
88
font-weight: ${fontWeights.light};
99
line-height: 1.2em;
@@ -20,12 +20,16 @@ export const Small = styled.span`
2020
font-size: 0.66em;
2121
`;
2222

23-
export const Subtitle = styled.h6`
23+
export const Subtitle = styled.p`
2424
size: 0.85rem;
2525
height: 1.2em;
2626
font-family: ${fonts.paragraph};
2727
font-weight: ${fontWeights.bold};
2828
color: ${theme.colors.primary};
29+
text-transform: uppercase;
30+
letter-spacing: ${typography.subtitle.spacing};
31+
font-size: 0.85rem;
32+
margin-bottom: 0.5em;
2933
`;
3034

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

src/containers/Credits/Credits.components.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import styled from 'styled-components';
33
import theme from '../../styles/theme';
44
import Button from '../../components/Button/Button';
5+
import { Subtitle } from '../../components/Typography';
56

67
const { mediaQueryMin } = theme;
78
export const CreditsContainer = styled.div`
@@ -51,7 +52,7 @@ interface CreditItemProps {
5152
}
5253
export const CreditItem: React.FC<CreditItemProps> = ({ title, credits }) => (
5354
<CreditItemContainer>
54-
<CreditTitle className="subtitle">{title}</CreditTitle>
55+
<Subtitle>{title}</Subtitle>
5556
{credits.map((credit) => (
5657
<CreditText className="Paragraph light">{credit}</CreditText>
5758
))}
@@ -70,7 +71,7 @@ export const CreditItemWithLinks: React.FC<CreditItemWithLinksProps> = ({
7071
links,
7172
}: CreditItemWithLinksProps) => (
7273
<CreditItemContainer>
73-
<CreditTitle className="subtitle">{title}</CreditTitle>
74+
<Subtitle>{title}</Subtitle>
7475
{credits.map((credit, index) => (
7576
<>
7677
<CreditText>{credit}</CreditText>

src/layouts/BlogpostLayout.components.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components';
22
import theme from '../styles/theme';
3-
import { Big, Small } from '../components/Typography';
3+
import { Big, Small, Subtitle } from '../components/Typography';
44

55
const { mediaQueryMin, colors } = theme;
66

@@ -117,15 +117,12 @@ export const SubtitleContainer = styled.div`
117117
text-transform: uppercase;
118118
align-items: flex-end;
119119
padding: 0 1em;
120-
span,
121-
p {
122-
opacity: 0.3;
123-
color: ${colors.lightgray};
124-
}
125120
`;
126121

127122
export const ReadingTime = styled(Small)`
128123
margin-bottom: 2px;
124+
opacity: 0.3;
125+
color: ${colors.lightgray};
129126
`;
130127

131128
export const ArticleImage = styled.img`
@@ -143,3 +140,9 @@ export const CallToActionText = styled.p`
143140
font-style: italic;
144141
color: ${theme.colors.lightgray} !important;
145142
`;
143+
144+
export const StyledSubtitle = styled(Subtitle)`
145+
margin-top: 0.66em;
146+
margin-bottom: 0.33em;
147+
font-weight: ${theme.fontWeights.regular};
148+
`;

src/layouts/BlogpostLayout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import MDXRenderer from 'gatsby-mdx/mdx-renderer'; // TODO: fix mdx to work with Typescript
2+
import MDXRenderer from 'gatsby-mdx/mdx-renderer';
33
import { BlogpostSingleProps, CallToActionProps } from './BlogpostLayout.types';
44
import Layout from './MainLayout';
55
import Author from '../containers/Author/Author';
@@ -19,6 +19,7 @@ import {
1919
ArticleIntro,
2020
CallToActionContainer,
2121
CallToActionText,
22+
StyledSubtitle,
2223
} from './BlogpostLayout.components';
2324

2425
const CallToAction: React.FC<CallToActionProps> = () => (
@@ -44,7 +45,7 @@ const BlogSingle: React.FC<BlogpostSingleProps> = ({ content }) => (
4445
<Article>
4546
<ArticleHeader>
4647
<SubtitleContainer>
47-
<Subtitle>{content.category_name}</Subtitle>
48+
<StyledSubtitle>{content.category_name}</StyledSubtitle>
4849
<ReadingTime>
4950
&nbsp;&nbsp;&#47;&#47; {content.reading_time} min. read
5051
</ReadingTime>

0 commit comments

Comments
 (0)