Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 0a28eee

Browse files
committed
Merge branch 'staging' into feature/114-file-upload-field
2 parents d3743a3 + fbd16a6 commit 0a28eee

File tree

89 files changed

+1160
-662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1160
-662
lines changed

components/atoms/Code/Code.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import PropTypes from 'prop-types'
22
import React from 'react'
3-
import styles from './Code.module.css'
43
import {Prism as SyntaxHighlighter} from 'react-syntax-highlighter'
54
import {tomorrow} from 'react-syntax-highlighter/dist/cjs/styles/prism'
5+
import styles from './Code.module.css'
66

77
/**
88
* Render the Code component.
99
*
1010
* @author WebDevStudios
11-
* @param {object} props The component attributes as props.
12-
* @param {string} props.className Optional classname.
13-
* @param props.id
14-
* @param props.content
15-
* @param {boolean} props.fullWidth Is this a fullwidth block.
16-
* @return {Element} The Code component.
11+
* @param {object} props The component attributes as props.
12+
* @param {string} props.className Optional classname.
13+
* @param {string} props.id The optional ID.
14+
* @param {string} props.content The content for inside the code block.
15+
* @return {Element} The Code component.
1716
*/
1817
export default function Code({id, className, content}) {
1918
// Use the className to pass the langauge.

components/atoms/Image/Image.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1+
import RichText from '@/components/atoms/RichText'
2+
import cn from 'classnames'
13
import Link from 'next/link'
24
import PropTypes from 'prop-types'
35
import React from 'react'
4-
import RichText from '@/components/atoms/RichText'
56
import styles from './Image.module.css'
6-
import cn from 'classnames'
77

88
/**
99
* Render the Image component.
1010
*
1111
* @author WebDevStudios
12-
* @param {string} anchor The anchor/id of the block.
13-
* @param {string} alt The image alt text.
14-
* @param {string} caption The image caption.
15-
* @param {string} className The image class.
16-
* @param {string} id The image ID.
17-
* @param {string} href The URL of the link.
18-
* @param {string} linkTarget Target for the link.
19-
* @param {string} linkClass Class for the link.
20-
* @param {string} rel The rel attribute for the link.
21-
* @param {string} sizeSlug The WP image size.
22-
* @param {string} url The full URL path of the image.
23-
* @return {Element} The Image component.
12+
* @param {object} props The component properties.
13+
* @param {string} props.anchor The anchor/id of the block.
14+
* @param {string} props.alt The image alt text.
15+
* @param {string} props.caption The image caption.
16+
* @param {string} props.className The image class.
17+
* @param {string} props.id The image ID.
18+
* @param {string} props.href The URL of the link.
19+
* @param {string} props.linkTarget Target for the link.
20+
* @param {string} props.linkClass Class for the link.
21+
* @param {string} props.rel The rel attribute for the link.
22+
* @param {string} props.url The full URL path of the image.
23+
* @return {Element} The Image component.
2424
*/
2525
export default function Image({
2626
alt,
@@ -80,6 +80,5 @@ Image.propTypes = {
8080
linkClass: PropTypes.string,
8181
linkTarget: PropTypes.string,
8282
rel: PropTypes.string,
83-
sizeSlug: PropTypes.string,
8483
url: PropTypes.string
8584
}

components/atoms/PullQuote/PullQuote.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import styles from './PullQuote.module.css'
77
* PullQuote Block
88
*
99
* @author WebDevStudios
10-
* @param {string} value The pull quote content of the block.
11-
* @param {string} citation The optional author citation.
12-
* @param {string} id Optional anchor/id.
13-
* @param {string} className Optional classnames.
14-
* @return {Element} The PullQuote component.
10+
* @param {object} props The component properties.
11+
* @param {string} props.value The pull quote content of the block.
12+
* @param {string} props.citation The optional author citation.
13+
* @param {string} props.id Optional anchor/id.
14+
* @param {string} props.className Optional classnames.
15+
* @return {Element} The PullQuote component.
1516
*/
1617
export default function PullQuote({value, citation, id, className}) {
1718
return (

components/atoms/Quote/Quote.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import styles from './Quote.module.css'
99
* The core Quote block from Gutenberg.
1010
*
1111
* @author WebDevStudios
12-
* @param {string} value The quote content of the block.
13-
* @param {string} citation The optional author citation.
14-
* @param {string} id Optional anchor/id.
15-
* @param {string} className Optional classnames.
16-
* @return {Element} The Quote component.
12+
* @param {object} props The component properties.
13+
* @param {string} props.value The quote content of the block.
14+
* @param {string} props.citation The optional author citation.
15+
* @param {string} props.id Optional anchor/id.
16+
* @param {string} props.className Optional classnames.
17+
* @return {Element} The Quote component.
1718
*/
1819
export default function Quote({value, citation, id, className}) {
1920
return (

components/atoms/RichText/RichText.module.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
&.ol,
1111
& p,
1212
&.p {
13-
@apply mb-20;
13+
@apply mb-8;
1414
}
1515

1616
& ul,
@@ -62,26 +62,26 @@
6262
/* Heading Styles */
6363
& h1,
6464
&.h1 {
65-
@apply mb-20;
65+
@apply mb-10;
6666
}
6767

6868
& h2,
6969
&.h2 {
70-
@apply mb-20;
70+
@apply mb-10;
7171
}
7272

7373
& h3,
7474
&.h3 {
75-
@apply mb-20;
75+
@apply mb-10;
7676
}
7777

7878
& h4,
7979
&.h4 {
80-
@apply mb-12;
80+
@apply mb-10;
8181
}
8282

8383
& h5,
8484
&.h5 {
85-
@apply mb-12;
85+
@apply mb-10;
8686
}
8787
}

components/atoms/Separator/Separator.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import styles from './Separator.module.css'
88
* Render the Separator component.
99
*
1010
* @author WebDevStudios
11-
* @param {string} className Optional classname.
12-
* @param {boolean} fullWidth Is this a fullwidth block.
13-
* @return {Element} The Separator component.
11+
* @param {object} props The component properties.
12+
* @param {string} props.className Optional classname.
13+
* @param {boolean} props.fullWidth Is this a fullwidth block.
14+
* @return {Element} The Separator component.
1415
*/
1516
export default function Separator({className, fullWidth}) {
1617
return (

components/atoms/Spacer/Spacer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import React from 'react'
55
* Render the Spacer component.
66
*
77
* @author WebDevStudios
8-
* @param {string} anchor Optional anchor/id.
9-
* @param {number} height The height of the spacer.
10-
* @return {Element} The Spacer component.
8+
* @param {object} props The component properties.
9+
* @param {string} props.anchor Optional anchor/id.
10+
* @param {number} props.height The height of the spacer.
11+
* @return {Element} The Spacer component.
1112
*/
1213
export default function Spacer({height, anchor}) {
1314
const rootEmVal = 16

components/atoms/Table/Table.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import styles from './Table.module.css'
77
* Table Block
88
*
99
* @author WebDevStudios
10-
* @param {string} id Optional anchor/id.
11-
* @param {string} head The optional table head array.
12-
* @param {string} body The table body array.
13-
* @param {string} body The table body array.
14-
* @param {string} foot The optional table foorter array.
15-
* @param {string} caption Optional table caption.
16-
* @param {string} className Optional classnames.
17-
* @return {Element} The Table component.
10+
* @param {object} props The component properties.
11+
* @param {string} props.id Optional anchor/id.
12+
* @param {string} props.head The optional table head array.
13+
* @param {string} props.body The table body array.
14+
* @param {string} props.foot The optional table foorter array.
15+
* @param {string} props.caption Optional table caption.
16+
* @param {string} props.className Optional classnames.
17+
* @return {Element} The Table component.
1818
*/
1919
export default function Table({id, head, body, foot, caption, className}) {
2020
return (
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import RichText from '@/components/atoms/RichText'
2+
import cn from 'classnames'
3+
import PropTypes from 'prop-types'
4+
import {TwitterTweetEmbed} from 'react-twitter-embed'
5+
import styles from './TwitterEmbed.module.css'
6+
7+
/**
8+
* TwitterEmbed Block
9+
*
10+
* @author WebDevStudios
11+
* @param {object} props TwitterEmbed component props.
12+
* @param {string} props.className Optional className.
13+
* @param {string} props.caption Optional caption.
14+
* @param {string} props.url The full URL to the video.
15+
* @return {Element} The TwitterEmbed component.
16+
*/
17+
export default function TwitterEmbed({className, caption, url}) {
18+
const tweetURL = url ? url.split('/') : '' // Split URL string into array.
19+
const tweetId = tweetURL ? tweetURL[tweetURL.length - 1] : '' // Get ID from url array.
20+
21+
return (
22+
<>
23+
{!!tweetId && (
24+
<div className={cn(styles.twitterEmbed, className)}>
25+
<TwitterTweetEmbed tweetId={tweetId} />
26+
{!!caption && (
27+
<div className={styles.caption}>
28+
<RichText tag="span">{caption}</RichText>
29+
</div>
30+
)}
31+
</div>
32+
)}
33+
</>
34+
)
35+
}
36+
37+
TwitterEmbed.propTypes = {
38+
className: PropTypes.string,
39+
caption: PropTypes.string,
40+
url: PropTypes.string.isRequired
41+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.twitterEmbed {
2+
@apply block;
3+
4+
& .caption {
5+
@apply text-center text-xs pt-12;
6+
}
7+
}

0 commit comments

Comments
 (0)