-
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
Friends #48
base: main
Are you sure you want to change the base?
Friends #48
Conversation
Co-authored-by: Sophia Brent <sophiabrent@users.noreply.github.com>
Co-authored-by: Sophia Brent <sophiabrent@users.noreply.github.com>
…t-frontend into friends merge main
…t-frontend into friends merge friends
src/App.tsx
Outdated
@@ -89,6 +90,10 @@ const SocialScreenStack = () => { | |||
name={SocialRoute.NOTIFICATIONS} | |||
component={NotificationsScreen} | |||
/> | |||
<SocialStack.Screen | |||
name={SocialRoute.FRIEND_PROFILE} | |||
component={FriendProfileScreen} |
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.
ios/Podfile.lock
Outdated
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.
errr is there a reason why Podfile.lock
is changed? If there aren't any other dependencies being used, npm install
again and then cd ios; pod install
and hopefully all will be well :) also make sure your Cocoapods version is 1.12.0!
src/components/social/FriendCard.tsx
Outdated
source={ | ||
imgPath | ||
? { uri: `${imgPath}` } | ||
: require('@nightlight/assets/images/anon.png') |
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 start using initials instead of anon.png
(see UserCircle.tsx
)
let count = 0; | ||
res.notifications.forEach( | ||
(item: { data: { notificationType: string } }) => { | ||
if ( | ||
item.data.notificationType === 'friendRequest' || | ||
item.data.notificationType === 'groupInvite' | ||
) { | ||
count++; | ||
} | ||
} | ||
); | ||
setCounter(count); |
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.
Might be more efficient to use .filter()
then .length
:) You might also wanna consider defining an array of notification types to count [NotificationType.FriendRequest, NotificationType.GroupInvite]
, and simply check membership of each notification type using .includes()
.
a.data.notificationType === 'friendRequest' || | ||
a.data.notificationType === 'groupInvite' | ||
) { | ||
return -1; | ||
} else if ( | ||
b.data.notificationType === 'friendRequest' || | ||
b.data.notificationType === 'groupInvite' |
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.
Maybe consider using the membership check above?
…g always so refresh is available
…ipulating the user document 🤯
Pulling friends logic from backend, along with updated UI.
Should:
Still TODO: