-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat/#14 onboarding
- Loading branch information
Showing
34 changed files
with
872 additions
and
64 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
export const mainBlue = '#373772'; | ||
export const mainBlack = '#191919'; | ||
export const mainGray = '#7C7C7C'; | ||
export const mainLightBlue = '#F1F1F6'; | ||
export const mainOrange = '#FF5D53'; | ||
|
||
export const backgroundBlue = '#F1F1F6'; | ||
export const inactivateGray = '#D6D4D4'; |
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,56 @@ | ||
import React, { Dispatch, SetStateAction } from 'react'; | ||
import { Pressable, Text, View } from 'react-native'; | ||
import { checkList } from '../../types/checkListTypes'; | ||
import styles from './style'; | ||
|
||
interface IProps { | ||
mainQuestionItem: checkList; | ||
checkLists: checkList[]; | ||
setCheckLists: Dispatch<SetStateAction<checkList[]>>; | ||
} | ||
|
||
function ButtonsOfTypeA({ mainQuestionItem, setCheckLists, checkLists }: IProps) { | ||
return ( | ||
<> | ||
{mainQuestionItem.answer.ans.map((answer) => ( | ||
<Pressable | ||
onPress={() => | ||
setCheckLists( | ||
checkLists.map((questionItem) => | ||
questionItem.questionId === mainQuestionItem.questionId | ||
? ({ | ||
...questionItem, | ||
answer: { | ||
ans: [ | ||
...questionItem.answer.ans.map((answerItem) => | ||
answerItem.type === answer.type | ||
? { ...answerItem, val: true } | ||
: { ...answerItem, val: false } | ||
), | ||
], | ||
}, | ||
} as checkList) | ||
: ({ ...questionItem } as checkList) | ||
) | ||
) | ||
} | ||
style={ | ||
answer.val | ||
? answer.redType | ||
? [styles.typeABtnWrapper, styles.checkListFocusedOrange] | ||
: [styles.typeABtnWrapper, styles.checkListFocusedBlue] | ||
: [styles.typeABtnWrapper] | ||
} | ||
> | ||
<View> | ||
<Text style={answer.val ? styles.checkListWhiteText : styles.checkListGrayText}> | ||
{answer.type} | ||
</Text> | ||
</View> | ||
</Pressable> | ||
))} | ||
</> | ||
); | ||
} | ||
|
||
export default ButtonsOfTypeA; |
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,54 @@ | ||
import React, { Dispatch, SetStateAction } from 'react'; | ||
import { Pressable, Text, View } from 'react-native'; | ||
import { checkList } from '../../types/checkListTypes'; | ||
import styles from './style'; | ||
|
||
interface IProps { | ||
mainQuestionItem: checkList; | ||
checkLists: checkList[]; | ||
setCheckLists: Dispatch<SetStateAction<checkList[]>>; | ||
} | ||
|
||
function ButtonsOfTypeD({ mainQuestionItem, setCheckLists, checkLists }: IProps) { | ||
return ( | ||
<> | ||
{mainQuestionItem.answer.ans.map((answer) => ( | ||
<Pressable | ||
onPress={() => | ||
setCheckLists( | ||
checkLists.map((questionItem) => | ||
questionItem.questionId === mainQuestionItem.questionId | ||
? ({ | ||
...questionItem, | ||
answer: { | ||
ans: [ | ||
...questionItem.answer.ans.map((answerItem) => | ||
answerItem.type === answer.type | ||
? { ...answerItem, val: !answerItem.val } | ||
: { ...answerItem } | ||
), | ||
], | ||
}, | ||
} as checkList) | ||
: ({ ...questionItem } as checkList) | ||
) | ||
) | ||
} | ||
style={ | ||
answer.val | ||
? [styles.typeDBtnWrapper, styles.checkListFocusedBlue] | ||
: [styles.typeDBtnWrapper] | ||
} | ||
> | ||
<View> | ||
<Text style={answer.val ? styles.checkListWhiteText : styles.checkListGrayText}> | ||
{answer.type} | ||
</Text> | ||
</View> | ||
</Pressable> | ||
))} | ||
</> | ||
); | ||
} | ||
|
||
export default ButtonsOfTypeD; |
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,57 @@ | ||
import React, { Dispatch, SetStateAction } from 'react'; | ||
import { Text, View } from 'react-native'; | ||
import { checkList } from '../../types/checkListTypes'; | ||
import styles from './style'; | ||
import ButtonsOfTypeA from './ButtonsOfTypeA'; | ||
import ButtonsOfTypeD from './ButtonsOfTypeD'; | ||
|
||
interface IProps { | ||
checkLists: checkList[]; | ||
setCheckLists: Dispatch<SetStateAction<checkList[]>>; | ||
} | ||
|
||
function CheckListComponent({ checkLists, setCheckLists }: IProps) { | ||
return ( | ||
<> | ||
{checkLists.map((mainQuestionItem: checkList) => ( | ||
<View style={styles.whiteCard} key={mainQuestionItem.questionId}> | ||
<Text style={styles.checkListMainTitle}>{mainQuestionItem.question}</Text> | ||
<View style={styles.subTitles}> | ||
{mainQuestionItem.subCategory && ( | ||
<View style={styles.checkListSubTitle}> | ||
<Text style={styles.emoji}>📘 </Text> | ||
<Text style={styles.checkListGrayText}>{mainQuestionItem.subCategory}</Text> | ||
</View> | ||
)} | ||
{mainQuestionItem.description && ( | ||
<View style={styles.checkListSubTitle}> | ||
<Text style={styles.emoji}>👀 </Text> | ||
<Text style={styles.checkListGrayText}>{mainQuestionItem.description}</Text> | ||
</View> | ||
)} | ||
</View> | ||
<View style={styles.buttonsOfCheckList}> | ||
{mainQuestionItem.type === 'A' && ( | ||
<ButtonsOfTypeA | ||
mainQuestionItem={mainQuestionItem} | ||
setCheckLists={setCheckLists} | ||
checkLists={checkLists} | ||
/> | ||
)} | ||
{mainQuestionItem.type === 'B' && <Text>b</Text>} | ||
{mainQuestionItem.type === 'C' && <Text>c</Text>} | ||
{mainQuestionItem.type === 'D' && ( | ||
<ButtonsOfTypeD | ||
mainQuestionItem={mainQuestionItem} | ||
setCheckLists={setCheckLists} | ||
checkLists={checkLists} | ||
/> | ||
)} | ||
</View> | ||
</View> | ||
))} | ||
</> | ||
); | ||
} | ||
|
||
export default CheckListComponent; |
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,67 @@ | ||
import { StyleSheet } from 'react-native'; | ||
import { mainBlue, mainLightBlue, mainOrange } from '../../color'; | ||
|
||
const styles = StyleSheet.create({ | ||
checkListCards: { marginVertical: 30, marginHorizontal: 17 }, | ||
whiteCard: { | ||
backgroundColor: 'white', | ||
padding: 30, | ||
borderRadius: 14, | ||
marginVertical: 12, | ||
}, | ||
checkListMainTitle: { fontSize: 20 }, | ||
buttonsOfCheckList: { | ||
marginTop: 50, | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
}, | ||
buttonOfCheckList: { | ||
backgroundColor: mainLightBlue, | ||
borderRadius: 5, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}, | ||
|
||
subTitles: { marginTop: 19 }, | ||
checkListSubTitle: { flexDirection: 'row' }, | ||
checkListGrayText: { color: '#7C7C7C', lineHeight: 24 }, | ||
checkListWhiteText: { color: 'white', lineHeight: 24 }, | ||
typeABtnWrapper: { | ||
marginRight: 19, | ||
borderRadius: 4, | ||
width: 100, | ||
height: 44, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: mainLightBlue, | ||
}, | ||
checkListFocusedBlue: { backgroundColor: mainBlue }, | ||
checkListFocusedOrange: { backgroundColor: mainOrange }, | ||
|
||
rightArrowWrapper: { | ||
width: 55, | ||
height: 55, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: mainBlue, | ||
borderRadius: 55, | ||
position: 'absolute', | ||
right: 20, | ||
bottom: 50, | ||
}, | ||
|
||
emoji: { lineHeight: 24, fontSize: 12 }, | ||
|
||
typeDBtnWrapper: { | ||
flexDirection: 'row', | ||
margin: 5, | ||
borderRadius: 4, | ||
paddingHorizontal: 15, | ||
height: 44, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: mainLightBlue, | ||
}, | ||
}); | ||
|
||
export default styles; |
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
Oops, something went wrong.