Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KAN-141] import 추가 및 최근검색 버튼 크기 조정 #50

Merged
merged 1 commit into from
Jun 1, 2024
Merged
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
1,081 changes: 554 additions & 527 deletions android/app/src/main/assets/index.android.bundle

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/screens/detail/ReviewWriteScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
TouchableWithoutFeedback,
Alert,
} from 'react-native';
import Toast from 'react-native-toast-message';
import {
COLOR_WHITE,
COLOR_BACKGROUND,
Expand Down
30 changes: 19 additions & 11 deletions src/screens/detail/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import {
COLOR_TEXT_BLACK,
COLOR_TEXT70GRAY,
COLOR_TEXT60GRAY,
COLOR_DISABLE_GRAY
COLOR_DISABLE_GRAY,
} from '../../assets/color';
import Toast from 'react-native-toast-message';
import AnimatedButton from '../../components/AnimationButton';
import Header from '../../components/Header';
import {useNavigation} from '@react-navigation/native';
Expand Down Expand Up @@ -121,10 +122,11 @@ export default function SearchScreen(props) {
<>
<Header title={'검색'} isBackButton={true} />
<View style={styles.entire}>
<View style={{
alignItems: 'center',
marginBottom: searchText.length == 0 ? 20: 0,
}}>
<View
style={{
alignItems: 'center',
marginBottom: searchText.length == 0 ? 20 : 0,
}}>
{/* 검색창 */}
<View
style={{
Expand Down Expand Up @@ -182,7 +184,7 @@ export default function SearchScreen(props) {
style={{
fontSize: 15,
color: COLOR_TEXT_BLACK,
fontFamily: 'NanumSquareRoundB'
fontFamily: 'NanumSquareRoundB',
}}>
최근 검색어
</Text>
Expand All @@ -196,7 +198,13 @@ export default function SearchScreen(props) {
}
}}
style={{marginLeft: 10}}>
<Text style={{fontSize: 12, color: COLOR_TEXT60GRAY, fontFamily: 'NanumSquareRoundB', marginBottom: 4}}>
<Text
style={{
fontSize: 12,
color: COLOR_TEXT60GRAY,
fontFamily: 'NanumSquareRoundB',
marginBottom: 4,
}}>
전체 삭제
</Text>
</AnimatedButton>
Expand Down Expand Up @@ -284,18 +292,18 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'center',
paddingHorizontal: 12,
paddingVertical: 7,
paddingVertical: 0,
borderRadius: 15,
backgroundColor: COLOR_WHITE,
borderColor: COLOR_PRIMARY,
borderWidth: 1,
height: 30,
height: 37,
},
recentText: {
fontSize: 13,
color: COLOR_TEXT_BLACK,
textAlign: 'center',
lineHeight: 16,
// lineHeight: 16,
fontFamily: 'NanumSquareRoundB',
},
searchArea: {
Expand Down Expand Up @@ -329,5 +337,5 @@ const styles = StyleSheet.create({
fontFamily: 'NanumSquareRoundEB',
textAlign: 'right',
marginBottom: 2.5,
}
},
});
108 changes: 69 additions & 39 deletions src/screens/detail/StoreDetailScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
Linking,
Alert,
} from 'react-native';
import Toast from 'react-native-toast-message';
import {
COLOR_WHITE,
COLOR_BACKGROUND,
Expand Down Expand Up @@ -134,18 +135,24 @@ export default function StoreDetailScreen(props) {
Linking.openURL(`tel:${phoneNumber}`);
};

const onCopy = (text) => {
const onCopy = text => {
Clipboard.setString(text);
Alert.alert('클립보드에 복사되었습니다.');
}
};

const handleReviewLikedState = async (review) => {
const handleReviewLikedState = async review => {
try {
const newReviewLikedState = !review.item.isLike;
const updatedReviewList = reviewList.map((item) =>
const updatedReviewList = reviewList.map(item =>
item.id === review.item.id
? { ...item, isLike: newReviewLikedState, likeCount: newReviewLikedState ? item.likeCount + 1 : item.likeCount - 1 }
: item
? {
...item,
isLike: newReviewLikedState,
likeCount: newReviewLikedState
? item.likeCount + 1
: item.likeCount - 1,
}
: item,
);
setReviewList(updatedReviewList);
const ret = await axios.post(
Expand All @@ -166,14 +173,18 @@ export default function StoreDetailScreen(props) {
text2: error.response.data.message,
});

const rollbackReviewList = reviewList.map((item) =>
const rollbackReviewList = reviewList.map(item =>
item.id === review.item.id
? { ...item, isLike: review.item.isLike, likeCount: review.item.likeCount }
: item
? {
...item,
isLike: review.item.isLike,
likeCount: review.item.likeCount,
}
: item,
);
setReviewList(rollbackReviewList);
}
}
};

const handleLoadMoreMenus = () => {
setMenuCount(menuCount + 4);
Expand All @@ -190,16 +201,22 @@ export default function StoreDetailScreen(props) {
const renderMenuItem = ({item}) => (
<>
<View key={item.name} style={styles.sectionItem}>
<View style={{
<View
style={{
position: 'absolute',
opacity: 1,
width: 90,
height: 90,
borderRadius: 12,
marginVertical: 12,
}}>
<SvgXml xml={svgXml.icon.noImage} width={90} height={90} style={{marginTop: 5}}/>
</View>
<SvgXml
xml={svgXml.icon.noImage}
width={90}
height={90}
style={{marginTop: 5}}
/>
</View>
<ImageModal
swipeToDismiss={true}
modalImageResizeMode="contain"
Expand All @@ -222,7 +239,7 @@ export default function StoreDetailScreen(props) {
const rating = item.rating;
const likeCount = item.likeCount;

console.log("review: ", item);
console.log('review: ', item);

const renderStars = () => {
const stars = [];
Expand Down Expand Up @@ -265,7 +282,15 @@ export default function StoreDetailScreen(props) {
<TouchableOpacity
style={styles.contactButton}
onPress={() => handleReviewLikedState({item})}>
<SvgXml xml={item.isLike ? svgXml.icon.thumbupOn : svgXml.icon.thumbupOff} width={20} height={20} />
<SvgXml
xml={
item.isLike
? svgXml.icon.thumbupOn
: svgXml.icon.thumbupOff
}
width={20}
height={20}
/>
</TouchableOpacity>
</View>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
Expand All @@ -274,7 +299,6 @@ export default function StoreDetailScreen(props) {
</View>
</View>
<View style={{flexDirection: 'row'}}>

{item.imageUrls.length > 0 ? (
<>
<Text style={styles.reviewText}>{item.content}</Text>
Expand All @@ -293,13 +317,12 @@ export default function StoreDetailScreen(props) {
)}
keyExtractor={(image, index) => `${item.id}-${index}`}
/>
</>
</>
) : (
<>
<Text style={styles.reviewText2}>{item.content}</Text>
</>
)}

</View>
</View>
</View>
Expand All @@ -312,24 +335,24 @@ export default function StoreDetailScreen(props) {
<>
<View style={styles.entire}>
<View style={styles.storeImageContainer}>
<ImageModal
swipeToDismiss={true}
modalImageResizeMode="contain"
// resizeMode="contain"
imageBackgroundColor="transparent"
overlayBackgroundColor="rgba(32, 32, 32, 0.9)"
source={{uri: restaurant.restaurant.representativeImageUrl}}
style={styles.storeImage}
/>
<View
style={{
position: 'absolute',
width: windowWidth,
height: 240,
backgroundColor: '#000000',
opacity: 0.4,
}}
/>
<ImageModal
swipeToDismiss={true}
modalImageResizeMode="contain"
// resizeMode="contain"
imageBackgroundColor="transparent"
overlayBackgroundColor="rgba(32, 32, 32, 0.9)"
source={{uri: restaurant.restaurant.representativeImageUrl}}
style={styles.storeImage}
/>
<View
style={{
position: 'absolute',
width: windowWidth,
height: 240,
backgroundColor: '#000000',
opacity: 0.4,
}}
/>
</View>
<View style={styles.storeInfo}>
<View style={styles.storeHeader}>
Expand Down Expand Up @@ -364,7 +387,8 @@ export default function StoreDetailScreen(props) {
<SvgXml xml={svgXml.icon.naver} width={15} height={15} />
</Text>
<Text style={styles.storeReviewNaver}>
리뷰 {restaurant.restaurant.naverReviewCount} {')'}</Text>
리뷰 {restaurant.restaurant.naverReviewCount} {')'}
</Text>
</View>
</View>
</View>
Expand Down Expand Up @@ -425,7 +449,10 @@ export default function StoreDetailScreen(props) {
<Text style={styles.storeAddress}>
위치: {restaurant.restaurant.detailInfo.address}
</Text>
<TouchableOpacity onPress={() => {onCopy(restaurant.restaurant.detailInfo.address)}}>
<TouchableOpacity
onPress={() => {
onCopy(restaurant.restaurant.detailInfo.address);
}}>
<Text style={styles.copyButtonText}>복사</Text>
</TouchableOpacity>
</View>
Expand All @@ -440,7 +467,10 @@ export default function StoreDetailScreen(props) {
<Text style={styles.storePhoneNum}>
전화번호: {restaurant.restaurant.detailInfo.contactNumber}
</Text>
<TouchableOpacity onPress={() => {onCopy(restaurant.restaurant.detailInfo.contactNumber)}}>
<TouchableOpacity
onPress={() => {
onCopy(restaurant.restaurant.detailInfo.contactNumber);
}}>
<Text style={styles.copyButtonText}>복사</Text>
</TouchableOpacity>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/screens/home/HomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
FlatList,
Pressable,
} from 'react-native';
import Toast from 'react-native-toast-message';
import {
COLOR_HOME_BACKGROUND,
COLOR_WHITE,
Expand Down
1 change: 1 addition & 0 deletions src/screens/list/ListMainScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
COLOR_TEXT70GRAY,
COLOR_HOME_BACKGROUND,
} from '../../assets/color';
import Toast from 'react-native-toast-message';
import AnimatedButton from '../../components/AnimationButton';
import {useNavigation} from '@react-navigation/native';
import Header from '../../components/Header';
Expand Down
1 change: 1 addition & 0 deletions src/screens/map/MapScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from '../../assets/color';
import AnimatedButton from '../../components/AnimationButton';
import Header from '../../components/Header';
import Toast from 'react-native-toast-message';
import {useNavigation} from '@react-navigation/native';
import MapView, {PROVIDER_GOOGLE, Marker} from 'react-native-maps';
import {Svg, SvgXml} from 'react-native-svg';
Expand Down
1 change: 1 addition & 0 deletions src/screens/mypage/MypageScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {useNavigation, useFocusEffect} from '@react-navigation/native';
import Header from '../../components/Header';
import {SvgXml} from 'react-native-svg';
import {svgXml} from '../../assets/svg';
import Toast from 'react-native-toast-message';
import {
COLOR_BACKGROUND,
COLOR_HOME_BACKGROUND,
Expand Down
1 change: 1 addition & 0 deletions src/screens/mypage/UserDataChangeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
TouchableOpacity,
Alert,
} from 'react-native';
import Toast from 'react-native-toast-message';
import {
COLOR_BACKGROUND,
COLOR_PRIMARY,
Expand Down
1 change: 1 addition & 0 deletions src/screens/signup/CheckEmailScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
COLOR_TEXT70GRAY,
COLOR_SECONDARY,
} from '../../assets/color';
import Toast from 'react-native-toast-message';
import AnimatedButton from '../../components/AnimationButton';
import {useNavigation} from '@react-navigation/native';
import {API_URL} from '@env';
Expand Down
1 change: 1 addition & 0 deletions src/screens/signup/CheckEmailScreen2.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Keyboard,
Pressable,
} from 'react-native';
import Toast from 'react-native-toast-message';
import {
COLOR_WHITE,
COLOR_BACKGROUND,
Expand Down
1 change: 1 addition & 0 deletions src/screens/signup/FindPasswordScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Keyboard,
Pressable,
} from 'react-native';
import Toast from 'react-native-toast-message';
import {
COLOR_WHITE,
COLOR_HOME_BACKGROUND,
Expand Down
1 change: 1 addition & 0 deletions src/screens/signup/LoginScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
COLOR_HOME_BACKGROUND,
} from '../../assets/color';
import AnimatedButton from '../../components/AnimationButton';
import Toast from 'react-native-toast-message';
import {useNavigation} from '@react-navigation/native';
import {API_URL} from '@env';
import axios from 'axios';
Expand Down
1 change: 1 addition & 0 deletions src/screens/signup/ProfileSetScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Pressable,
Image,
} from 'react-native';
import Toast from 'react-native-toast-message';
import {
COLOR_WHITE,
COLOR_HOME_BACKGROUND,
Expand Down
1 change: 1 addition & 0 deletions src/screens/signup/ResetPasswordScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
COLOR_TEXT70GRAY,
COLOR_SECONDARY,
} from '../../assets/color';
import Toast from 'react-native-toast-message';
import AnimatedButton from '../../components/AnimationButton';
import {useNavigation} from '@react-navigation/native';
import {API_URL} from '@env';
Expand Down
1 change: 1 addition & 0 deletions src/screens/signup/SplashScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import AnimatedButton from '../../components/AnimationButton';
import {useNavigation} from '@react-navigation/native';
import {API_URL} from '@env';
import Toast from 'react-native-toast-message';
import axios from 'axios';
import AsyncStorage from '@react-native-async-storage/async-storage';
import LongPrimaryButton from '../../components/LongPrimaryButton';
Expand Down
Loading