File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -5,23 +5,29 @@ import * as s from './style.css';
55import useDrawer from '@/common/hooks/useDrawer' ;
66import OptionDrawer from '@/features/detail/components/OptionDrawer' ;
77import type { ItemDetailInterface } from '../../types' ;
8+ import { useToast } from '@/common/hooks/useToast' ;
89
910interface Props {
1011 state : ItemDetailInterface ;
1112}
1213const DetailHeader = ( { state } : Props ) => {
1314 const navigate = useNavigate ( ) ;
1415 const { open, drawerState } = useDrawer ( ) ;
16+ const { openToast } = useToast ( ) ;
1517
1618 const goBack = ( ) => navigate ( - 1 ) ;
19+ const handleShare = ( ) => {
20+ navigator . clipboard . writeText ( window . location . href ) ;
21+ openToast ( { message : '링크가 복사되었어요' } ) ;
22+ } ;
1723
1824 return (
1925 < >
2026 < div className = { s . Filter } />
2127 < header className = { s . Container } >
2228 < button className = { `mgc_left_line ${ s . BackButton } ` } onClick = { goBack } aria-label = "Go back" />
2329 < div className = { s . RightSide } >
24- < button className = { `${ s . RightButton } mgc_share_3_fill` } aria-label = "Share item" />
30+ < button className = { `${ s . RightButton } mgc_share_3_fill` } aria-label = "Share item" onClick = { handleShare } />
2531 < button className = { `${ s . RightButton } mgc_more_2_fill` } onClick = { open } />
2632 </ div >
2733 </ header >
You can’t perform that action at this time.
0 commit comments