-
Notifications
You must be signed in to change notification settings - Fork 245
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
feat: notification modal opening logic #4132
feat: notification modal opening logic #4132
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
* Received gift plus modal | ||
*/ | ||
useEffect(() => { | ||
if (!alerts?.shouldShowGiftPlus || !user.isPlus) { |
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.
don't we use boot for this instead of alerts or just was not updated yet?
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 added it inside the alerts
object as we did for shouldShowFeedFeedback
https://github.com/dailydotdev/daily-api/blob/main/src/routes/boot.ts#L542
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.
you should use it directly on user
from useAuthContext
, it will be confusing to put something that is not an alert into alerts object, it can also create invalid gql calls to alerts update mutation (because that field does not exist there)
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.
my bad I completely missed you added it there in the API PR
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.
can you adjust that on API? @ilasw
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, so I've to add to the graphorm user object? @capJavert
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.
nvm added to user in boot
updateUserProfile({ | ||
flags: { showPlusGift: false }, | ||
}); |
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.
Do we have to wait for the user to close it before we turn off the flag?
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 don't think this is mandatory to wait plus don't return any promise.
But if you think is important I can change this behaviour 👀
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 it is more of how we should be doing it generally for our modals. Anyway, shouldn't be a blocker and we can likely keep it.
/> | ||
<PlusList className="overflow-clip !py-0" /> | ||
</div> | ||
<div className="flex flex-col gap-4 tablet:hidden"> |
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 we don't need this footer at all. We should just use the drawer's close button. The issue is, I don't think it should actually be called Cancel
. It should rather be called Close
.
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.
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 should probably check with design/product team.
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.
Updated ✔️
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.
Looks amazing! Don't have anything major going on except the Close button on mobile.
Co-authored-by: Lee Hansel Solevilla <[email protected]>
Co-authored-by: Lee Hansel Solevilla <[email protected]>
Co-authored-by: Lee Hansel Solevilla <[email protected]>
<Button | ||
type="button" | ||
onClick={onRequestClose} | ||
variant={ButtonVariant.Float} | ||
> | ||
Close | ||
</Button> |
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 should not need this close button after removing the props below:
apps/packages/shared/src/components/plus/GiftReceivedPlusModal.tsx
Lines 79 to 81 in f5333b9
drawerProps={{ | |
displayCloseButton: false, | |
}} |
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.
Just one last thing though everything looked amazing already, hence approving 🚀
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.
Code wise don't see anything blocking, nice work! Few comments for improvement.
packages/shared/src/lib/user.ts
Outdated
flags?: { | ||
showPlusGift?: boolean; | ||
}; |
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.
flags?: { | |
showPlusGift?: boolean; | |
}; | |
flags?: UserFlagsPublic; |
export type UserFlagsPublic = { | ||
showPlusGift: boolean; | ||
}; |
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.
export type UserFlagsPublic = { | |
showPlusGift: boolean; | |
}; | |
export type UserFlagsPublic = Partial<{ | |
showPlusGift: boolean; | |
}>; |
flags are always optional so I think we can jsut do this on the type
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.
then below Partial
can be removed
if (!gifter || isLoading) { | ||
return null; | ||
} |
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 add a modal like loader so user knows something is opening, see https://github.com/dailydotdev/apps/pull/4128/files#diff-ea1df30479911bb7e3f5fcb0727c06eac149de4aa7f08e1dae88b4ce5c217a9cR297-R303
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.
non blocking
@capJavert I've now applied the non-blocking changes 🙏 will merge soon 🙌 |
Thanks @sshanzel ! |
Changes
Requires dailydotdev/daily-api#2632
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
Preview domain
https://mi-753-fe-notification-modal-ope.preview.app.daily.dev