11import Layout from '@/components/Layout' ;
2- import { ShareIcon , SymbolThreeIcon , SymbolTwoIcon } from '@/assets/icons' ;
2+ import {
3+ MemeDesignPenIcon ,
4+ ShareIcon ,
5+ SymbolThreeIcon ,
6+ SymbolTwoIcon ,
7+ } from '@/assets/icons' ;
38import { nativeBridge } from '@/utils/bridge' ;
49import * as S from './MemeDetailPage.styles' ;
510import { useTheme } from '@emotion/react' ;
6- import { useRef , useState , useEffect } from 'react' ;
7- import { useScroll , useTransform , useSpring } from 'motion/react' ;
11+ import { useRef } from 'react' ;
812import { useParams } from 'react-router-dom' ;
913import { useMemeDetailQuery } from '@meme_wiki/apis' ;
1014
@@ -14,22 +18,6 @@ const MemeDetailPage = () => {
1418
1519 const theme = useTheme ( ) ;
1620 const containerRef = useRef < HTMLDivElement > ( null ) ;
17- const { scrollY } = useScroll ( { container : containerRef } ) ;
18-
19- const height = useTransform ( scrollY , [ 0 , 60 ] , [ 400 , 175 ] ) ;
20- const smoothHeight = useSpring ( height , {
21- stiffness : 300 ,
22- damping : 50 ,
23- } ) ;
24-
25- const [ isTextVisible , setIsTextVisible ] = useState ( true ) ;
26-
27- useEffect ( ( ) => {
28- const unsubscribe = scrollY . on ( 'change' , ( latest ) => {
29- setIsTextVisible ( latest < 1 ) ;
30- } ) ;
31- return ( ) => unsubscribe ( ) ;
32- } , [ scrollY ] ) ;
3321
3422 return (
3523 < Layout
@@ -38,22 +26,11 @@ const MemeDetailPage = () => {
3826 } }
3927 >
4028 < S . Container ref = { containerRef } >
41- < S . ImageContainer style = { { height : smoothHeight } } >
29+ < S . ImageContainer >
4230 < S . Image
4331 src = { memeDetail ?. success . imgUrl }
4432 alt = { memeDetail ?. success . title }
4533 />
46- < S . ShareButton
47- onClick = { ( ) => {
48- nativeBridge . shareMeme ( {
49- title : memeDetail ?. success . title ?? '' ,
50- image : memeDetail ?. success . imgUrl ?? '' ,
51- } ) ;
52- } }
53- >
54- < ShareIcon width = { 24 } height = { 24 } />
55- { isTextVisible && < S . ShareButtonText > 공유하기</ S . ShareButtonText > }
56- </ S . ShareButton >
5734 </ S . ImageContainer >
5835 < S . ContentContainer >
5936 < S . YearBadge >
@@ -75,6 +52,22 @@ const MemeDetailPage = () => {
7552 < S . SectionText > { memeDetail ?. success . origin } </ S . SectionText >
7653 </ S . ContentContainer >
7754 </ S . Container >
55+ < S . ButtonContainer >
56+ < S . ActionButton
57+ onClick = { ( ) => {
58+ nativeBridge . shareMeme ( {
59+ title : memeDetail ?. success . title ?? '' ,
60+ image : memeDetail ?. success . imgUrl ?? '' ,
61+ } ) ;
62+ } }
63+ >
64+ < ShareIcon width = { 24 } height = { 24 } />
65+ 공유하기
66+ </ S . ActionButton >
67+ < S . ActionButton >
68+ < MemeDesignPenIcon width = { 24 } height = { 24 } /> 밈 꾸미기
69+ </ S . ActionButton >
70+ </ S . ButtonContainer >
7871 </ Layout >
7972 ) ;
8073} ;
0 commit comments