-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new modal on Private Apps install (#33275)
* feat: new modal on Private Apps install * add more variations * Create eleven-rockets-hug.md
- Loading branch information
1 parent
8d83b1f
commit 3edd654
Showing
4 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@rocket.chat/meteor": feat | ||
"@rocket.chat/i18n": feat | ||
--- | ||
|
||
Added a new button and modal to the private apps screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...eor/client/views/marketplace/components/PrivateAppInstallModal/PrivateAppInstallModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Box, Button, Modal } from '@rocket.chat/fuselage'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { useExternalLink } from '../../../../hooks/useExternalLink'; | ||
import { useCheckoutUrl } from '../../../admin/subscription/hooks/useCheckoutUrl'; | ||
import { PRICING_LINK } from '../../../admin/subscription/utils/links'; | ||
|
||
type PrivateAppInstallModalProps = { | ||
onClose: () => void; | ||
onProceed: () => void; | ||
}; | ||
|
||
const PrivateAppInstallModal = ({ onClose, onProceed }: PrivateAppInstallModalProps) => { | ||
const { t } = useTranslation(); | ||
|
||
const openExternalLink = useExternalLink(); | ||
const manageSubscriptionUrl = useCheckoutUrl()({ target: 'new-departments-page', action: 'upgrade' }); | ||
|
||
const goToManageSubscriptionPage = (): void => { | ||
openExternalLink(manageSubscriptionUrl); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal> | ||
<Modal.Header> | ||
<Modal.HeaderText> | ||
<Modal.Title>{t('Private_app_install_modal_title')}</Modal.Title> | ||
</Modal.HeaderText> | ||
<Modal.Close onClick={onClose} /> | ||
</Modal.Header> | ||
|
||
<Modal.Content> | ||
<Box mbe={28}>{t('Private_app_install_modal_content')}</Box> | ||
{t('Upgrade_subscription_to_enable_private_apps')} | ||
</Modal.Content> | ||
|
||
<Modal.Footer justifyContent='space-between'> | ||
<Modal.FooterAnnotation> | ||
<a target='_blank' rel='noopener noreferrer' href={PRICING_LINK}> | ||
{t('Compare_plans')} | ||
</a> | ||
</Modal.FooterAnnotation> | ||
<Modal.FooterControllers> | ||
<Button onClick={onProceed}>{t('Upload_anyway')}</Button> | ||
<Button onClick={goToManageSubscriptionPage} primary> | ||
{t('Upgrade')} | ||
</Button> | ||
</Modal.FooterControllers> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default PrivateAppInstallModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters