Skip to content

Commit

Permalink
feature-081: rebase 후 충돌 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
gs0428 committed Feb 19, 2024
1 parent c1dc539 commit e409d9f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/components/Home/RecentVideos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import { IVideoProps } from 'types/videos';

interface IRecentVideosProp {
videos: IVideoProps[];
searchRef: React.RefObject<HTMLInputElement>;
}

const RecentVideos = ({ videos }: IRecentVideosProp) => {
const RecentVideos = ({ videos, searchRef }: IRecentVideosProp) => {
return (
<RecentVideosContainer>
<div className="container">
Expand All @@ -39,7 +40,12 @@ const RecentVideos = ({ videos }: IRecentVideosProp) => {
<VideoButton
onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
>
<h2 className="button-text">영상 정리해보기</h2>
<h2
className="button-text"
onClick={() => searchRef.current?.focus()}
>
영상 정리해보기
</h2>
</VideoButton>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/SearchYoutube.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const SearchYoutube = ({ searchRef }: Props) => {
disabled={status === 'CONTINUE'}
onChange={handleChangeInput}
placeholder="https://youtube.com/..."
// searchRef={searchRef}
ref={searchRef}
/>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const HomePage: React.FC = () => {
const isOpenModal = useRecoilValue(recommendationModalState);
const [recentVideos, setRecentVideos] = useState<IVideoProps[]>([]);
const [dummyVideos, setDummyVideos] = useState<IVideoProps[]>([]);
const searchRef = useRef();
const { createToast } = useCreateToast();
const searchRef = useRef(null);

const onFileClick = async (
videoId: number,
Expand Down Expand Up @@ -84,7 +84,7 @@ const HomePage: React.FC = () => {
backgroundColor: 'white',
}}
>
<RecentVideos videos={recentVideos} />
<RecentVideos searchRef={searchRef} videos={recentVideos} />
<InsightVideos
userToken={userToken}
dummyVideos={dummyVideos}
Expand Down

0 comments on commit e409d9f

Please sign in to comment.