-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 리뷰 탭을 제거한다. * feat: 태그 스타일을 추가합니다. * refactor: 카테고리 스타일을 변경합니다. * feat: 리뷰 카테고리 선택화면을 추가합니다. * refactor: 주소에 맞게 페이지를 수정합니다.
- Loading branch information
Showing
27 changed files
with
383 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Feather } from '@expo/vector-icons'; | ||
import { Stack, useRouter } from 'expo-router'; | ||
import { Pressable } from 'react-native'; | ||
|
||
import { PROJECT_URLS, REVIEW_NAVIGATIONS } from '@/constants'; | ||
import { color } from '@/styles/theme'; | ||
|
||
function Layout() { | ||
const router = useRouter(); | ||
return ( | ||
<Stack | ||
screenOptions={() => ({ | ||
headerStyle: { height: 40, backgroundColor: color.Background.Normal }, | ||
headerTitleStyle: { | ||
paddingTop: 12, | ||
fontFamily: 'Pretendard-Bold', | ||
}, | ||
headerTitleAlign: 'center', | ||
headerShadowVisible: false, | ||
})}> | ||
<Stack.Screen | ||
name={REVIEW_NAVIGATIONS.CREATE} | ||
options={{ | ||
title: '나의 설문지', | ||
headerLeft: ({ canGoBack }) => ( | ||
<Pressable | ||
onPress={() => (canGoBack ? router.back() : router.push(PROJECT_URLS.PROJECT_HOME))}> | ||
<Feather | ||
name='chevron-left' | ||
size={24} | ||
/> | ||
</Pressable> | ||
), | ||
}} | ||
/> | ||
</Stack> | ||
); | ||
} | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import styled from '@emotion/native'; | ||
import { useCallback, useState } from 'react'; | ||
|
||
import SolidButton from '@/components/common/button/SolidButton'; | ||
import Typography from '@/components/common/typography'; | ||
import SelectCategoryChipList from '@/components/questionnaire/SelectCategoryChipList'; | ||
import { useTabBarEffect } from '@/hooks'; | ||
import { flexDirectionColumn } from '@/styles/common'; | ||
|
||
const MINIMUM_CATEGORY_COUNT = 5; | ||
|
||
function Review() { | ||
useTabBarEffect(); | ||
// const { id } = useLocalSearchParams<{ id: string }>(); | ||
|
||
const [error, setError] = useState<string | null>(null); | ||
const [selectedCategoryList, setSelectedCategoryList] = useState<string[]>([]); | ||
|
||
const addCategory = (category: string) => { | ||
if (error) { | ||
setError(null); | ||
} | ||
setSelectedCategoryList([...selectedCategoryList, category]); | ||
}; | ||
const removeCategory = (category: string) => | ||
setSelectedCategoryList(selectedCategoryList.filter((item) => item !== category)); | ||
|
||
const selectCategory = useCallback(() => { | ||
if (selectedCategoryList.length < MINIMUM_CATEGORY_COUNT) { | ||
setError('5개를 선택해주세요'); | ||
return; | ||
} | ||
setError(null); | ||
}, [selectedCategoryList]); | ||
|
||
return ( | ||
<S.Container> | ||
<S.WrapperBox> | ||
<S.ReviewTitle> | ||
<S.TitleText | ||
variant='Title3' | ||
fontWeight='bold'> | ||
받고 싶은 리뷰의{`\n`}카테고리 5개를 골라주세요 | ||
</S.TitleText> | ||
<S.SubTitleText | ||
variant='Label1/Normal' | ||
fontWeight='medium'> | ||
카테고리 별로 설문이 구성돼요 | ||
</S.SubTitleText> | ||
</S.ReviewTitle> | ||
|
||
<SelectCategoryChipList | ||
item={selectedCategoryList} | ||
addItem={addCategory} | ||
removeItem={removeCategory} | ||
error={error} | ||
/> | ||
</S.WrapperBox> | ||
|
||
<SolidButton | ||
onPress={selectCategory} | ||
full> | ||
다음 | ||
</SolidButton> | ||
</S.Container> | ||
); | ||
} | ||
|
||
const S = { | ||
Container: styled.SafeAreaView` | ||
flex: 1; | ||
gap: 32px; | ||
justify-content: space-between; | ||
padding: 33px 20px 52px; | ||
background: ${({ theme }) => theme.color.Background.Normal}; | ||
`, | ||
WrapperBox: styled.View` | ||
${flexDirectionColumn}; | ||
gap: 32px; | ||
`, | ||
ReviewTitle: styled.View` | ||
${flexDirectionColumn}; | ||
gap: 8px; | ||
`, | ||
TitleText: styled(Typography)` | ||
color: ${({ theme }) => theme.color.Label.Normal}; | ||
`, | ||
SubTitleText: styled(Typography)` | ||
color: ${({ theme }) => theme.color.Label.Alternative}; | ||
`, | ||
}; | ||
|
||
export default Review; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.