File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ const MemeDetailPage = () => {
6464 </ S . ActionButton >
6565 < S . ActionButton
6666 onClick = { ( ) => {
67- alert ( '밈 꾸미기' ) ;
67+ nativeBridge . customMeme ( {
68+ title : memeDetail ?. success . title ?? '' ,
69+ image : memeDetail ?. success . imgUrl ?? '' ,
70+ } ) ;
6871 } }
6972 >
7073 < MemeDesignPenIcon />
Original file line number Diff line number Diff line change 11export const COMMAND_TYPE = {
22 SHARE_MEME : 'SHARE_MEME' ,
3+ CUSTOM_MEME : 'CUSTOM_MEME' ,
34} as const ;
45
56export type CommandType = ( typeof COMMAND_TYPE ) [ keyof typeof COMMAND_TYPE ] ;
@@ -9,8 +10,14 @@ export interface ShareMemeData {
910 image : string ;
1011}
1112
13+ export interface CustomMemeData {
14+ title : string ;
15+ image : string ;
16+ }
17+
1218export type CommandDataMap = {
1319 [ COMMAND_TYPE . SHARE_MEME ] : ShareMemeData ;
20+ [ COMMAND_TYPE . CUSTOM_MEME ] : CustomMemeData ;
1421} ;
1522
1623export interface BridgeCommand < T extends CommandType > {
Original file line number Diff line number Diff line change 33 COMMAND_TYPE ,
44 CommandDataMap ,
55 CommandType ,
6+ CustomMemeData ,
67 ShareMemeData ,
78} from '../types/bridge' ;
89
@@ -91,6 +92,11 @@ class NativeBridge {
9192 shareMeme ( data : ShareMemeData ) {
9293 this . sendCommand ( COMMAND_TYPE . SHARE_MEME , data ) ;
9394 }
95+
96+ // 밈 꾸미기
97+ customMeme ( data : CustomMemeData ) {
98+ this . sendCommand ( COMMAND_TYPE . CUSTOM_MEME , data ) ;
99+ }
94100}
95101
96102export const nativeBridge = NativeBridge . getInstance ( ) ;
You can’t perform that action at this time.
0 commit comments