Skip to content

Commit

Permalink
๐Ÿ› Fix: ๋ฐ์ดํ„ฐ ๋ณ€๊ฒฝ๋˜๋ฉด ์Šฌ๋ผ์ด๋“œ ์œ„๋กœ ์˜ฌ๋ฆผ
Browse files Browse the repository at this point in the history
  • Loading branch information
7beunseo committed Oct 26, 2024
1 parent 6e8e466 commit 54ef62b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/components/workdetail/leftcomponent/LeftContent.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { useEffect, useRef } from 'react';
import * as L from './LeftContent.style';
import Image from '../image/Image';

export default function LeftContent({ images }) {
console.log(images);
const containerRef = useRef(null);

useEffect(() => {
if (containerRef.current) {
containerRef.current.scrollTop = 0;
}
}, [images]);

return (
<L.LeftContentContainer>
<L.LeftContentContainer ref={containerRef}>
{images.map((item, index) => (
<Image key={index} src={item.url} />
))}
Expand Down
12 changes: 10 additions & 2 deletions src/components/workdetail/rightcomponent/RightContent.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useEffect, useRef } from 'react';
import * as R from './RightContent.style';
import viewSiteImage from '../../../assets/img/viewsite_black.png';
import WorkTitle from '../worktitle/WorkTitle';
Expand All @@ -8,9 +9,16 @@ import ViewSite from '../button/ViewSite';


export default function RightContent({ data }) {
console.log(data);
const containerRef = useRef(null);

useEffect(() => {
if (containerRef.current) {
containerRef.current.scrollTop = 0;
}
}, [data]);

return (
<R.RightContentContainer>
<R.RightContentContainer ref={containerRef}>
<WorkTitle
title={data.title}
shortDescription={data.shortDescription}
Expand Down

0 comments on commit 54ef62b

Please sign in to comment.