-
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
7086d79
commit a59af32
Showing
11 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -131,6 +131,7 @@ input { | |
|
||
.video-wrapper { | ||
flex-direction: row; | ||
justify-content: center; | ||
} | ||
|
||
.play-image-icon { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from "react"; | ||
import { MdOutlineSlowMotionVideo } from "react-icons/md"; | ||
import { format } from "timeago.js"; | ||
|
||
const VideoCardResults = ({ data }) => { | ||
return ( | ||
<div className="video-wrapper"> | ||
<div className="card-container"> | ||
<div className="card-video"> | ||
<img | ||
src={data.snippet.thumbnails.medium.url} | ||
className="video-thumbnail" | ||
alt={`${data.snippet.title} video thumbnail`} | ||
/> | ||
<MdOutlineSlowMotionVideo | ||
size={50} | ||
color="#00BFFF" | ||
className="play-image-icon" | ||
/> | ||
|
||
<div className="video-details"> | ||
<div className="video-title">{data.snippet.title}</div> | ||
<br /> | ||
<div>Uploader: {data.snippet.channelTitle}</div> | ||
<div>{format(data.snippet.publishTime)}</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default VideoCardResults; |
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,37 @@ | ||
const videoResult = { | ||
kind: "youtube#searchResult", | ||
id: { | ||
kind: "youtube#video", | ||
videoId: "wmf0_pxCtxk", | ||
}, | ||
snippet: { | ||
publishedAt: "2022-11-18T09:37:09Z", | ||
channelId: "UC2h1GsM_Ls1Cg6M-Mk42UYQ", | ||
title: | ||
"India Vs New Zealand 1st T20 Full Match Highlights | Ind Vs Nz 1st T20 Full Match Highlights |Pandya", | ||
description: | ||
"HIGHLIGHTS #LIVE #IndiavsEngland #IndvsEng #indvsengt202022 #Ipl2022 #RohitSharma #ViratKohli #JaspritBumrah ...", | ||
thumbnails: { | ||
default: { | ||
url: "https://i.ytimg.com/vi/wmf0_pxCtxk/default.jpg", | ||
width: 120, | ||
height: 90, | ||
}, | ||
medium: { | ||
url: "https://i.ytimg.com/vi/wmf0_pxCtxk/mqdefault.jpg", | ||
width: 320, | ||
height: 180, | ||
}, | ||
high: { | ||
url: "https://i.ytimg.com/vi/wmf0_pxCtxk/hqdefault.jpg", | ||
width: 480, | ||
height: 360, | ||
}, | ||
}, | ||
channelTitle: "Sports Edge Cricket", | ||
liveBroadcastContent: "none", | ||
publishTime: "2022-11-18T09:37:09Z", | ||
}, | ||
}; | ||
|
||
export default videoResult; |
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,22 @@ | ||
import React, { useContext } from "react"; | ||
|
||
import GlobalContext from "../context/GlobalContext"; | ||
import { VideoCardResults } from "../components"; | ||
|
||
const SearchResultsScreen = () => { | ||
const { searchResults } = useContext(GlobalContext); | ||
return ( | ||
<div> | ||
<div className="trending-title">Search Results</div> | ||
{searchResults?.length > 0 ? ( | ||
searchResults.map((video, index) => { | ||
return <VideoCardResults data={video} key={index} />; | ||
}) | ||
) : ( | ||
<div>Videos not found</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default SearchResultsScreen; |
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,4 @@ | ||
export { default as HomeScreen } from "./HomeScreen"; | ||
export { default as VideoDetailsScreen } from "./VideoDetailsScreen"; | ||
export { default as SearchResultsScreen } from "./SearchResultsScreen"; | ||
export { default as ErrorScreen } from "./ErrorScreen"; |