@@ -2,13 +2,13 @@ import { useState } from "react";
22
33import classNames from "classnames" ;
44
5+ import { AppBridgeMessageType } from "@/components/provider/AppBridgeProvider/AppBridgeMessage.types" ;
6+ import { useAppBridge } from "@/components/provider/AppBridgeProvider/AppBridgeProvider" ;
57import styles from "@/components/SelectStyle/SelectStyle.module.scss" ;
68import Button from "@/components/ui/Button/Button" ;
79import Icon from "@/components/ui/Icon/Icon" ;
810import Text from "@/components/ui/Text/Text" ;
911
10- import { useRoute } from "@/hooks/common/useRoute" ;
11-
1212import { useCreateReviewStore } from "@/store/useReviewStore" ;
1313
1414interface StyleProps {
@@ -24,12 +24,14 @@ const IMG_STYLE_DATA = [
2424] ;
2525
2626const SelectStyle = ( ) => {
27- const { navigateToReviewResult } = useRoute ( ) ;
27+ const { send } = useAppBridge ( ) ;
2828
29- const { setReviewStyle } = useCreateReviewStore ( ) ;
29+ const { createReviewData , setReviewStyle } = useCreateReviewStore ( ) ;
3030
3131 const [ selectedStyle , setSelectedStyle ] = useState ( IMG_STYLE_DATA [ 0 ] ) ;
3232
33+ const { ocrText, hashTag, reviewStyle } = createReviewData ;
34+
3335 const handleStyleClick = ( style : StyleProps ) => {
3436 setSelectedStyle ( ( prevStyle ) => ( prevStyle . name === style . name ? IMG_STYLE_DATA [ 0 ] : style ) ) ;
3537 } ;
@@ -39,7 +41,10 @@ const SelectStyle = () => {
3941 setReviewStyle ( selectedStyle . name ) ;
4042 }
4143
42- navigateToReviewResult ( ) ;
44+ send ( {
45+ type : AppBridgeMessageType . CREATE_REVIEW ,
46+ payload : { ocrText, hashTag, reviewStyle } ,
47+ } ) ;
4348 } ;
4449
4550 return (
0 commit comments