-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5aab5fe
commit 662903e
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"hello": "Hello World!" | ||
} | ||
"hello": "Hello World!", | ||
"videoErrorBody": "This video is blocked on your network.", | ||
"videoErrorHeading": "Video unavailable" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use client'; | ||
import '@code-dot-org/component-library/video/index.css'; | ||
import initTranslations from "@/app/i18n"; | ||
|
||
import { Video as DscoVideo, VideoProps } from '@code-dot-org/component-library/video'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
const Video = (props: VideoProps) => { | ||
const [errorBody, setErrorBody] = useState<string | undefined>(undefined); | ||
const [errorHeading, setErrorHeading] = useState<string | undefined>(undefined); | ||
|
||
useEffect(() => { | ||
initTranslations('zh-CN', ['common']).then(({ t }) => { | ||
setErrorHeading(t('videoErrorHeading')); | ||
setErrorBody(t('videoErrorBody')); | ||
}) | ||
}, []) | ||
//const { t, i18n } = useTranslation(); | ||
|
||
return <DscoVideo errorHeading={errorHeading} errorBody={errorBody} {...props} /> | ||
//return <DscoVideo errorHeading={t('videoErrorHeading')} errorBody={t('videoErrorBody')} {...props} /> | ||
} | ||
|
||
export default Video; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import '@code-dot-org/component-library/video/index.css'; | ||
import initTranslations from "@/app/i18n"; | ||
|
||
// Export the Component Definition for use in Contentful Studio | ||
export {VideoContentfulComponentDefinition} from './videoContentfulDefinition'; | ||
export {default} from '@code-dot-org/component-library/video'; | ||
export { VideoContentfulComponentDefinition } from './videoContentfulDefinition'; | ||
|
||
export { default as default } from './Video'; |