Skip to content

Commit

Permalink
PEXELS STREAM 1.14.0
Browse files Browse the repository at this point in the history
Update Responsive
Update Header.tsx
Update translate.ts
Update Header.styles.ts
Update WatchVideoContents.tsx
Update HomepageVideos.styles.ts
Update WatchVideoContents.styles.ts
  • Loading branch information
DavidGomezToca committed Jan 28, 2025
1 parent 40339ce commit 72c0340
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- **STACK :**

- **PEXELS STREAM** : `1.13.0`
- **PEXELS STREAM** : `1.14.0`
- **FAKER** : `8.4.1`
- **REACT** : `18.2.0`
- **PEXELS** : `1.4.0`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pexels-stream",
"version": "1.13.0",
"version": "1.14.0",
"private": true,
"dependencies": {
"@faker-js/faker": "^8.4.1",
Expand Down
8 changes: 8 additions & 0 deletions src/components/header/Header.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const LogoSection = styled(Link)`
align-items: center;
gap: 0.2rem;
text-decoration: none;
&.small {
scale: 0.8;
}
`;

export const SearchBar = styled.div`
Expand All @@ -52,4 +56,8 @@ export const SearchBar = styled.div`
font-size: inherit;
padding-left: 1rem;
}
input.small {
padding: 0;
}
`;
3 changes: 2 additions & 1 deletion src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ const Header = () => {
<SlMenu size={17} />
</Icon>
)}
<LogoSection to="/">
<LogoSection className={window.innerWidth <= 400 ? "small" : ""} to="/">
<FaYoutube color="#FF0000" size={30} />
<Text className="logo">PexelsStream</Text>
</LogoSection>
</LeftSection>
<SearchSection>
<SearchBar>
<input
className={window.innerWidth <= 400 ? "small" : ""}
id="search-bar-input"
value={searchText}
placeholder={text.search}
Expand Down
2 changes: 1 addition & 1 deletion src/components/homepageVideos/HomepageVideos.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from "styled-components";
export const StyledHomepageVideos = styled.div`
overflow-y: scroll;
height: 100vh;
padding: 1.6rem 1.5rem 2rem 1.5rem;
padding: 1.6rem 1.5rem 5rem 1.5rem;
`;

export const RegularVideoThumbnailsContainer = styled.div`
Expand Down
13 changes: 12 additions & 1 deletion src/components/watchVideoContents/WatchVideoContents.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export const StyledWatchVideoContents = styled.div`
grid-template-columns: 71.5vw 24vw;
padding: 0 1.5rem;
overflow: scroll;
&.small {
grid-template-columns: 100%;
}
`;

export const MoreVideosContainer = styled.div`
Expand All @@ -25,7 +29,6 @@ export const WatchVideosContainer = styled.div`

export const VideoScreen = styled.div`
width: 100%;
height: 44rem;
border-radius: 1rem;
overflow: hidden;
`;
Expand Down Expand Up @@ -56,6 +59,10 @@ export const VideoDetailsActions = styled.div`
align-items: center;
justify-content: space-between;
margin-top: 1rem;
&.small {
display: block;
}
`;

export const VideoDetailsInfo = styled.div`
Expand Down Expand Up @@ -98,6 +105,10 @@ export const DetailsActions = styled.div`
display: flex;
align-items: center;
gap: 0.5rem;
&.small {
margin-top: 20px;
}
`;

export const DetailsActionButton = styled.div`
Expand Down
32 changes: 21 additions & 11 deletions src/components/watchVideoContents/WatchVideoContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ const WatchVideoContents = () => {

return (
<div>
<StyledWatchVideoContents>
<StyledWatchVideoContents
className={window.innerWidth <= 1100 ? "small" : ""}
>
<WatchVideosContainer>
<VideoScreen>
<ReactPlayer
Expand All @@ -142,7 +144,9 @@ const WatchVideoContents = () => {
</VideoScreen>
<VideoDetails>
<Text className="videoScreenTitle">{title}</Text>
<VideoDetailsActions>
<VideoDetailsActions
className={window.innerWidth <= 600 ? "small" : ""}
>
<VideoDetailsInfo>
<RegularVideoPic>
<img src={videoToWatchData?.image} alt="profile pic" />
Expand All @@ -160,7 +164,9 @@ const WatchVideoContents = () => {
{subscribed ? text.subscribed : text.subscribe}
</SubscribeButton>
</VideoDetailsInfo>
<DetailsActions>
<DetailsActions
className={window.innerWidth <= 600 ? "small" : ""}
>
<DetailsActionButton>
<>
<TiThumbsUp
Expand Down Expand Up @@ -204,14 +210,18 @@ const WatchVideoContents = () => {
</VideoDescription>
</VideoDetails>
</WatchVideosContainer>
<MoreVideosContainer>
<Categories />
{videos
.filter((video) => video.id !== videoToWatchData?.id)
.map((video) => (
<RegularVideoItem key={video.id} smallView={true} video={video} />
))}
</MoreVideosContainer>
<MoreVideosContainer>
<Categories />
{videos
.filter((video) => video.id !== videoToWatchData?.id)
.map((video) => (
<RegularVideoItem
key={video.id}
smallView={true}
video={video}
/>
))}
</MoreVideosContainer>
</StyledWatchVideoContents>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions src/utils/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ export const translateText = async (
)
) {
console.warn("Translation limit reached:", data.responseDetails);
return text; // Return the original text if the limit is reached
return text;
}
if (data?.responseData?.translatedText) {
return data.responseData.translatedText;
}
console.error("Translation response does not contain translated text.");
return null;
return text;
} catch (error) {
console.error("Error fetching translation:", error);
return null;
return text;
}
} else {
return text;
Expand Down

0 comments on commit 72c0340

Please sign in to comment.