Skip to content

Commit 8366e24

Browse files
committed
chore: Better button colors, better upgrade request (#5302)
<img width="335" alt="image" src="https://github.com/user-attachments/assets/94d621c1-527a-4608-8529-53971af26b8c" /> <img width="321" alt="image" src="https://github.com/user-attachments/assets/fd232773-dad5-4fde-8748-1d13645a4adf" /> ## Description 1. What is this PR about (link the issue and add a short description) ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent e7f2c09 commit 8366e24

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

apps/builder/app/builder/features/topbar/domains.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ const DomainItem = ({
348348
<Button
349349
formAction={handleVerify}
350350
state={isCheckStateInProgress ? "pending" : undefined}
351-
color="primary"
351+
color="neutral"
352352
css={{ width: "100%", flexShrink: 0, mt: theme.spacing[3] }}
353353
>
354354
Check status
@@ -364,7 +364,7 @@ const DomainItem = ({
364364
<Button
365365
formAction={handleUpdateStatus}
366366
state={isCheckStateInProgress ? "pending" : undefined}
367-
color="primary"
367+
color="neutral"
368368
css={{ width: "100%", flexShrink: 0, mt: theme.spacing[3] }}
369369
>
370370
Check status
@@ -375,7 +375,7 @@ const DomainItem = ({
375375
<Button
376376
formAction={handleRemoveDomain}
377377
state={isRemoveInProgress ? "pending" : undefined}
378-
color="neutral"
378+
color="destructive"
379379
css={{ width: "100%", flexShrink: 0 }}
380380
>
381381
Remove domain

apps/builder/app/builder/features/topbar/entri.tsx

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import * as entri from "entrijs";
22
import { useEffect, useState } from "react";
33
import { useStore } from "@nanostores/react";
4-
import { globalCss, Button, Text, toast } from "@webstudio-is/design-system";
4+
import {
5+
globalCss,
6+
Button,
7+
Text,
8+
PanelBanner,
9+
Flex,
10+
Link,
11+
} from "@webstudio-is/design-system";
512
import { trpcClient } from "~/shared/trpc/trpc-client";
613
import { $userPlanFeatures } from "~/shared/nano-states";
714
import { extractCname } from "./cname";
15+
import { UploadIcon } from "@webstudio-is/icons";
816

917
// https://developers.entri.com/docs/install
1018
type DnsRecord = {
@@ -96,26 +104,42 @@ export const Entri = ({ domain, dnsRecords, onClose }: EntriProps) => {
96104
dnsRecords,
97105
onClose,
98106
});
107+
const [requestUpgrade, setRequestUpgrade] = useState(false);
99108
return (
100109
<>
101110
{error !== undefined && <Text color="destructive">{error}</Text>}
102111
<Button
103112
disabled={isOpen}
104-
color="neutral"
105-
css={{ width: "100%", flexShrink: 0 }}
113+
color="primary"
106114
type="button"
107115
onClick={() => {
108116
if (hasProPlan) {
109117
showDialog();
110118
} else {
111-
toast.error(
112-
"Please upgrade to the Pro plan or higher to use automatic domain configuration."
113-
);
119+
setRequestUpgrade(true);
114120
}
115121
}}
116122
>
117-
Configure automatically
123+
Setup automatically with Entri
118124
</Button>
125+
{requestUpgrade && (
126+
<PanelBanner>
127+
<Text>
128+
Please upgrade to the Pro plan or higher to use automatic domain
129+
configuration.
130+
</Text>
131+
<Flex align="center" gap={1}>
132+
<UploadIcon />
133+
<Link
134+
color="inherit"
135+
target="_blank"
136+
href="https://webstudio.is/pricing"
137+
>
138+
Upgrade to Pro
139+
</Link>
140+
</Flex>
141+
</PanelBanner>
142+
)}
119143
</>
120144
);
121145
};

0 commit comments

Comments
 (0)