Skip to content

Commit

Permalink
More consistent TLDR styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ceolson01 committed Aug 28, 2019
1 parent 2e43eb3 commit 9f7e19d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 47 deletions.
10 changes: 6 additions & 4 deletions src/modules/core/components/GridItem/GridItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import styles from './GridItem.module.css';

type Props = {|
body: MessageDescriptor,
image: string,
image?: string,
links?: Array<{ href: string, text: MessageDescriptor }>,
title: MessageDescriptor,
|};
Expand All @@ -22,9 +22,11 @@ const displayName = 'GridItem';

const GridItem = ({ body, image, links = [], title }: Props) => (
<div className={styles.main}>
<div>
<Image alt={title} className={styles.image} src={image} />
</div>
{image && (
<div className={styles.imageContainer}>
<Image alt={title} className={styles.image} src={image} />
</div>
)}
<div className={styles.content}>
<div className={styles.contentInner}>
<div className={styles.heading}>
Expand Down
14 changes: 7 additions & 7 deletions src/modules/core/components/GridItem/GridItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@
justify-content: space-between;
}

.main > div:first-child {
.imageContainer {
flex: 0 0 22%;
}

.main > div:nth-child(2) {
flex: 0 0 64%;
}

.image {
height: auto;
width: 60px;
Expand All @@ -34,6 +30,10 @@
flex-direction: column;
}

.imageContainer + .content {
flex: 0 0 64%;
}

.contentInner {
display: flex;
flex-direction: column;
Expand All @@ -52,11 +52,11 @@
width: 70px;
}

.main > div:first-child {
.imageContainer {
flex: 0 0 22%;
}

.main > div:nth-child(2) {
.imageContainer + .content {
flex: 0 0 74%;
}
}
Expand Down
40 changes: 4 additions & 36 deletions src/modules/pages/components/Website/HomePage/TLDR/TLDR.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import { defineMessages } from 'react-intl';

import Heading from '~core/Heading';
import GridItem from '~core/GridItem';

import styles from './TLDR.module.css';

Expand Down Expand Up @@ -54,46 +55,13 @@ const TLDR = () => (
</div>
<div className={styles.cols}>
<div className={styles.colItem}>
<Heading
appearance={{
margin: 'none',
size: 'medium',
theme: 'dark',
}}
text={MSG.headingOne}
/>
<Heading
appearance={{ size: 'mediumLarge', theme: 'dark', weight: 'thin' }}
text={MSG.textOne}
/>
<GridItem body={MSG.textOne} title={MSG.headingOne} />
</div>
<div className={styles.colItem}>
<Heading
appearance={{
margin: 'none',
size: 'medium',
theme: 'dark',
}}
text={MSG.headingTwo}
/>
<Heading
appearance={{ size: 'mediumLarge', theme: 'dark', weight: 'thin' }}
text={MSG.textTwo}
/>
<GridItem body={MSG.textTwo} title={MSG.headingTwo} />
</div>
<div className={styles.colItem}>
<Heading
appearance={{
margin: 'none',
size: 'medium',
theme: 'dark',
}}
text={MSG.headingThree}
/>
<Heading
appearance={{ size: 'mediumLarge', theme: 'dark', weight: 'thin' }}
text={MSG.textThree}
/>
<GridItem body={MSG.textThree} title={MSG.headingThree} />
</div>
</div>
</div>
Expand Down

0 comments on commit 9f7e19d

Please sign in to comment.