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

Commit 803be44

Browse files
committed
Merge branch 'staging' into develop
2 parents 0cabf13 + ae567a1 commit 803be44

File tree

6 files changed

+265
-152
lines changed

6 files changed

+265
-152
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: 'npm'
4+
directory: '/'
55
schedule:
6-
interval: "daily"
6+
interval: 'daily'

.github/workflows/chromatic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# .github/workflows/chromatic.yml
22
# name of our action
3-
name: "Chromatic Deployment"
3+
name: 'Chromatic Deployment'
44
# the event that will trigger the action
55
on: push
66

components/atoms/VideoEmbed/VideoEmbed.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import RichText from '@/components/atoms/RichText'
12
import cn from 'classnames'
23
import PropTypes from 'prop-types'
34
import React from 'react'
4-
import RichText from '@/components/atoms/RichText'
55
import styles from './VideoEmbed.module.css'
66

77
/**
@@ -20,6 +20,7 @@ export default function VideoEmbed({className, url, type, caption}) {
2020
* Create URL embed for YouTube or Vimeo videos.
2121
*
2222
* @param {string} url The video URL.
23+
* @return {string} Formatted video URL.
2324
*/
2425
function createVideoUrl(url) {
2526
if (!url) {

components/blocks/Gutenberg/BlockEmbed/BlockEmbed.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,24 @@ export default function BlockEmbed({
3333
if (providerNameSlug === 'twitter') {
3434
setLoadTweet(1)
3535
}
36-
})
36+
}, [providerNameSlug])
37+
38+
if (!url) {
39+
return
40+
}
3741

3842
return (
3943
<>
40-
{!!url && (
41-
<>
42-
{!!loadTweet && (
43-
<Tweet className={className} url={url} caption={caption} />
44-
)}
45-
{!!supportedVideoTypes.includes(providerNameSlug) && (
46-
<VideoEmbed
47-
className={className}
48-
url={url}
49-
caption={caption}
50-
type={providerNameSlug}
51-
/>
52-
)}
53-
</>
44+
{!!loadTweet && (
45+
<Tweet className={className} url={url} caption={caption} />
46+
)}
47+
{!!supportedVideoTypes.includes(providerNameSlug) && (
48+
<VideoEmbed
49+
className={className}
50+
url={url}
51+
caption={caption}
52+
type={providerNameSlug}
53+
/>
5454
)}
5555
</>
5656
)

0 commit comments

Comments
 (0)