Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/assets/icons/camera.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions src/screens/addTrip/AddTripCalendarScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,22 @@ const AddTripCalendarScreen: React.FC = () => {
</View>

{/* ==================== 날짜 등록 버튼 ==================== */}
<View className="absolute bottom-5 left-0 right-0 px-4 pb-10 pt-3">
<View className="absolute bottom-0 left-0 right-0 px-4 py-4 mb-4">
<View
className="h-[44px] w-[370px] rounded-[4px]"
className="h-[44px] w-full rounded-[4px]"
style={{
backgroundColor: COLORS.screenBackground,
shadowColor: '#000',
shadowOffset: { width: 1, height: 1 },
shadowOpacity: 0.1,
shadowRadius: 1,
elevation: 4,
shadowOffset: { width: 0, height: 0 },
shadowOpacity: 0.06,
shadowRadius: 6,
elevation: 2,
}}>
<TouchableOpacity
activeOpacity={0.8}
disabled={!isButtonEnabled}
onPress={() => navigation.navigate('WishlistScreen')}
className="h-[44px] w-[370px] items-center justify-center rounded-[4px]"
className="h-[44px] w-full items-center justify-center rounded-[4px]"
style={{
backgroundColor: isButtonEnabled ? COLORS.main : COLORS.buttonDisabledOverlay,
borderWidth: 1,
Expand All @@ -339,4 +339,4 @@ const AddTripCalendarScreen: React.FC = () => {
AddTripCalendarScreen.displayName = 'AddTripCalendarScreen';

export default AddTripCalendarScreen;
export { AddTripCalendarScreen };
export { AddTripCalendarScreen };
38 changes: 27 additions & 11 deletions src/screens/addTrip/AddTripScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, { useState } from 'react';
import { Image, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { Alert, Image, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useNavigation } from '@react-navigation/native';
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { launchImageLibrary } from 'react-native-image-picker';

import { TopBar } from '@/components';
import { COLORS } from '@/constants';
import type { RootStackParamList } from '@/navigation/types';
import {
CameraIcon,
RightArrowIcon,
Expand All @@ -17,29 +20,42 @@ type AddTripNavigation = NativeStackNavigationProp<RootStackParamList,'AddTripSc
const AddTripScreen: React.FC = () => {
const navigation = useNavigation<AddTripNavigation>();
const [tripName, setTripName] = useState('');
const [selectedImageUri, setSelectedImageUri] = useState<string | null>(null);

const handlePickTripImage = async () => {
const result = await launchImageLibrary({
mediaType: 'photo',
selectionLimit: 1,
quality: 0.9,
});

setSelectedImageUri(result.assets?.[0]?.uri ?? null);
};


return (
<SafeAreaView className="flex-1 bg-screenBackground" edges={['top']}>
<View className="flex-row items-center h-14 pl-6">
<TouchableOpacity onPress={() => navigation.goBack()}>
<BackArrow className='w-5 h-5'/>
</TouchableOpacity>
<Text numberOfLines={1} className="ml-4 text-h font-pretendardBold text-black">여행지 추가</Text>
</View>
<TopBar title="일정 추가" onPress={() => navigation.goBack()} />

<View className="flex-1 bg-screenBackground px-8">
<View className="flex-1 items-center pt-[140px]">
<View className="relative">
<Image
source={require('../../assets/images/thumnail3.png')}
source={
selectedImageUri
? { uri: selectedImageUri }
: require('../../assets/images/thumnail3.png')
}
className="h-[140px] w-[140px] rounded-[20px]"
resizeMode="cover"
/>

<TouchableOpacity
activeOpacity={0.8}
className="absolute bottom-2 right-2 h-[32px] w-[32px] items-center justify-center rounded-full">
<CameraIcon width={32} height={32}/>
onPress={handlePickTripImage}
className="absolute bottom-[6px] right-[6px] h-[32px] w-[32px] items-center justify-center rounded-full"
style={{ backgroundColor: '#251D18CC' }}>
<CameraIcon width={16} height={16}/>
</TouchableOpacity>
</View>

Expand Down Expand Up @@ -73,4 +89,4 @@ const AddTripScreen: React.FC = () => {
AddTripScreen.displayName = 'AddTripScreen';

export default AddTripScreen;
export { AddTripScreen };
export { AddTripScreen };