Skip to content

Commit

Permalink
refac:production deploy fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anwesha2002 committed Dec 19, 2024
1 parent 3481bd5 commit 68dc62f
Show file tree
Hide file tree
Showing 24 changed files with 454 additions and 403 deletions.
4 changes: 2 additions & 2 deletions src/Component/Comments/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "./_comments.scss"
import {Comment} from "../Comment/Comment.tsx";
import {Form} from "react-bootstrap";
import {useAppDispatch , useAppSelector} from "../../redux/store.ts";
import {useEffect , useState} from "react";
import {FormEvent , useEffect , useState} from "react";
import {GetCommentsThunk , postCommentsThunk} from "../../redux/commentSlice.ts";


Expand Down Expand Up @@ -33,7 +33,7 @@ export function Comments({videoId, totalComments} : CommentsProps){
(comment) => comment.snippet.topLevelComment.snippet
)

function handleSubmit(e){
function handleSubmit(e : FormEvent){
e.preventDefault()
setCommentText(commentText)
if(commentText.length == 0) return
Expand Down
10 changes: 7 additions & 3 deletions src/Component/Header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ import {AiOutlineSearch} from "react-icons/ai";
import {MdApps , MdNotifications} from "react-icons/md";
import ytLogo from "../../public/Youtube_logo.png"
import "./_header.scss"
import { useState} from "react";
import {FormEvent , useState} from "react";
import {useNavigate} from "react-router-dom";
import { useAppSelector} from "../../redux/store.ts";

export function Header({handleToggleSidebar}){
type HeaderProps = {
handleToggleSidebar : () => void
}

export function Header({handleToggleSidebar} : HeaderProps){
const [input, setInput] = useState("")
const navigate= useNavigate()

// const dispatch = useAppDispatch()
const { user } = useAppSelector(state => state.auth)


function handleSubmit(e){
function handleSubmit(e : FormEvent){
e.preventDefault()
setInput(input)
if(input.trim() !== "") navigate(`search/${input}`)
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {getsubscriptionsThunk} from "../../redux/subscriptionsSlice.ts";

const cache = new Map();

export function Sidebar({showSidebar}){
export function Sidebar({showSidebar} : {showSidebar : boolean}){

if (window.scrollY) {
window.scroll(0, 0); // reset the scroll position to the top left of the document.
Expand All @@ -57,7 +57,7 @@ export function Sidebar({showSidebar}){

const { subscriptions } = useAppSelector(state => state.subscriptions)

function handleClick(channelId){
function handleClick(channelId : string){
navigate(`/feed/${channelId}`)
}

Expand Down
11 changes: 9 additions & 2 deletions src/Component/Video/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import moment from 'moment'
import numeral from 'numeral'
import { useNavigate} from "react-router-dom";

export function Video({item, channelScreen, duration, channelIcon}){
type videoProps = {
item : any,
channelScreen? : any,
duration : any,
channelIcon : any
}

export function Video({item, channelScreen, duration, channelIcon} : videoProps){

const {
id,
Expand Down Expand Up @@ -89,7 +96,7 @@ export function Video({item, channelScreen, duration, channelIcon}){
{!channelScreen && (
<div className='video__channel'>
{/*<LazyLoadImage src={channelIcon?.url} effect='blur' />*/}
<img src={channelIcon?.snippet?.thumbnails?.default?.url} effect='blur' />
<img src={channelIcon?.snippet?.thumbnails?.default?.url} alt="channelIcon" />

<p>{channelTitle}</p>
</div>
Expand Down
16 changes: 12 additions & 4 deletions src/Component/VideoHorizontal/VideoHorizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ import moment from "moment";
import numeral from "numeral";
import { useNavigate} from "react-router-dom";

export function VideoHorizontal({videos, searchScreen, searchresult, subScreen, channelIcons, viewsDuration}){
type VideoHorizontalProps = {
videos : any,
searchScreen? : any,
searchresult? : boolean,
subScreen? : any,
channelIcon? : any,
viewsDuration : any
}
export function VideoHorizontal({videos, searchScreen, searchresult, subScreen, channelIcon, viewsDuration} : VideoHorizontalProps){

// const [views, setViews] = useState()
// const [duration, setDuration] = useState()
Expand Down Expand Up @@ -127,14 +135,14 @@ export function VideoHorizontal({videos, searchScreen, searchresult, subScreen,

{subScreen &&
<div className='videoHorizontal_details ' style={{fontSize: "0.7rem"}}>
{channelIcons?.snippet?.customUrl} . {' '}
{numeral ( channelIcons?.statistics?.subscriberCount ).format ( '0.a' )} Subscribers
{channelIcon?.snippet?.customUrl} . {' '}
{numeral ( channelIcon?.statistics?.subscriberCount ).format ( '0.a' )} Subscribers
</div>
}

<div className='my-1 videoHorizontal_channel d-flex align-items-center'>
{isVideo && searchresult &&
<img src={channelIcons?.snippet.thumbnails.default.url} />
<img src={channelIcon?.snippet.thumbnails.default.url} />
}
{ isVideo && searchresult && <p className='mb-0'>{ channelTitle }</p> }
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Component/VideoMetaData/VideoMetaData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type videoMetadataProps = {
videoID : string |undefined
}

export function VideoMetaData({video ,videoID} : videoMetadataProps) {
export function VideoMetaData({video } : videoMetadataProps) {

const dispatch = useAppDispatch()

Expand Down
Loading

0 comments on commit 68dc62f

Please sign in to comment.