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

[Fix][QA] 전역적으로 단순한 QA(0422) 처리 및 디버깅 #130

Merged
merged 6 commits into from
Apr 23, 2023
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 change: 0 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ export default function App() {
headerTransparent: true,
headerTitle: '',
headerLeft: () => <View></View>,
headerRight: () => <OnboardingIntroHeaderButton />,
headerStyle: {
backgroundColor: 'transparent',
},
Expand Down
7 changes: 0 additions & 7 deletions src/components/buttons/GoToUploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ const styles = StyleSheet.create({
backgroundColor: '#b0e817',
justifyContent: 'center',
alignItems: 'center',
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.25,
shadowRadius: 1.84,
elevation: 1,
},
});
2 changes: 1 addition & 1 deletion src/components/comments/CommentVerticalDots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const CommentVerticalDots = ({ userId, userName, commentId }: FeedVerticalDotsPr
</Pressable>
<BottomSheetModal
ref={modalRef}
snapPoints={['25%', '63%']}
snapPoints={isMyComment ? ['19%', '30%', '60%'] : ['26%', '64%', '67%']}
backdropComponent={renderBackdrop}
>
{isMyComment ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/comments/SheetOthersComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const SheetOthersComment = ({
<Text>기타 사유 신고</Text>
</Text>
</Pressable>
<Pressable onPress={handleReportSubmit} style={{ marginTop: 72 }}>
<Pressable onPress={handleReportSubmit} style={{ marginTop: 30 }}>
<ConditionalButton
isActive={selectedReport !== null}
// eslint-disable-next-line @typescript-eslint/no-empty-function
Expand Down
1 change: 0 additions & 1 deletion src/components/emoticons/ReactIconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ const styles = StyleSheet.create({
flexDirection: 'row',
borderRadius: 40,
marginRight: 8,
marginBottom: 12,
},
});

Expand Down
1 change: 0 additions & 1 deletion src/components/header/BottomSheetHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const styles = StyleSheet.create({
justifyContent: 'space-between',
paddingLeft: 12,
paddingBottom: 12,
paddingRight: 12,
},
text: {
fontSize: 16,
Expand Down
3 changes: 2 additions & 1 deletion src/components/modal/TwoButtonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ const styles = StyleSheet.create({
},
modalButtonGroup: {
flexDirection: 'row',
justifyContent: 'space-between',
justifyContent: 'center',
marginTop: 20,
},
modalButton: {
borderRadius: 12,
marginHorizontal: 4,
},
});
12 changes: 8 additions & 4 deletions src/screens/Feed/FeedBookMarkIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { Pressable, StyleSheet, Text, View } from 'react-native';
import { FontAwesome } from '@expo/vector-icons';
import { Pressable, StyleSheet, View } from 'react-native';
import React from 'react';
import { SvgXml } from 'react-native-svg';
import BookMarkOnXml from '../../constants/Icons/DetailedPost/BookMarkOnXml';
import BookMarkOffXml from '../../constants/Icons/DetailedPost/BookMarkOffXml';
import { useTheme } from 'react-native-paper';
interface FeedBookMarkIconProps {
onPress?: () => void;
isMarked?: boolean;
}

const FeedBookMarkIcon = ({ onPress, isMarked = false }: FeedBookMarkIconProps) => {
const theme = useTheme();
return (
<Pressable onPress={onPress}>
<View style={styles.circle}>
{isMarked ? (
<FontAwesome name="bookmark" size={20} color="black" />
<SvgXml xml={BookMarkOnXml} width={20} opacity={0.9} />
) : (
<FontAwesome name="bookmark-o" size={20} color="black" />
<SvgXml xml={BookMarkOffXml} width={20} opacity={0.3} />
)}
</View>
</Pressable>
Expand Down
1 change: 1 addition & 0 deletions src/screens/Feed/FeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import FeedTextContent from './FeedTextContent';
import { REACTIONS } from './constant';
import ReactIconButton from '../../components/emoticons/ReactIconButton';
import { useNavigation } from '@react-navigation/native';
import { InsightData } from '../../types/Feed/Feedinsights';
interface FeedItemProps {
insight: InsightData;
localId?: string;
Expand Down
28 changes: 18 additions & 10 deletions src/screens/Feed/FeedLinkCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { StyleSheet, Text, View } from 'react-native';
import React, { useEffect, useState } from 'react';
import React from 'react';
import { LinkPreview } from '@flyerhq/react-native-link-preview';
import FeedBookMarkIcon from './FeedBookMarkIcon';
import { Entypo } from '@expo/vector-icons';
import { useTheme } from 'react-native-paper';
interface FeedLinkCard {
text: string;
onBookmarkPress: () => void;
Expand All @@ -16,7 +17,7 @@ const FeedLinkWithBookMark = ({
...props
}: FeedLinkCard) => {
const styles = createStyles();

const theme = useTheme();
const handleOnPress = () => {
onBookmarkPress();
};
Expand All @@ -35,12 +36,18 @@ const FeedLinkWithBookMark = ({
return (
<View style={[styles.container]}>
<View>
<Text style={styles.title}>
<Text style={{ ...styles.title, color: `${theme.colors.graphic.black}80` }}>
{title ? title.slice(0, 20) + (title.length > 20 ? '...' : '') : 'No title'}
<Entypo name="chevron-right" size={12} color="#12131450" />
<Entypo
name="chevron-right"
size={12}
color={`${theme.colors.graphic.black}80`}
/>
</Text>

<Text style={styles.description}>{description}</Text>
<Text style={{ ...styles.description, color: `${theme.colors.graphic.black}80` }}>
{description}
</Text>
</View>
</View>
);
Expand Down Expand Up @@ -69,15 +76,16 @@ function createStyles() {
},
title: {
fontSize: 12,
fontFamily: 'pretendardSemiBold',
fontFamily: 'pretendard',
fontWeight: '500',
marginBottom: 2,
color: '#12131450',
lineHeight: 16,
},
description: {
fontFamily: 'pretendardSemiBold',
fontWeight: '500',
fontSize: 12,
color: '#12131450',
fontFamily: 'pretendard',
fontWeight: '500',
lineHeight: 16,
},
});

Expand Down
1 change: 1 addition & 0 deletions src/screens/Feed/FeedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { InView } from 'react-native-intersection-observer';
import FeedItem from './FeedItem';
import { ScrollView } from 'react-native-gesture-handler';
import { useGetUserId } from '../../utils/hooks/useGetUserId';
import { InsightData, InsightWriter } from '../../types/Feed/Feedinsights';

interface FeedListProps {
feedList: InfiniteData<InsightData[] | undefined> | undefined;
Expand Down
11 changes: 9 additions & 2 deletions src/screens/Feed/FeedTextContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@ const FeedTextContent = ({ contents, insightId, bookmark }: FeedTextContent) =>
<Text
style={[
theme.fonts.text.body1.regular,
{ paddingBottom: modifiedContents.length < 100 ? 20 : 4 },
{
paddingBottom: modifiedContents.length < 100 ? 20 : 4,
color: `${theme.colors.graphic.black}cc`,
},
]}
>
{modifiedContents}
{modifiedContents.length >= 99 ? (
<Text style={[theme.fonts.text.body1.regular, { color: '#12131450' }]}>... 더보기</Text>
<Text
style={[theme.fonts.text.body1.regular, { color: `${theme.colors.graphic.black}80` }]}
>
... 더보기
</Text>
) : null}
</Text>
</Pressable>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Feed/UserSpecificChallengeSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'space-between',
marginTop: 48,
marginBottom: 18,
marginBottom: 24,
paddingHorizontal: 8,
},
day: {
Expand Down
10 changes: 5 additions & 5 deletions src/screens/Main/mypage/InterestEditingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const InterestEditingScreen = ({ navigation, route }) => {

const handleCreateCategory = () =>
navigation.navigate('CategoryCreate', {
selectedCategory,
customCategory,
toScreen: 'InterestEditing',
});

Expand All @@ -47,18 +49,16 @@ const InterestEditingScreen = ({ navigation, route }) => {
if (selectedCategory.length < 1) setConditionalText('관심사를 선택하세요');
else if (selectedCategory.length > 5) setConditionalText('5개 이하로 선택하세요');
else setConditionalText('완료');
JSON.stringify(selectedCategory.sort()) === JSON.stringify(route.params.selectedCategory.sort())
? setBtnActive(false)
: setBtnActive(true);
}, [selectedCategory]);

useEffect(() => {
// eslint-disable-next-line no-prototype-builtins
if (!route.params.hasOwnProperty('customCategory')) return;
const { customCategory: paramCustomArr, selectedCategory: paramSelectedArr } = route.params;
if (customCategory) {
setCustomCategory([...paramCustomArr, ...customCategory]);
setSelectedCategory([...paramSelectedArr, ...selectedCategory].sort());
const newCustomArr = paramCustomArr.filter((i) => !customCategory.includes(i));
setCustomCategory([...newCustomArr, ...customCategory]);
setSelectedCategory(paramSelectedArr.sort());
} else {
setCustomCategory([]);
}
Expand Down
2 changes: 2 additions & 0 deletions src/screens/Main/mypage/IntroductionEditingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ const IntroductionEditingScreen = ({ navigation, route }) => {
const [image] = useState(route?.params?.image);
const [title] = useState(route?.params?.title);
const [selectedCategory] = useState(route?.params?.selectedCategory);
const [customCategory] = useState(route?.params?.customCategory);
const [userId] = useState(route?.params?.userId);
const handleComplete = () => {
navigation.navigate(route.params?.toScreen, {
nickname,
image,
title,
selectedCategory,
customCategory,
introduction: input,
userId,
});
Expand Down
73 changes: 38 additions & 35 deletions src/screens/Main/mypage/MyPageScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ const MyPageScreen = ({ navigation, route }) => {
}
const theme = useTheme();

useLayoutEffect(() => {
navigation.setOptions({
headerLeft: () => {
return (
<Pressable
style={{ marginHorizontal: 18 }}
onPress={() => navigation.navigate('Settings')}
>
<SvgXml xml={settingsIcon} />
</Pressable>
);
},
headerRight: () => {
return (
<Pressable style={{ marginHorizontal: 18 }} onPress={() => alert('more')}>
<SvgXml xml={threeDots} />
</Pressable>
);
},
});
}, []);

const [selectedCategory, setSelectedCategory] = useState<Record<string, string>[]>([]);
const [representativeTitleList, setRepresentativeTitleList] = useState<AchievedTitle[]>([]);
const [titleTotal, setTitleTotal] = useState<number>(0);
Expand Down Expand Up @@ -82,6 +60,29 @@ const MyPageScreen = ({ navigation, route }) => {
querySuccessError,
);

useLayoutEffect(() => {
navigation.setOptions({
headerTitle: profile?.data?.nickname ?? '',
headerLeft: () => {
return (
<Pressable
style={{ marginHorizontal: 18 }}
onPress={() => navigation.navigate('Settings')}
>
<SvgXml xml={settingsIcon} />
</Pressable>
);
},
headerRight: () => {
return (
<Pressable style={{ marginHorizontal: 18 }} onPress={() => alert('more')}>
<SvgXml xml={threeDots} />
</Pressable>
);
},
});
}, []);

const drawerId =
isUserFolderListLoading === true || userFolderList?.selectedTab?.id === 0
? ''
Expand Down Expand Up @@ -245,20 +246,22 @@ const MyPageScreen = ({ navigation, route }) => {
);
})}
</View>
<Pressable
onPress={() => navigation.navigate('Title', { userId })}
style={{ ...styles.viewAll, borderTopColor: `${theme.colors.graphic.black}1a` }}
>
<Text
style={{
...theme.fonts.text.body1.regular,
color: `${theme.colors.graphic.black}cc`,
}}
{titleTotal > 3 ? (
<Pressable
onPress={() => navigation.navigate('Title', { userId })}
style={{ ...styles.viewAll, borderTopColor: `${theme.colors.graphic.black}1a` }}
>
전체보기
</Text>
<Feather name="chevron-right" size={24} color={`${theme.colors.graphic.black}cc`} />
</Pressable>
<Text
style={{
...theme.fonts.text.body1.regular,
color: `${theme.colors.graphic.black}cc`,
}}
>
전체보기
</Text>
<Feather name="chevron-right" size={24} color={`${theme.colors.graphic.black}cc`} />
</Pressable>
) : null}
<DividerBar style={styles.divider} />
{userFolderList && (
<>
Expand Down
16 changes: 12 additions & 4 deletions src/screens/Main/mypage/NicknameEditingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import SmallTextInput from '../../../components/texts/SmallTextInput';

const NicknameEditingScreen = ({ navigation, route }) => {
const theme = useTheme();
const [errorMessage] = useState<string>('');
const [errorMessage, setErrorMessage] = useState<string>('');
const [input, setInput] = useState<string>('');
const [image] = useState(route?.params?.image);
const [title] = useState(route?.params?.title);
const [introduction] = useState(route?.params?.introduction);
const [selectedCategory] = useState(route?.params?.selectedCategory);
const [customCategory] = useState(route?.params?.customCategory);
const [userId] = useState(route?.params?.userId);
const [buttonOn, setButtonOn] = useState<boolean>(false);
useEffect(() => {
Expand All @@ -26,6 +27,7 @@ const NicknameEditingScreen = ({ navigation, route }) => {
image,
title,
selectedCategory,
customCategory,
introduction,
userId,
});
Expand All @@ -52,9 +54,15 @@ const NicknameEditingScreen = ({ navigation, route }) => {
}, [route.params]);

useEffect(() => {
if (input.length === 0 || input.length > 12) setButtonOn(false);
else if (route.params?.nickname === input) setButtonOn(false);
else setButtonOn(true);
if (input.length > 8) {
setButtonOn(false);
setErrorMessage('8자 이내로 입력하세요.');
} else {
setErrorMessage('');
if (input.length === 0) setButtonOn(false);
else if (route.params?.nickname === input) setButtonOn(false);
else setButtonOn(true);
}
}, [input]);

return (
Expand Down
1 change: 1 addition & 0 deletions src/screens/Main/mypage/ProfileEditScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const ProfileEditScreen = ({ navigation, route }) => {
title,
introduction,
selectedCategory,
customCategory,
userId,
toScreen: 'ProfileEdit',
};
Expand Down
Loading