-
Notifications
You must be signed in to change notification settings - Fork 0
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
Folasade/imp 19 profile tab #31
Conversation
IMP-19 Profile Tab Queries
Description Build out the Profile/Settings tab with the following functionality:
Start by writing the queries for the three above and build out the screens/frontend after (I will add screenshots once Figma is updated!) Useful Links Related PRs |
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.
Nice!! Functionality is completely there!
83dd09a
to
0b9f7f5
Compare
* [feat] build base layout. * [feat] style component with hardcoded data. * [feat] conditional render case data; fix styling. * [feat] add navigation to CaseSummaryScreen page. * [feat] pass case data into case summary screen. * [style] section off information by type. * [style] continue styling to match figma. * [wip][feat] implement base external link component. * [feat] add routing to link within external browser. * [feat] add header component with impact fund logo to all Cases related screens. * [cleanup] final cleanup before PR. * [fix] fix rendering issue on the bottom of CaseSummaryScreen. * [feat] implement date format util. * [style] restyle sub text to better reflect figma designs. * [feat] build base layout. * [feat] style component with hardcoded data. * [feat] conditional render case data; fix styling. * [feat] add navigation to CaseSummaryScreen page. * [feat] pass case data into case summary screen. * [style] section off information by type. * [style] continue styling to match figma. * [wip][feat] implement base external link component. * [feat] add routing to link within external browser. * [feat] add header component with impact fund logo to all Cases related screens. * [cleanup] final cleanup before PR. * [fix] fix rendering issue on the bottom of CaseSummaryScreen. * [feat] implement date format util. * [style] restyle sub text to better reflect figma designs. * [style] change div dimensions to percentages/aspect ratios. * [style] implement global colors. * [style] final styling changes + shadows. * [fix] prevent eslint error. * [style] replace react icons with svgs. * [refactor] restructure image fetch from supabase storage; redo typing case-related data. * [wip] * [cleanup] minor query refactoring and style fixes. * [style] setup scroll view container for CaseScreen. * [cleanup] fix styling. yes
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.
SO GOOD SO CLEAN!! Let's just update anything that uses address to the different address fields instead of one full address!
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.
Small bugs :(( will do some exploring but besides that looks good!
<TouchableOpacity | ||
style={styles.button} | ||
onPress={() => { | ||
if (fullName) { |
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.
This if statement is reached every time because fullName
always has the user's name since we fetch it and set it at the start. I don't know how big of an issue it would be to run this query each time or if this would change with AuthContext
but if you think running the query each time is okay, let's remove the if-else and just run both every time since that is what it is currently doing. Context: tested by logging inside if statement and reached even when name was not changed.
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 think this is something that's probably best to fix after auth context is implemented as it will be easier/less power to check if the name changed at all. But I agree that it's not the best to query each time and I need to fix.
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.
Okay let's just address this when we implement Auth Context then
onPress={() => { | ||
if (fullName) { | ||
updateCurrUserName(fullName); | ||
router.push('/Profile/'); |
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.
Weird bug but whenever I click Update Name
, I am redirected to the Cases screen with all the Case Cards instead of the Profile screen. Tried changing to /Profile
but that did not do anything :(
<TouchableOpacity | ||
style={styles.button} | ||
onPress={() => { | ||
if (streetName && city && usState && zip) { |
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 comments as above for Edit Name!
@@ -1,3 +1,5 @@ | |||
import { User } from '../../types/types'; | |||
import supabaseAdmin from '../createAdminClient'; | |||
import supabase from '../createClient'; | |||
|
|||
export const signUpUser = async ( |
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.
Let's update the signUpUser
function to add address fields to the auth table rather than full address
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.
comments addressed: changed signupuser to full name and various address fields, router issue fixed, will focus on redundant querying after auth context implemented 💃
5a19d81
to
1e33bcd
Compare
What's new in this PR
Description
In the settings tab, a user can edit their name, address, and/or delete their account. Updated auth functions to not use public users table.
Screenshots
How to review
In order to review delete account, a review MUST ADD SUPABASE_SERVICE_KEY variable to .env file. Be sure to Not
name it NEXT_PUBLIC_SUPABASE_SERVICE_KEY. Service key can be obtained by going into impact fund's supabase settings.
To test edit name and edit address, a user can log into an account then change input forms to whatever new name/address is desired and click button. To see changes use the SQL editor in supabase to look at the auth.users table, specifically the raw_user_meta_data column.
To test delete account, make sure logged into non-essential dummy account, and click yes when prompted if wanted to delete account.
Next steps
Front end for this tab still needs to be done.
Relevant Links
Online sources
Related PRs
CC: @stephaniewong2