-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54356 from DylanDylann/downgrade-feat
Downgrade Feature
- Loading branch information
Showing
17 changed files
with
310 additions
and
16 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
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
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
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,5 @@ | ||
type DowngradeToTeamParams = { | ||
policyID: string; | ||
}; | ||
|
||
export default DowngradeToTeamParams; |
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
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
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
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
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
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
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
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
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,28 @@ | ||
import React from 'react'; | ||
import ConfirmationPage from '@components/ConfirmationPage'; | ||
import {MushroomTopHat} from '@components/Icon/Illustrations'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import * as PolicyUtils from '@libs/PolicyUtils'; | ||
|
||
type Props = { | ||
onConfirmDowngrade: () => void; | ||
policyID: string; | ||
}; | ||
|
||
function DowngradeConfirmation({onConfirmDowngrade, policyID}: Props) { | ||
const {translate} = useLocalize(); | ||
const hasOtherControlWorkspaces = PolicyUtils.hasOtherControlWorkspaces(policyID); | ||
|
||
return ( | ||
<ConfirmationPage | ||
heading={translate('workspace.downgrade.completed.headline')} | ||
description={hasOtherControlWorkspaces ? translate('workspace.downgrade.completed.description') : undefined} | ||
illustration={MushroomTopHat} | ||
shouldShowButton | ||
onButtonPress={onConfirmDowngrade} | ||
buttonText={translate('workspace.downgrade.completed.gotIt')} | ||
/> | ||
); | ||
} | ||
|
||
export default DowngradeConfirmation; |
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,82 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import Button from '@components/Button'; | ||
import Icon from '@components/Icon'; | ||
import * as Illustrations from '@components/Icon/Illustrations'; | ||
import Text from '@components/Text'; | ||
import TextLink from '@components/TextLink'; | ||
import useEnvironment from '@hooks/useEnvironment'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import {openLink} from '@libs/actions/Link'; | ||
import CONST from '@src/CONST'; | ||
|
||
type Props = { | ||
buttonDisabled?: boolean; | ||
loading?: boolean; | ||
onDowngrade: () => void; | ||
}; | ||
|
||
function DowngradeIntro({onDowngrade, buttonDisabled, loading}: Props) { | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
const {environmentURL} = useEnvironment(); | ||
const {isExtraSmallScreenWidth} = useResponsiveLayout(); | ||
|
||
const benefits = [ | ||
translate('workspace.downgrade.commonFeatures.benefits.benefit1'), | ||
translate('workspace.downgrade.commonFeatures.benefits.benefit2'), | ||
translate('workspace.downgrade.commonFeatures.benefits.benefit3'), | ||
translate('workspace.downgrade.commonFeatures.benefits.benefit4'), | ||
]; | ||
|
||
return ( | ||
<View style={[styles.m5, styles.workspaceUpgradeIntroBox({isExtraSmallScreenWidth})]}> | ||
<View style={[styles.mb3]}> | ||
<Icon | ||
src={Illustrations.Mailbox} | ||
width={48} | ||
height={48} | ||
/> | ||
</View> | ||
<View style={styles.mb5}> | ||
<Text style={[styles.textHeadlineH1, styles.mb4]}>{translate('workspace.downgrade.commonFeatures.title')}</Text> | ||
<Text style={[styles.textNormal, styles.textSupporting, styles.mb4]}>{translate('workspace.downgrade.commonFeatures.note')}</Text> | ||
{benefits.map((benefit) => ( | ||
<View | ||
key={benefit} | ||
style={[styles.pl2, styles.flexRow]} | ||
> | ||
<Text style={[styles.textNormal, styles.textSupporting]}>• </Text> | ||
<Text style={[styles.textNormal, styles.textSupporting]}>{benefit}</Text> | ||
</View> | ||
))} | ||
<Text style={[styles.textNormal, styles.textSupporting, styles.mt4]}> | ||
{translate('workspace.downgrade.commonFeatures.benefits.note')}{' '} | ||
<TextLink | ||
style={[styles.link]} | ||
onPress={() => openLink(CONST.PLAN_TYPES_AND_PRICING_HELP_URL, environmentURL)} | ||
> | ||
{translate('workspace.downgrade.commonFeatures.benefits.pricingPage')} | ||
</TextLink> | ||
. | ||
</Text> | ||
<Text style={[styles.mv4]}> | ||
<Text style={[styles.textNormal, styles.textSupporting]}>{translate('workspace.downgrade.commonFeatures.benefits.confirm')}</Text>{' '} | ||
<Text style={[styles.textBold, styles.textSupporting]}>{translate('workspace.downgrade.commonFeatures.benefits.warning')}</Text> | ||
</Text> | ||
</View> | ||
<Button | ||
isLoading={loading} | ||
text={translate('common.downgradeWorkspace')} | ||
success | ||
onPress={onDowngrade} | ||
isDisabled={buttonDisabled} | ||
large | ||
/> | ||
</View> | ||
); | ||
} | ||
|
||
export default DowngradeIntro; |
Oops, something went wrong.