-
Notifications
You must be signed in to change notification settings - Fork 227
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: create TopReaderBadgeModal #3740
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
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.
Minor questions
packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx
Outdated
Show resolved
Hide resolved
Download badge | ||
</Button> | ||
|
||
{!isMobile && ( |
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.
Why do we need this specific condition, the modals have their generic use-case for mobile/desktop buttons already right?
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.
In the design, the close button is at the bottom. Usually they're a X button at the top right. And when it's on mobile, it already comes with close button on the drawer, so I need to hide it.
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 can set displayCloseButton: false
on drawerProps
and then always render this button instead.
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.
diff --git a/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx b/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx
index e535994f..578d9a7d 100644
--- a/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx
+++ b/packages/shared/src/components/modals/badges/TopReaderBadgeModal.tsx
@@ -86,6 +86,9 @@ const TopReaderBadgeModal = (
isDrawerOnMobile
onAfterClose={() => onAfterClose(topReaderBadge.keyword.value)}
onAfterOpen={() => onAfterOpen(topReaderBadge.keyword.value)}
+ drawerProps={{
+ displayCloseButton: false,
+ }}
>
<Modal.Body className="flex flex-col items-center justify-center gap-4 text-center">
<h1 className="font-bold typo-title1">
@@ -108,15 +111,13 @@ const TopReaderBadgeModal = (
Download badge
</Button>
- {!isMobile && (
- <Button
- className="w-full max-w-80"
- variant={ButtonVariant.Float}
- onClick={onRequestClose}
- >
- Close
- </Button>
- )}
+ <Button
+ className={classNames('w-full', !isMobile && 'max-w-80')}
+ variant={ButtonVariant.Float}
+ onClick={onRequestClose}
+ >
+ Close
+ </Button>
</Modal.Body>
</Modal>
);
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.
Yeah guess it's easier in case they change copy or something silly 🤪
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.
Changed to hide drawer button and use inline button instead.
Changes
Depends on dailydotdev/daily-api#2376
TODO:
Events
Did you introduce any new tracking events?
https://docs.google.com/spreadsheets/d/18Lv7zXges9QfVX5VYL1a-Hyl0e1sQ3sLr0OK8YZWKXI/edit?gid=1801144038#gid=1801144038
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
AS-662
Preview domain
https://as-662-top-reader-modal.preview.app.daily.dev