Skip to content

Commit

Permalink
updated README.md, fixed undefined views
Browse files Browse the repository at this point in the history
  • Loading branch information
manikandanraji committed Jul 7, 2020
1 parent ea6242d commit f96a9d4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 19 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Then run <code>npm i</code> and <code>npm start</code> to see the youtube clone

![Watch](screenshots/video.png)

### Suggestions

![Suggestions](screenshots/suggestions.png)

### Channel

![Trending](screenshots/profile.png)
Expand Down
Binary file added screenshots/suggestions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions src/components/TrendingCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,8 @@ const TrendingCard = ({ video }) => {
<span>{video.User.username}</span>

<span></span>
{video.views === 0 && <span>No views</span>}

{video.views !== 0 && (
<span>
{video.views > 1 ? `${video.views} views` : `${video.views} view`}
</span>
)}
<span></span>
<span>{video.views || 0} views</span>
<span></span>{" "}

<span>{timeSince(video.createdAt)} ago</span>
</p>
Expand Down
9 changes: 1 addition & 8 deletions src/components/VideoCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,7 @@ const VideoCard = ({ nousername, hideavatar, video }) => {
<span className="secondary">{video.User.username}</span>
)}
<p className="secondary">
{video.views === 0 && <span>No views</span>}
{video.views !== 0 && (
<span>
{video.views > 1
? `${video.views} views`
: `${video.views} view`}
</span>
)}{" "}
<span>{video.views || 0} views</span>{" "}
<span></span> <span>{timeSince(video.createdAt)} ago</span>
</p>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/pages/Subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Subscriptions = ({ isFetching, videos, getFeed }) => {

return (
<StyledHome>
<div style={{ marginTop: "1.5rem" }}></div>
<VideoGrid>
{!isFetching && videos.map(video => (
<Link key={video.id} to={`/watch/${video.id}`}>
Expand Down
5 changes: 2 additions & 3 deletions src/styles/Skeleton.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled, { keyframes } from "styled-components";

const pulse = keyframes`
0% {
background-position: 0% 0%;
Expand All @@ -14,9 +13,9 @@ const SkeletonPulse = styled.div`
display: block;
height: 100%;
width: 100%;
background: linear-gradient(-90deg, #121212 0%, #191818 50%, #121212 100%);
background: linear-gradient(-90deg, #121212 0%, #161616 50%, #121212 100%);
background-size: 400% 400%;
animation: ${pulse} 1.2s ease-in-out infinite;
animation: ${pulse} 1s linear;
`;

export const SkeletonLine = styled(SkeletonPulse)`
Expand Down

0 comments on commit f96a9d4

Please sign in to comment.