Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianhajdin committed Aug 8, 2022
1 parent 2d852e9 commit 7adf897
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/components/ChannelCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Box, CardContent, CardMedia, Typography } from '@mui/material';
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
import { Link } from 'react-router-dom';
import { demoProfilePicture } from '../utils/constants';

const ChannelCard = ({ channelDetail, marginTop }) => (
<Box
Expand All @@ -20,15 +21,14 @@ const ChannelCard = ({ channelDetail, marginTop }) => (
<Link to={`/channel/${channelDetail?.id?.channelId}`}>
<CardContent sx={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', textAlign: 'center', color: '#fff' }}>
<CardMedia
image={channelDetail?.snippet?.thumbnails?.high?.url}
image={channelDetail?.snippet?.thumbnails?.high?.url || demoProfilePicture}
alt={channelDetail?.snippet?.title}
sx={{ borderRadius: '50%', height: '180px', width: '180px', mb: 2, border: '1px solid #e3e3e3' }}
/>
<Typography variant="h6">
{channelDetail?.snippet?.title}{' '}
<CheckCircleIcon sx={{ fontSize: '14px', color: 'gray', ml: '5px' }} />
</Typography>
{console.log(channelDetail)}
{channelDetail?.statistics?.subscriberCount && (
<Typography sx={{ fontSize: '15px', fontWeight: 500, color: 'gray' }}>
{parseInt(channelDetail?.statistics?.subscriberCount).toLocaleString('en-US')} Subscribers
Expand Down
5 changes: 2 additions & 3 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from "react";
import { Stack } from "@mui/material";
import { Link } from "react-router-dom";

import Logo from "../utils/logo.png";
import { logo } from "../utils/constants";
import { SearchBar } from "./";

const Navbar = () => (
<Stack direction="row" alignItems="center" p={2} sx={{ position: "sticky", background: '#000', top: 0, justifyContent: "space-between" }}>
<Link to="/" style={{ display: "flex", alignItems: "center" }}>
<img src={Logo} alt="logo" height={45} />
<img src={logo} alt="logo" height={45} />
</Link>
<SearchBar />
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const SearchBar = () => {
e.preventDefault();

if (searchTerm) {
navigate.push(`/search/${searchTerm}`);
navigate(`/search/${searchTerm}`);

setSearchTerm('');
}
Expand Down
7 changes: 2 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ import App from './App';
import './index.css';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

root.render(<App />);
5 changes: 4 additions & 1 deletion src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import TheaterComedyIcon from '@mui/icons-material/TheaterComedy';
import FitnessCenterIcon from '@mui/icons-material/FitnessCenter';
import DeveloperModeIcon from '@mui/icons-material/DeveloperMode';

export const logo = 'https://i.ibb.co/s9Qys2j/logo.png';

export const categories = [
{ name: 'New', icon: <HomeIcon />, },
{ name: 'JS Mastery', icon: <CodeIcon />, },
Expand All @@ -36,4 +38,5 @@ export const demoThumbnailUrl = 'https://i.ibb.co/G2L2Gwp/API-Course.png';
export const demoChannelUrl = '/channel/UCmXmlB4-HJytD7wek0Uo97A';
export const demoVideoUrl = '/video/GDa8kZLNhJ4';
export const demoChannelTitle = 'JavaScript Mastery';
export const demoVideoTitle = 'Build and Deploy 5 JavaScript & React API Projects in 10 Hours - Full Course | RapidAPI';
export const demoVideoTitle = 'Build and Deploy 5 JavaScript & React API Projects in 10 Hours - Full Course | RapidAPI';
export const demoProfilePicture = 'http://dergipark.org.tr/assets/app/images/buddy_sample.png'
Binary file removed src/utils/logo.png
Binary file not shown.

0 comments on commit 7adf897

Please sign in to comment.