Skip to content

Commit

Permalink
Merge pull request #53255 from nkdengineer/fix/53247
Browse files Browse the repository at this point in the history
fix learn more link if no workspace
  • Loading branch information
mjasikowski authored Nov 28, 2024
2 parents c70b6c1 + 6ada95b commit 41f9122
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pages/workspace/upgrade/UpgradeIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ import * as Expensicon from '@components/Icon/Expensicons';
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 useSubscriptionPlan from '@hooks/useSubscriptionPlan';
import useThemeStyles from '@hooks/useThemeStyles';
import {openLink} from '@libs/actions/Link';
import Navigation from '@libs/Navigation/Navigation';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
Expand All @@ -28,6 +31,8 @@ function UpgradeIntro({feature, onUpgrade, buttonDisabled, loading, isCategorizi
const styles = useThemeStyles();
const {isExtraSmallScreenWidth} = useResponsiveLayout();
const {translate} = useLocalize();
const {environmentURL} = useEnvironment();
const subscriptionPlan = useSubscriptionPlan();

const isIllustration = feature.icon in Illustrations;
const iconSrc = isIllustration ? Illustrations[feature.icon as keyof typeof Illustrations] : Expensicon[feature.icon as keyof typeof Expensicon];
Expand Down Expand Up @@ -81,7 +86,13 @@ function UpgradeIntro({feature, onUpgrade, buttonDisabled, loading, isCategorizi
{translate('workspace.upgrade.note.upgradeWorkspace')}{' '}
<TextLink
style={[styles.link]}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION)}
onPress={() => {
if (!subscriptionPlan) {
openLink(CONST.PLAN_TYPES_AND_PRICING_HELP_URL, environmentURL);

Check failure on line 91 in src/pages/workspace/upgrade/UpgradeIntro.tsx

View workflow job for this annotation

GitHub Actions / typecheck / typecheck

Property 'PLAN_TYPES_AND_PRICING_HELP_URL' does not exist on type '{ readonly HEIC_SIGNATURES: readonly ["6674797068656963", "6674797068656978", "6674797068657631", "667479706d696631"]; readonly RECENT_WAYPOINTS_NUMBER: 20; readonly DEFAULT_DB_NAME: "OnyxDB"; ... 491 more ...; readonly HYBRID_APP: { ...; }; }'.

Check failure on line 91 in src/pages/workspace/upgrade/UpgradeIntro.tsx

View workflow job for this annotation

GitHub Actions / lint / ESLint check

Unsafe argument of type `any` assigned to a parameter of type `string`
return;
}
Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION);
}}
>
{translate('workspace.upgrade.note.learnMore')}
</TextLink>{' '}
Expand Down

0 comments on commit 41f9122

Please sign in to comment.