-
Notifications
You must be signed in to change notification settings - Fork 4
cp-159: Add more steps to the survey#159 #319
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
base: development
Are you sure you want to change the base?
Conversation
…age container style
| void handleSubmit(handleSurveySubmit)(); | ||
| }, [handleSubmit, handleSurveySubmit]); | ||
| const handleBack = (): void => { | ||
| navigation.navigate(SurveyScreenName.MEDITATION_EXPERIENCE); |
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.
Each step has lots of similarities with others, at least I can see only another navigation route is a difference. There's no reason to duplicate so much code, so I think you can create a wrapper, which will contain all this logic with parent route /survey, and then change only the questions according to the children route, like /survey/preferences-step
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.
I will check that the problem with the route approach is that React Native does not use a route as in React. React Native uses stacks. But you're right I will find a way to not use the same code in the steps.
v0ldemar01
left a comment
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.
Also please contact to Oscar to be in touch with current changes
| void dispatch( | ||
| authActions.createUserSurvey({ | ||
| userId: userId, | ||
| journaling_experience: [], |
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.
Use camel case here
| [SurveyScreenName.PREFERENCES]: undefined | object; | ||
| [SurveyScreenName.FEELINGS]: undefined | object; | ||
| [SurveyScreenName.GOALS]: undefined | object; | ||
| [SurveyScreenName.WORRIES]: undefined | object; | ||
| [SurveyScreenName.MEDITATION_EXPERIENCE]: undefined | object; | ||
| [SurveyScreenName.JOURNALING_EXPERIENCE]: undefined | object; |
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.
Provide more specific types
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.
Create a generic component for reusing, it is not a good practise of your approach
mobile/src/screens/survey/survey.tsx
Outdated
| const [preferencesSurvey, setPreferencesSurvey] = useState([]); | ||
| const [feelingsSurvey, setFeelingsSurvey] = useState([]); | ||
| const [goalsSurvey, setGoalsSurvey] = useState([]); | ||
| const [worriesSurvey, setWorriesSurvey] = useState([]); | ||
| const [meditationSurvey, setMeditationSurvey] = useState([]); |
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.
useAppForm instead
mobile/src/screens/survey/survey.tsx
Outdated
| feelings: feelingsSurvey, | ||
| goals: goalsSurvey, | ||
| worries: worriesSurvey, | ||
| meditation_experience: meditationSurvey, |
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.
Same for camel case
iamAlinaaa
left a comment
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.
We already have fonts in our mobile app, please add fonts everywhere where necessary
…m/BinaryStudioAcademy/bsa-2023-calmpal into task/cp-159-add-more-steps-survey
…bsa-2023-calmpal into task/cp-159-add-more-steps-survey
I'm waiting for the back-end part #156 to test the proper save in the database