Skip to content

Commit

Permalink
Merge pull request #116 from teamViNO/feature-022
Browse files Browse the repository at this point in the history
Feature 022 : 검색 더미 페이지 이동 구현
  • Loading branch information
whistleJs authored Feb 19, 2024
2 parents e873e2e + 49b2a0b commit f563d9b
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit f563d9b

Please sign in to comment.