-
Notifications
You must be signed in to change notification settings - Fork 0
bugFix #142
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
bugFix #142
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3989,13 +3989,21 @@ const ExerciseScreen = ({ navigation }: any) => { | |
| <View | ||
| style={[ | ||
| styles.monthDateBadge, | ||
| isSelected && styles.monthDateBadgeToday, | ||
| isSelected | ||
| ? styles.monthDateBadgeSelected | ||
| : isToday | ||
| ? styles.monthDateBadgeToday | ||
| : null, | ||
| ]} | ||
| > | ||
| <Text | ||
| style={[ | ||
| styles.monthDateText, | ||
| isSelected && styles.monthDateTextToday, | ||
| isSelected | ||
| ? styles.monthDateTextSelected | ||
| : isToday | ||
| ? styles.monthDateTextToday | ||
| : null, | ||
| !isCurrentMonth && styles.monthDateTextMuted, | ||
| ]} | ||
| > | ||
|
|
@@ -4106,15 +4114,15 @@ const ExerciseScreen = ({ navigation }: any) => { | |
| <View | ||
| style={[ | ||
| styles.calendarNumberInner, | ||
| isSelected && styles.calendarNumberSelected, | ||
| isToday && styles.calendarNumberToday, | ||
| isSelected && styles.calendarNumberSelected, | ||
| ]} | ||
| > | ||
| <Text | ||
| style={[ | ||
| styles.calendarNumberText, | ||
| isSelected && styles.calendarNumberSelectedText, | ||
| isToday && styles.calendarNumberTodayText, | ||
| isSelected && styles.calendarNumberSelectedText, | ||
| ]} | ||
| > | ||
| {label} | ||
|
|
@@ -5119,6 +5127,9 @@ const styles = StyleSheet.create({ | |
| justifyContent: "center", | ||
| alignItems: "center", | ||
| }, | ||
| monthDateBadgeSelected: { | ||
| backgroundColor: "#e3ff7c", | ||
| }, | ||
| monthDateBadgeToday: { | ||
| backgroundColor: "#ffffff", | ||
| }, | ||
|
|
@@ -5132,6 +5143,9 @@ const styles = StyleSheet.create({ | |
| monthDateTextToday: { | ||
| color: "#000", | ||
| }, | ||
| monthDateTextSelected: { | ||
| color: "#000", | ||
| }, | ||
| monthDateTextMuted: { | ||
| color: "#777777", | ||
| }, | ||
|
|
@@ -5161,10 +5175,11 @@ const styles = StyleSheet.create({ | |
| backgroundColor: "transparent", | ||
| }, | ||
| calendarNumberSelected: { | ||
| backgroundColor: "#ffffff", | ||
| backgroundColor: "#e3ff7c", | ||
| borderRadius: 14, | ||
| }, | ||
| calendarNumberToday: { | ||
| backgroundColor: "#e3ff7c", | ||
| backgroundColor: "#ffffff", | ||
| }, | ||
| calendarNumberText: { | ||
| fontSize: 16, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 코드 패치에서 몇 가지 주의할 점과 개선 사항이 있습니다.
이와 같은 사항들을 개선하면 코드의 가독성과 유지보수성이 향상될 것입니다. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| // src/screens/pay/PaymentSuccessScreen.tsx | ||
| import React, { useEffect, useState } from "react"; | ||
| import { View, Text, StyleSheet, TouchableOpacity, Alert } from "react-native"; | ||
| import { View, Text, StyleSheet, Alert } from "react-native"; | ||
| import { SafeAreaView } from "react-native-safe-area-context"; | ||
| import { Ionicons as Icon } from "@expo/vector-icons"; | ||
| import { LinearGradient } from "expo-linear-gradient"; | ||
| import { useNavigation } from "@react-navigation/native"; | ||
| import AsyncStorage from "@react-native-async-storage/async-storage"; | ||
| import { useRoute } from "@react-navigation/native"; | ||
| import { paymentAPI, authAPI } from "../../services"; | ||
| import { paymentAPI } from "../../services"; | ||
| import { CommonActions } from "@react-navigation/native"; | ||
|
|
||
| const PaymentSuccessScreen = () => { | ||
|
|
@@ -44,24 +44,19 @@ const PaymentSuccessScreen = () => { | |
| await AsyncStorage.removeItem("testMembershipType"); | ||
| console.log("✅ 로컬 PREMIUM 저장 완료"); | ||
|
|
||
| // 4. ✅ 로그아웃 처리 | ||
| await AsyncStorage.removeItem("accessToken"); | ||
| await AsyncStorage.removeItem("refreshToken"); | ||
| console.log("✅ 로그아웃 완료"); | ||
|
|
||
| // 5. 안내 메시지 + 로그인 화면으로 이동 | ||
| // 4. 안내 메시지 + 홈으로 이동 | ||
| Alert.alert( | ||
| "업그레이드 완료! 🎉", | ||
| "프리미엄 회원이 되셨습니다!\n더 나은 서비스를 위해 다시 로그인해주세요.", | ||
| "프리미엄 회원이 되셨습니다!\n모든 기능을 자유롭게 이용하세요!", | ||
| [ | ||
| { | ||
| text: "로그인하러 가기", | ||
| text: "홈으로 가기", | ||
| onPress: () => { | ||
| // ✅ 스택 초기화하고 Login으로 이동 | ||
| // ✅ 스택 초기화하고 Main(홈)으로 이동 | ||
| navigation.dispatch( | ||
| CommonActions.reset({ | ||
| index: 0, | ||
| routes: [{ name: "Login" }], | ||
| routes: [{ name: "Main" }], | ||
| }) | ||
| ); | ||
| }, | ||
|
|
@@ -91,22 +86,17 @@ const PaymentSuccessScreen = () => { | |
| await AsyncStorage.removeItem("testMembershipType"); | ||
| console.log("✅ 로컬 PREMIUM 저장 완료"); | ||
|
|
||
| // ✅ 로그아웃 | ||
| await AsyncStorage.removeItem("accessToken"); | ||
| await AsyncStorage.removeItem("refreshToken"); | ||
| console.log("✅ 로그아웃 완료"); | ||
|
|
||
| Alert.alert( | ||
| "업그레이드 완료! 🎉", | ||
| "프리미엄 회원이 되셨습니다!\n더 나은 서비스를 위해 다시 로그인해주세요.", | ||
| "프리미엄 회원이 되셨습니다!\n모든 기능을 자유롭게 이용하세요!", | ||
| [ | ||
| { | ||
| text: "로그인하러 가기", | ||
| text: "홈으로 가기", | ||
| onPress: () => { | ||
| navigation.dispatch( | ||
| CommonActions.reset({ | ||
| index: 0, | ||
| routes: [{ name: "Login" }], | ||
| routes: [{ name: "Main" }], | ||
| }) | ||
| ); | ||
| }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 코드 패치는 몇 가지 수정 사항을 포함하고 있으며, 그에 따른 리스크가 존재합니다. 몇 가지 주요 리뷰 포인트는 다음과 같습니다:
결론적으로, 이 패치는 일관성 및 보안상의 리스크를 가진 코드 변경을 포함하고 있으므로, 추가적인 검토와 수정이 필요합니다. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 패치는 스타일 적용 시 변경된 로직에 주의가 필요합니다.
조건부 스타일링: 기존 코드에서는
isToday와isSelected의 조합에 따라 여러 상태를 구별했습니다. 패치 후 코드는 이 로직을 간소화해 가독성을 높였지만, 상태에 대한 정보를 잃어버린 위험이 있습니다. 예를 들어,isToday가 true이면서isSelected가 false일 때의 스타일이 실제로 올바르게 적용되는지 확인할 필요가 있습니다.네이밍 일관성: CSS 스타일 이름이 비슷하여 혼동할 수 있습니다.
monthDateTextSelected와calendarNumberTextToday와 같은 이름은 직관적인 의미를 부여하기에 충분하지 않을 수 있으므로 재조정하는 것이 좋습니다.null 처리: 새로운 스타일 조건에서
null을 반환하는 대신 기본 값을 설정하는 것이 안전합니다. 이는 사고를 방지하고 기본 스타일을 항상 유지할 수 있도록 합니다.디자인 일관성:
borderRadius를 직접적으로 설정한 이유에 대한 문서화가 필요합니다. 이 변경이 다른 상태의 디자인에 영향을 미칠 수 있습니다. 디자인 가이드라인에 따라 설정되었는지 확인하세요.주석 및 문서화: 이후 개발자들이 이해하기 쉽도록 각 복잡한 스타일 정의에 대한 주석을 추가하는 것이 좋습니다.
결론적으로, 효율성을 높이기 위한 좋은 시도였지만, 유지보수성과 안정성을 향상시키기 위해 몇 가지 조정이 필요합니다.