forked from wizeline/react-certification-2020
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Showing
13 changed files
with
292 additions
and
61 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
API_KEY='AIzaSyBLF4iEDjnWFmKrhEtIetO5qRT2aKQqO4o' |
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
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
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
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
11 changes: 11 additions & 0 deletions
11
src/components/CardList/__snapshots__/CardList.test.jsx.snap
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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Testing CardList CardList Component 1`] = ` | ||
<div> | ||
<div | ||
class="css-1r9y2ds" | ||
> | ||
hola | ||
</div> | ||
</div> | ||
`; |
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
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,26 @@ | ||
import { Box } from '@chakra-ui/layout'; | ||
import React from 'react' | ||
|
||
const Video = ({videoId, title, description}) => { | ||
const videoSrc = `https://www.youtube.com/embed/${videoId}`; | ||
console.log(description) | ||
return ( | ||
<Box maxW="70%" overflow="hidden"> | ||
<iframe src={videoSrc} style={{width: "100%", maxHeight: "600px", height: "500px"}} allowFullScreen title='Video player'/> | ||
<Box | ||
mt="3" | ||
fontWeight="semibold" | ||
as="h2" | ||
lineHeight="tight" | ||
isTruncated | ||
> | ||
{title} | ||
</Box> | ||
<Box ml="3" as="span" color="gray.600" fontSize="sm"> | ||
{description} | ||
</Box> | ||
</Box> | ||
) | ||
} | ||
|
||
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
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,10 +1,9 @@ | ||
import CardList from "../components/CardList/CardList" | ||
import Layout from "../components/Layout/Layout" | ||
|
||
const Index = () => ( | ||
<Layout> | ||
<CardList/> | ||
</Layout> | ||
|
||
<CardList/> | ||
|
||
) | ||
|
||
export default Index |
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,29 @@ | ||
import { Box, Flex, Text } from '@chakra-ui/layout' | ||
import { useRouter } from 'next/router' | ||
import React, { useEffect } from 'react' | ||
import CardList from '../components/CardList/CardList' | ||
import Video from '../components/Video/Video' | ||
|
||
const videoPlayer = () => { | ||
const { query } = useRouter() | ||
const { videoId, title, description } = query | ||
|
||
return ( | ||
<Flex> | ||
<Video videoId={videoId} title={title} description={description} /> | ||
<Box w="sm"> | ||
<CardList list={true} IdVid={videoId} /> | ||
</Box> | ||
</Flex> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
) | ||
} | ||
|
||
export default videoPlayer |
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,12 @@ | ||
import axios from 'axios'; | ||
const KEY = 'AIzaSyBLF4iEDjnWFmKrhEtIetO5qRT2aKQqO4o'; | ||
|
||
export default axios.create({ | ||
baseURL: 'https://www.googleapis.com/youtube/v3/', | ||
params: { | ||
part: 'snippet', | ||
maxResults: 15, | ||
key: KEY, | ||
type: 'video', | ||
} | ||
}) |
Oops, something went wrong.