From ec9a35b6f62e55e5b5d6ef8447af30ec8607b778 Mon Sep 17 00:00:00 2001 From: byein Date: Sat, 21 Jan 2023 05:36:36 +0900 Subject: [PATCH] feat: add choice for select in usepopup --- baedalmate/src/components/utils/usePopup.tsx | 84 ++++++++++++-------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/baedalmate/src/components/utils/usePopup.tsx b/baedalmate/src/components/utils/usePopup.tsx index ced2d64..a587d93 100644 --- a/baedalmate/src/components/utils/usePopup.tsx +++ b/baedalmate/src/components/utils/usePopup.tsx @@ -1,12 +1,13 @@ -import React, {useState} from 'react'; +import React from 'react'; import Modal from 'react-native-modal/dist/modal'; -import {View, TouchableOpacity, TouchableHighlight} from 'react-native'; +import {View, TouchableHighlight, Image} from 'react-native'; import {TextKRBold, TextKRReg} from 'themes/text'; import { WHITE_COLOR, LINE_GRAY_COLOR, PRIMARY_COLOR, DARK_GRAY_COLOR, + LOADING_PRIMARY_ICON, } from 'themes/theme'; export const UsePopup = ({ @@ -16,6 +17,15 @@ export const UsePopup = ({ handleModal, choiceCnt, confirmEvent, + icon, +}: { + title; + modal; + handleModal; + choiceCnt; + confirmEvent?; + description?; + icon?; }) => { return ( @@ -45,10 +55,18 @@ export const UsePopup = ({ style={{ justifyContent: 'center', alignItems: 'center', - borderBottomWidth: 1, + borderBottomWidth: icon ? 0 : 1, borderColor: LINE_GRAY_COLOR, paddingHorizontal: 15, }}> + {icon && ( + + + + )} - - {choiceCnt > 1 && ( + {confirmEvent && ( + + {choiceCnt > 1 && ( + { + handleModal(); + }} + underlayColor={LINE_GRAY_COLOR}> + + 취소 + + + )} { + confirmEvent(); handleModal(); }} underlayColor={LINE_GRAY_COLOR}> - 취소 + 확인 - )} - { - confirmEvent(); - handleModal(); - }} - underlayColor={LINE_GRAY_COLOR}> - - 확인 - - - + + )}