Skip to content

Conversation

@BrianSammit
Copy link
Collaborator

@BrianSammit BrianSammit commented Sep 19, 2023

  • Add more steps to the survey according to mockups
  • Add a back button under the continue button
  • The back button only shows when there is a previous step
  • Request to save the survey should be sent at the end of it after the last step

I'm waiting for the back-end part #156 to test the proper save in the database

@BrianSammit BrianSammit self-assigned this Sep 19, 2023
@BrianSammit BrianSammit added this to the calmpal-release-4 milestone Sep 19, 2023
@BrianSammit BrianSammit changed the title cp-159: Add more steps to the survey#159 cp-159: Add more steps to the survey#159 Sep 19, 2023
OlesiaTr
OlesiaTr previously approved these changes Sep 20, 2023
void handleSubmit(handleSurveySubmit)();
}, [handleSubmit, handleSurveySubmit]);
const handleBack = (): void => {
navigation.navigate(SurveyScreenName.MEDITATION_EXPERIENCE);
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator

@v0ldemar01 v0ldemar01 left a 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: [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use camel case here

Comment on lines +4 to +9
[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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide more specific types

Copy link
Collaborator

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

Comment on lines 23 to 27
const [preferencesSurvey, setPreferencesSurvey] = useState([]);
const [feelingsSurvey, setFeelingsSurvey] = useState([]);
const [goalsSurvey, setGoalsSurvey] = useState([]);
const [worriesSurvey, setWorriesSurvey] = useState([]);
const [meditationSurvey, setMeditationSurvey] = useState([]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useAppForm instead

feelings: feelingsSurvey,
goals: goalsSurvey,
worries: worriesSurvey,
meditation_experience: meditationSurvey,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for camel case

Copy link
Collaborator

@iamAlinaaa iamAlinaaa left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

7 participants