Skip to content

Commit 7e0309d

Browse files
committed
fix(refactor)/#71: 파티 수정 화면 키보드 UI 개선
1 parent 725ff74 commit 7e0309d

1 file changed

Lines changed: 81 additions & 83 deletions

File tree

TinyBite/app/party/edit/[type].tsx

Lines changed: 81 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { useMutation } from "@tanstack/react-query";
1616
import { AxiosError } from "axios";
1717
import { router, useLocalSearchParams } from "expo-router";
1818
import { StatusBar } from "expo-status-bar";
19-
import { FlatList, ScrollView, StyleSheet, View } from "react-native";
19+
import { FlatList, StyleSheet, View } from "react-native";
2020
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
2121
import { SafeAreaView } from "react-native-safe-area-context";
2222
import Toast from "react-native-toast-message";
@@ -37,7 +37,7 @@ const PARTY_CONFIG = {
3737
},
3838
} as const;
3939

40-
export default function PartyCreateScreen() {
40+
export default function PartyEditScreen() {
4141
const { type } = useLocalSearchParams<{
4242
type: "DELIVERY" | "GROCERY" | "HOUSEHOLD";
4343
}>();
@@ -205,96 +205,95 @@ export default function PartyCreateScreen() {
205205
return (
206206
<>
207207
<StatusBar style="dark" />
208-
209208
<View style={styles.container}>
210209
<CreatePartyPageHeader title="파티 수정" />
211-
212-
<KeyboardAwareScrollView contentContainerStyle={{ flex: 1 }}>
213-
<ScrollView style={styles.contentContainer}>
214-
<SafeAreaView style={styles.contentInner} edges={["bottom"]}>
215-
<View style={styles.section}>
216-
<SubTitle subTitle="사진 등록" isPic />
217-
<View style={styles.photoContainer}>
218-
<AddPhotoButton />
219-
<FlatList
220-
data={photos}
221-
renderItem={renderItem}
222-
keyExtractor={(item) => item.id.toString()}
223-
horizontal={true}
224-
contentContainerStyle={{ gap: 8 }}
225-
/>
226-
</View>
227-
</View>
228-
229-
<View style={styles.section}>
230-
<SubTitle subTitle="파티 제목" caption="(메뉴명)" />
231-
<TextInputBox
232-
placeholder={config.titlePlaceholder}
233-
maxLength={30}
234-
onChangeText={setPartyTitle}
235-
value={title.value}
236-
isEditable={isAllEditable}
210+
<View style={{ flex: 1 }}>
211+
<KeyboardAwareScrollView
212+
contentContainerStyle={styles.contentContainer}
213+
bottomOffset={30}
214+
>
215+
<View style={styles.section}>
216+
<SubTitle subTitle="사진 등록" isPic />
217+
<View style={styles.photoContainer}>
218+
<AddPhotoButton />
219+
<FlatList
220+
data={photos}
221+
renderItem={renderItem}
222+
keyExtractor={(item) => item.id.toString()}
223+
horizontal={true}
224+
contentContainerStyle={{ gap: 8 }}
237225
/>
238226
</View>
227+
</View>
239228

240-
<View style={styles.section}>
241-
<SubTitle subTitle="예상 총 주문 금액" />
242-
<TextInputBox
243-
placeholder="0"
244-
isAmount
245-
onChangeText={setTotalAmount}
246-
value={totalPrice.value}
247-
isEditable={isAllEditable}
248-
/>
249-
</View>
229+
<View style={styles.section}>
230+
<SubTitle subTitle="파티 제목" caption="(메뉴명)" />
231+
<TextInputBox
232+
placeholder={config.titlePlaceholder}
233+
maxLength={30}
234+
onChangeText={setPartyTitle}
235+
value={title.value}
236+
isEditable={isAllEditable}
237+
/>
238+
</View>
250239

251-
<View style={styles.section}>
252-
<SubTitle subTitle="모집 인원" caption="(나 포함)" />
253-
<NumberOfPeopleBox isEditable={isAllEditable} />
254-
</View>
240+
<View style={styles.section}>
241+
<SubTitle subTitle="예상 총 주문 금액" />
242+
<TextInputBox
243+
placeholder="0"
244+
isAmount
245+
onChangeText={setTotalAmount}
246+
value={totalPrice.value}
247+
isEditable={isAllEditable}
248+
/>
249+
</View>
255250

256-
<View style={styles.section}>
257-
<SubTitle subTitle="수령 장소" />
258-
<TextInputBox
259-
iconType="location"
260-
placeholder="예) 역삼역 1번 출구"
261-
maxLength={30}
262-
onChangeText={setPickUpLocation}
263-
value={pickupLocation.place}
264-
isEditable={isAllEditable}
265-
/>
266-
</View>
251+
<View style={styles.section}>
252+
<SubTitle subTitle="모집 인원" caption="(나 포함)" />
253+
<NumberOfPeopleBox isEditable={isAllEditable} />
254+
</View>
255+
256+
<View style={styles.section}>
257+
<SubTitle subTitle="수령 장소" />
258+
<TextInputBox
259+
iconType="location"
260+
placeholder="예) 역삼역 1번 출구"
261+
maxLength={30}
262+
onChangeText={setPickUpLocation}
263+
value={pickupLocation.place}
264+
isEditable={isAllEditable}
265+
/>
266+
</View>
267+
268+
<View style={styles.section}>
269+
<SubTitle subTitle="상세 설명" />
270+
<TextInputBox
271+
placeholder="추가로 전달 할 내용이 있다면 적어주세요."
272+
maxLength={60}
273+
onChangeText={setDetailedDescription}
274+
value={description}
275+
/>
276+
</View>
267277

278+
{config.showProductLink && (
268279
<View style={styles.section}>
269-
<SubTitle subTitle="상세 설명" />
280+
<SubTitle subTitle="상품 링크" />
270281
<TextInputBox
271-
placeholder="추가로 전달 할 내용이 있다면 적어주세요."
272-
maxLength={60}
273-
onChangeText={setDetailedDescription}
274-
value={description}
282+
iconType="link"
283+
placeholder="구매할 상품의 URL을 입력하세요."
284+
onChangeText={setProductLink}
285+
value={productLink.value}
286+
isEditable={isAllEditable}
275287
/>
276288
</View>
277-
278-
{config.showProductLink && (
279-
<View style={styles.section}>
280-
<SubTitle subTitle="상품 링크" />
281-
<TextInputBox
282-
iconType="link"
283-
placeholder="구매할 상품의 URL을 입력하세요."
284-
onChangeText={setProductLink}
285-
value={productLink.value}
286-
isEditable={isAllEditable}
287-
/>
288-
</View>
289-
)}
290-
</SafeAreaView>
291-
</ScrollView>
292-
293-
<SafeAreaView style={styles.createButtonContainer} edges={["bottom"]}>
289+
)}
290+
</KeyboardAwareScrollView>
291+
<View style={styles.createButtonContainer}>
294292
<GlobalButton onClick={onClickEditParty} text="완료" />
295-
</SafeAreaView>
296-
</KeyboardAwareScrollView>
293+
</View>
294+
</View>
297295
</View>
296+
<SafeAreaView style={styles.safeAreaBottom} edges={["bottom"]} />
298297
</>
299298
);
300299
}
@@ -305,10 +304,6 @@ const styles = StyleSheet.create({
305304
backgroundColor: colors.background,
306305
},
307306
contentContainer: {
308-
flex: 1,
309-
},
310-
contentInner: {
311-
flex: 1,
312307
gap: 16,
313308
paddingVertical: 12,
314309
paddingHorizontal: 20,
@@ -324,11 +319,14 @@ const styles = StyleSheet.create({
324319
paddingTop: 12,
325320
paddingHorizontal: 20,
326321
paddingBottom: 17,
327-
backgroundColor: "#fff",
322+
backgroundColor: colors.white,
328323
shadowColor: "#000000",
329324
shadowOffset: { width: 0, height: 0 },
330325
shadowOpacity: 0.25,
331326
shadowRadius: 4,
332327
boxShadow: "0 0 4px 0 rgba(0, 0, 0, 0.25)",
333328
},
329+
safeAreaBottom: {
330+
backgroundColor: colors.white,
331+
},
334332
});

0 commit comments

Comments
 (0)