From 9718fb788ea94f8b8c3acc40d2fa12fd9e880bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pasteau?= <4895034+ClementPasteau@users.noreply.github.com> Date: Mon, 27 Nov 2023 18:40:32 +0100 Subject: [PATCH] Better wording for Discord role perks (#5966) Do not show in changelog --- newIDE/app/src/Profile/EditProfileDialog.js | 2 +- newIDE/app/src/Profile/ProfileDetails.js | 17 +++++++++----- .../Subscription/SubscriptionPendingDialog.js | 7 +++++- .../SubscriptionPendingDialog.stories.js | 13 ++++++++++- .../ProfileDetails.stories.js | 23 +++++++++++++------ 5 files changed, 46 insertions(+), 16 deletions(-) diff --git a/newIDE/app/src/Profile/EditProfileDialog.js b/newIDE/app/src/Profile/EditProfileDialog.js index 96a8e9c739f4..9e3c21cd8304 100644 --- a/newIDE/app/src/Profile/EditProfileDialog.js +++ b/newIDE/app/src/Profile/EditProfileDialog.js @@ -312,7 +312,7 @@ const EditProfileDialog = ({ disabled={actionInProgress} maxLength={discordUsernameConfig.maxLength} helperMarkdownText={i18n._( - t`Add your Discord username to get access to a dedicated channel if you have a subscription! Join the [GDevelop Discord](https://discord.gg/gdevelop).` + t`Add your Discord username to get access to a dedicated channel if you have a Gold or Pro subscription! Join the [GDevelop Discord](https://discord.gg/gdevelop).` )} /> @@ -316,8 +322,7 @@ const ProfileDetails = ({ Discord username {isAuthenticatedUserProfile && - !!subscription && - !!subscription.planId && + hasGoldOrProSubscription && !!discordUsername && ( ) : ( {discordUsername} - {(!subscription || !subscription.planId) && ( + {!hasGoldOrProSubscription && ( <> {' - '} )} diff --git a/newIDE/app/src/Profile/Subscription/SubscriptionPendingDialog.js b/newIDE/app/src/Profile/Subscription/SubscriptionPendingDialog.js index 04b5ce557af5..709cc654fd4f 100644 --- a/newIDE/app/src/Profile/Subscription/SubscriptionPendingDialog.js +++ b/newIDE/app/src/Profile/Subscription/SubscriptionPendingDialog.js @@ -30,6 +30,11 @@ export default function SubscriptionPendingDialog({ !!authenticatedUser && !!authenticatedUser.subscription && !!authenticatedUser.subscription.planId; + const hasGoldOrStartupPlan = + !!authenticatedUser && + !!authenticatedUser.subscription && + (authenticatedUser.subscription.planId === 'gdevelop_gold' || + authenticatedUser.subscription.planId === 'gdevelop_startup'); useInterval( () => { authenticatedUser.onRefreshUserProfile().catch(() => { @@ -176,7 +181,7 @@ export default function SubscriptionPendingDialog({ - {!currentDiscordUsername && ( + {!currentDiscordUsername && !!hasGoldOrStartupPlan && ( ( +export const AuthenticatedUserWithSilverSubscriptionButWithoutDiscordUsername = () => ( onClose={action('on close')} /> ); + +export const AuthenticatedUserWithStartupSubscriptionButWithoutDiscordUsername = () => ( + +); diff --git a/newIDE/app/src/stories/componentStories/ProfileDetails.stories.js b/newIDE/app/src/stories/componentStories/ProfileDetails.stories.js index e95adedd1233..994e53cdd163 100644 --- a/newIDE/app/src/stories/componentStories/ProfileDetails.stories.js +++ b/newIDE/app/src/stories/componentStories/ProfileDetails.stories.js @@ -8,7 +8,8 @@ import paperDecorator from '../PaperDecorator'; import ProfileDetails from '../../Profile/ProfileDetails'; import { indieUserProfile, - subscriptionForBusinessUser, + subscriptionForStartupUser, + subscriptionForSilverUser, } from '../../fixtures/GDevelopServicesTestData'; import { type Profile } from '../../Utils/GDevelopServices/Authentication'; import { type PrivateAssetPackListingData } from '../../Utils/GDevelopServices/Shop'; @@ -54,16 +55,24 @@ const getAssetPacksListingData = ( }, ]; -export const MyCompleteProfileWithSubscription = () => ( +export const MyCompleteProfileWithoutSubscription = () => ( + +); + +export const MyCompleteProfileWithSilverSubscription = () => ( ); -export const MyCompleteProfileWithoutSubscription = () => ( - +export const MyCompleteProfileWithBusinessSubscription = () => ( + ); export const MyProfileWithoutDiscordUsernameNorSubscription = () => ( @@ -73,11 +82,11 @@ export const MyProfileWithoutDiscordUsernameNorSubscription = () => ( /> ); -export const MyProfileWithoutDiscordUsernameButWithSubscription = () => ( +export const MyProfileWithoutDiscordUsernameWithStartupSubscription = () => ( );