From b5d0ae99bdbfe06d6b8c3cfbd5d6a45b7ae13926 Mon Sep 17 00:00:00 2001 From: byein Date: Wed, 18 Jan 2023 10:18:19 +0900 Subject: [PATCH] chore: change star rating ui - #11 --- .../atoms/StarRating/StarRating.tsx | 5 +- baedalmate/src/components/pages/Detail.tsx | 63 ++++++++++++++----- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/baedalmate/src/components/atoms/StarRating/StarRating.tsx b/baedalmate/src/components/atoms/StarRating/StarRating.tsx index bae3106..bb0e8ea 100644 --- a/baedalmate/src/components/atoms/StarRating/StarRating.tsx +++ b/baedalmate/src/components/atoms/StarRating/StarRating.tsx @@ -24,16 +24,17 @@ const StarRatingComponent = ({ const {register, handleSubmit, setValue} = useForm; useEffect(() => { - setRating(Math.ceil(rating)); - console.log(Math.ceil(rating)); + // setRating(Math.ceil(rating)); setValue(`users.${userId}.userId`, userId); setValue(`users.${userId}.score`, rating); + console.log(rating); }, [rating]); return ( ); }; diff --git a/baedalmate/src/components/pages/Detail.tsx b/baedalmate/src/components/pages/Detail.tsx index b58202a..1c68534 100644 --- a/baedalmate/src/components/pages/Detail.tsx +++ b/baedalmate/src/components/pages/Detail.tsx @@ -1,6 +1,15 @@ import React, {useEffect, useState} from 'react'; import DetailImage from 'components/atoms/Image/DetailImage'; -import {ActionSheetIOS, ScrollView, StyleSheet, View} from 'react-native'; +import { + ActionSheetIOS, + KeyboardAvoidingView, + Modal, + Platform, + ScrollView, + StyleSheet, + TouchableOpacity, + View, +} from 'react-native'; import UserInfo from 'components/molecules/Detail/UserInfo'; import Title from 'components/molecules/Detail/Title'; import ItemInfo from 'components/molecules/Detail/ItemInfo'; @@ -22,6 +31,7 @@ import { PRIMARY_COLOR, DARK_GRAY_COLOR, ERROR_COLOR, + LINE_GRAY_COLOR, } from 'themes/theme'; import {Fonts} from 'assets/Fonts'; import PlatformImage from 'components/atoms/Image/PlatformImage'; @@ -30,6 +40,13 @@ import {useNavigation} from '@react-navigation/native'; import BtnVerticalWhite from 'components/atoms/Button/BtnVerticalWhite'; import BtnVerticalGray from 'components/atoms/Button/BtnVerticalGray'; import {UserInfoI} from 'components/utils/api/User'; +import { + DormitoryDescriptionInput, + PriceInput, + CntInput, +} from 'components/atoms/CreateRecruit/Input'; +import {TextKRBold, TextKRReg} from 'themes/text'; +import MenuItem from 'components/atoms/CreateRecruit/MenuItem'; export interface RecruitItemProps { recruitId: number; image: string; @@ -265,23 +282,43 @@ const BoardItemDetail = props => { itemDetaildata?.host === true ? ( - {}} text="모집 취소" /> + { + cancelRecruit(); + }} + text="모집 취소" + /> - {}} text="모집 마감하기" /> + { + closeRecruit(); + }} + text="모집 마감하기" + /> ) : itemDetaildata?.participate ? ( - {}} text="모집 나가기" /> + { + cancelParticipate(); + }} + text="모집 나가기" + /> ) : ( - {}} text="모집 참여하기" /> + { + handleModal(); + }} + text="모집 참여하기" + /> ) ) : ( {}} text="마감된 모집글입니다" /> )} - {/* + { + keyboardVerticalOffset={-175}> { borderTopRightRadius: 10, paddingBottom: 30, }}> - + { error={errors} name="name" control={control} - setValue={setValue} + // setValue={setValue} rules={{}} /> @@ -410,7 +445,7 @@ const BoardItemDetail = props => { }}> 수량 { onPress={handleSubmit(onSubmit)} text={'모집참여 완료하기'}> - + - */} + ); };