Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 022 : 검색 더미 페이지 이동 구현 #116

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/SearchPage/SearchResultBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@ import { IVideo } from '@/models/search';
import Styled from '@/styles/SearchResult';
import React from 'react';
import { useNavigate } from 'react-router-dom';
import { userInfoState } from '@/stores/user';
import { useRecoilValue } from 'recoil';

interface SearchResultProp {
video : IVideo;
tags : string[];
}

const SearchResultBox : React.FC<SearchResultProp>= ({video, tags}) => {
const nav = useNavigate();
const nav = useNavigate();
const userName = useRecoilValue(userInfoState);
const date = video.created_at.toString().split('T')[0].split('-');
const handleImg = (event : React.SyntheticEvent<HTMLImageElement, Event>) => {
const target = event.target as HTMLImageElement;
target.style.display = 'none';
}
const handleOnclick = () => {
nav(`/summary/${video.video_id}`);
nav(`/summary/${video.video_id}?insight=${userName?.name === video.user}`);
}

return (
<Styled.VideoCard style={{width : '910px', height : '254px'}} onClick={handleOnclick}>
<div className="main" style={{width : '670px', height : '254px'}}>
Expand Down
Loading