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

feat: gift user modal #4091

Merged
merged 33 commits into from
Jan 24, 2025
Merged

feat: gift user modal #4091

merged 33 commits into from
Jan 24, 2025

Conversation

sshanzel
Copy link
Member

@sshanzel sshanzel commented Jan 21, 2025

Changes

  • Gift plus Modal.
  • Be able to search user to gift.
  • Modified some callbacks to make the mention to work with the gifting search.

Preview:
Note that I just opened it automatically on load just to try.

Screenshot 2025-01-22 at 6 13 49 PM

Screen.Recording.2025-01-22.at.6.02.08.PM.mov

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-751.preview.app.daily.dev

Copy link

vercel bot commented Jan 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview Jan 23, 2025 2:01pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
storybook ⬜️ Ignored (Inspect) Jan 23, 2025 2:01pm

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

You are doing the extra disabled (isPlus badge later?)

Only one minor thing on the label should come from paddle I think.

Comment on lines 182 to 189
<Typography
bold
className="rounded-10 bg-action-upvote-float px-2 py-1"
type={TypographyType.Caption1}
color={TypographyColor.StatusSuccess}
>
2 months free
</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

This should come from the data from Paddle no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Although the one-time payment details will be adjusted from a different task, I will now make this label be coming from the object by paddle so it won't be forgotten.

Do you know which property this will be contained from Paddle?

Copy link
Contributor

Choose a reason for hiding this comment

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

@sshanzel You can find a reference in PlusCard and PlusInfo components (look for "extraLabel"), maybe we could create an utility component for handling this kind of labels (not mandatory) 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think that would be amazing. Let me check if I can easily do that here.

@ilasw
Copy link
Contributor

ilasw commented Jan 22, 2025

Am I able to search for myself? I think that I should not be able to pick me 👀

@sshanzel
Copy link
Member Author

Am I able to search for myself? I think that I should not be able to pick me 👀

The search mutation was from mentioning a user, and from that mutation, yes, it will filter out the typing user.

});
const isVisible = !!users?.length && !!query?.length;
const onKeyDown = (e: React.KeyboardEvent) => {
const movement = ['ArrowUp', 'ArrowDown', 'Enter'];
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use KeyboardCommand and ArrowKey enums wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, right. Forgot they existed. Let me update it!

Copy link
Contributor

Choose a reason for hiding this comment

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

@sshanzel ping

Copy link
Member Author

Choose a reason for hiding this comment

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

Totally forgot about this 🤦

Copy link
Member Author

Choose a reason for hiding this comment

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

@ilasw should be available now 🚀

Copy link
Contributor

@AmarTrebinjac AmarTrebinjac left a comment

Choose a reason for hiding this comment

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

Not much to add other than what's already been said. Looks great to me!

We should focus on getting this one merged as a lot of pending PRs are waiting on it :D

};

interface GiftPlusModalProps extends ModalProps {
preSelected?: UserShortProfile;
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to capitalize the S

export function GiftPlusModal(props: ModalProps): ReactElement {
return (
<PaymentContextProvider>
<GiftPlusModalComponent {...props} />{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

The space probably not necessary here ? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep. I think it was linting that did this. I'll remove. Thank you!

Comment on lines 61 to 64
export function GiftPlusModalComponent({
preSelected,
...props
}: GiftPlusModalProps): ReactElement {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could to separate select from general component for:

  1. keep general modal clean
  2. reuse select with it's logic in plus page

What do you think?

Copy link
Member Author

@sshanzel sshanzel Jan 23, 2025

Choose a reason for hiding this comment

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

Definitely! I think on the Plus page task, we can tackle extracting this so that it would be easier to see who needs what in terms of the places that would render them. Wdyt?

Copy link
Contributor

@AmarTrebinjac AmarTrebinjac left a comment

Choose a reason for hiding this comment

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

lgtm! 🚢

return (
<Modal
{...props}
isOpen
Copy link
Contributor

Choose a reason for hiding this comment

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

is this prop needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, should be not since it is always going to be true. Let me clean it up.

@ilasw ilasw changed the base branch from main to MI-746-gifting-plus January 23, 2025 14:11
Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

Code wise looks good :)

{discountPlan.extraLabel}
</Typography>
<PlusPlanExtraLabel
color={PlusLabelColor.Help}
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess ideally it would come from paddle but it's ok for now.

@sshanzel sshanzel merged commit 82928d4 into MI-746-gifting-plus Jan 24, 2025
10 checks passed
@sshanzel sshanzel deleted the MI-751 branch January 24, 2025 08:20
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

Successfully merging this pull request may close these issues.

4 participants