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

User Profile - Info From Redux State #39

Open
NirmalAgnihotri opened this issue May 8, 2023 · 0 comments
Open

User Profile - Info From Redux State #39

NirmalAgnihotri opened this issue May 8, 2023 · 0 comments
Assignees

Comments

@NirmalAgnihotri
Copy link
Collaborator

NirmalAgnihotri commented May 8, 2023

STEP 1: Info From Redux State
Get all user info - ex. First name, email, last name, etc... , from the Redux state using a selector instead of it just being hardcoded.
Example of selector:

const isLoggedIn = useAppSelector(selectLogin);
const isSubscribed = useAppSelector(selectSubscribe);

Bring in tier images and decide which one to display based off info in Redux state.
Add Type for user info, follow this link for example: https://github.com/TritonSE/SDCTA-Data-Visualization-Website/pull/37/files#diff-b420719a1fd281d562d81e8346abd281e82cafba1af2fa4c527d3e2d2b1b6850

STEP 2: Saving to Backend

When the user hits save, the edited info should be saved to the backend. Call this function in consumer.ts https://github.com/TritonSE/SDCTA-Data-Visualization-Website/blob/main/SDCTA/src/api/consumer.ts

However, this function must be called in a Saga because you want to update the User object you have saved in Redux state. Example of Saga https://github.com/TritonSE/SDCTA-Data-Visualization-Website/blob/auth-finalization/SDCTA/src/sagas/authSaga.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants