@@ -5,25 +5,13 @@ import * as S from './MemeDetailPage.styles';
55import { useTheme } from '@emotion/react' ;
66import { useRef , useState , useEffect } from 'react' ;
77import { useScroll , useTransform , useSpring } from 'motion/react' ;
8-
9- const DUMMY_DATA = {
10- resultType : 'SUCCESS' ,
11- success : {
12- id : 1 ,
13- title : '죽겠어요' ,
14- summary : '힘든 상황에서 사용되는 대표적인 밈' ,
15- usage :
16- '주로 매우 당황스럽거나 난처한 상황, 또는 감당하기 힘든 일이 생겼을 때, 또는 웃음이 터져 나올 것 같은 상황에서 짓는 김혜수 배우의 표정을 묘사한 움짤을 의미합니다. 주로 온라인 커뮤니티나 SNS에서 유행하며, 해당 상황에 공감하거나 재미를 표현하는 용도로 사용됩니다.' ,
17- origin :
18- "김혜수의 몇 안 되는 개그짤. 영화 《모던 보이》의 댄스신을 촬영하기 위해서 연습하던 도중, 지쳐 주저앉은 장면인데 '죽겠어요'란 대사와 묘한 눈빛의 싱크로율 때문에 패러디감이 되었다. 몇 안되는 다른 개그짤로 기를 죽이고 그래요도 있다." ,
19- image : 'https://picsum.photos/800/600' ,
20- hashtags : [ '직장인' , '해탈짤' ] ,
21- year : 2022 ,
22- } ,
23- error : null ,
24- } as const ;
8+ import { useParams } from 'react-router-dom' ;
9+ import { useMemeDetailQuery } from '@meme_wiki/apis' ;
2510
2611const MemeDetailPage = ( ) => {
12+ const { memeId } = useParams ( ) ;
13+ const { data : memeDetail } = useMemeDetailQuery ( memeId ! ) ;
14+
2715 const theme = useTheme ( ) ;
2816 const containerRef = useRef < HTMLDivElement > ( null ) ;
2917 const { scrollY } = useScroll ( { container : containerRef } ) ;
@@ -52,14 +40,14 @@ const MemeDetailPage = () => {
5240 < S . Container ref = { containerRef } >
5341 < S . ImageContainer style = { { height : smoothHeight } } >
5442 < S . Image
55- src = { DUMMY_DATA . success . image }
56- alt = { DUMMY_DATA . success . title }
43+ src = { memeDetail ? .success . imgUrl }
44+ alt = { memeDetail ? .success . title }
5745 />
5846 < S . ShareButton
5947 onClick = { ( ) => {
6048 nativeBridge . shareMeme ( {
61- title : DUMMY_DATA . success . title ,
62- image : DUMMY_DATA . success . image ,
49+ title : memeDetail ? .success . title ?? '' ,
50+ image : memeDetail ? .success . imgUrl ?? '' ,
6351 } ) ;
6452 } }
6553 >
@@ -69,26 +57,26 @@ const MemeDetailPage = () => {
6957 </ S . ImageContainer >
7058 < S . ContentContainer >
7159 < S . YearBadge >
72- < S . YearText > { DUMMY_DATA . success . year } </ S . YearText >
60+ < S . YearText > { memeDetail ? .success . trendPeriod } </ S . YearText >
7361 </ S . YearBadge >
74- < S . Title > { DUMMY_DATA . success . title } </ S . Title >
62+ < S . Title > { memeDetail ? .success . title } </ S . Title >
7563 < S . HashTags >
76- { DUMMY_DATA . success . hashtags . map ( ( tag ) => `# ${ tag } ` ) }
64+ { memeDetail ? .success . hashtags . map ( ( tag ) => `${ tag } ` ) }
7765 </ S . HashTags >
7866 < S . SectionTitle >
7967 < SymbolTwoIcon width = { 18 } height = { 18 } />
8068 이럴 때 쓰세요
8169 </ S . SectionTitle >
82- < S . SectionText > { DUMMY_DATA . success . usage } </ S . SectionText >
70+ < S . SectionText > { memeDetail ? .success . usageContext } </ S . SectionText >
8371 < S . SectionTitle >
8472 < SymbolThreeIcon width = { 18 } height = { 18 } />
8573 이렇게 시작됐어요
8674 </ S . SectionTitle >
87- < S . SectionText > { DUMMY_DATA . success . origin } </ S . SectionText >
75+ < S . SectionText > { memeDetail ? .success . origin } </ S . SectionText >
8876 </ S . ContentContainer >
8977 </ S . Container >
9078 </ Layout >
9179 ) ;
9280} ;
9381
94- export default MemeDetailPage ;
82+ export default MemeDetailPage ;
0 commit comments