Skip to content

Commit ba22974

Browse files
authored
fix: upgrade flow for pro workspaces (#8766)
1 parent fc143b1 commit ba22974

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/app/src/app/components/WorkspaceSetup/steps/SpendingLimit.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ export const SpendingLimit: React.FC<StepProps> = ({
2323
const urlWorkspaceId = getQueryParam('workspace');
2424
const [error, setError] = React.useState<React.ReactNode>('');
2525
const { isPro } = useWorkspaceSubscription();
26+
const maxSpendingLimit = isPro ? 1000 : 100;
2627

2728
const handleChange = e => {
2829
setError('');
2930
const value = Number(e.target.value);
3031
if (Number.isNaN(value) || value < 0) {
31-
setError('Please enter a valid amount between 0 and 100');
32-
} else if (value > 100) {
32+
setError(`Please enter a valid amount between 0 and ${maxSpendingLimit}`);
33+
} else if (value > maxSpendingLimit) {
3334
setError(
3435
<>
35-
For the first two billing cycles, the maximum limit is $100. If you
36-
need a higher limit,{' '}
36+
For the first two billing cycles, the maximum limit is $
37+
{maxSpendingLimit}. If you need a higher limit,{' '}
3738
<Text as="a" href="mailto:[email protected]">
3839
contact us
3940
</Text>
@@ -95,7 +96,7 @@ export const SpendingLimit: React.FC<StepProps> = ({
9596
id="spending-limit"
9697
name="spending-limit"
9798
required
98-
max={100}
99+
max={maxSpendingLimit}
99100
min={0}
100101
defaultValue={checkout.spendingLimit}
101102
type="number"

packages/app/src/app/pages/Dashboard/Sidebar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export const Sidebar: React.FC<SidebarProps> = ({
158158
path={dashboardUrls.getStarted(activeTeam)}
159159
icon="documentation"
160160
/>
161-
{isFree && isTeamAdmin && (
161+
{isTeamAdmin && (
162162
<RowItem
163163
name="Upgrade"
164164
page="external"

0 commit comments

Comments
 (0)