Skip to content

Commit 9031d74

Browse files
committed
fix: enhance NotSupported component with upgraded UI and feature list
1 parent 73a51d3 commit 9031d74

2 files changed

Lines changed: 113 additions & 55 deletions

File tree

apps/www/src/features/Banner.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ const BANNER_LIST = [
1313
"Try ToDiagram for free, no sign-up required",
1414
"Edit data directly inside diagrams",
1515
"Explore larger datasets (up to 50 MB) easily",
16+
"Generate Mermaid flowcharts, modern and customizable",
1617
];
1718

18-
export const Banner = () => {
19-
const ROTATION_INTERVAL = 6000; // ms between label changes
20-
const FADE_DURATION = 500; // ms for fade transition
19+
const ROTATION_INTERVAL = 6000; // ms between label changes
20+
const FADE_DURATION = 500; // ms for fade transition
2121

22+
export const Banner = () => {
2223
const [index, setIndex] = useState(0);
2324
const [visible, setVisible] = useState(true);
2425
const [dismissed, setDismissed] = useSessionStorage({
Lines changed: 109 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import React from "react";
2-
import { Anchor, Button, Image, Overlay, Stack, Text } from "@mantine/core";
2+
import { Anchor, Badge, Button, Image, List, Overlay, Stack, Text, ThemeIcon } from "@mantine/core";
33
import styled, { keyframes } from "styled-components";
4+
import { LuCheck } from "react-icons/lu";
45
import useConfig from "../../../../store/useConfig";
6+
import useFile from "../../../../store/useFile";
57

68
const shineEffect = keyframes`
79
0% {
810
transform: translateX(-120%) rotate(25deg);
9-
opacity: 0.5;
11+
opacity: 0;
1012
}
11-
5% {
12-
opacity: 0.5;
13-
transform: translateX(-80%) rotate(25deg);
13+
10% {
14+
opacity: 0.6;
1415
}
15-
70% {
16+
60% {
1617
transform: translateX(80%) rotate(25deg);
17-
opacity: 0.5;
18+
opacity: 0.6;
1819
}
19-
80% {
20+
70% {
2021
transform: translateX(120%) rotate(25deg);
2122
opacity: 0;
2223
}
@@ -26,12 +27,47 @@ const shineEffect = keyframes`
2627
}
2728
`;
2829

30+
const fadeIn = keyframes`
31+
from {
32+
opacity: 0;
33+
transform: translateY(12px);
34+
}
35+
to {
36+
opacity: 1;
37+
transform: translateY(0);
38+
}
39+
`;
40+
41+
const CardWrapper = styled.div`
42+
background: rgba(255, 255, 255, 0.95);
43+
border-radius: 16px;
44+
padding: 40px 48px;
45+
box-shadow:
46+
0 20px 60px rgba(0, 0, 0, 0.12),
47+
0 1px 3px rgba(0, 0, 0, 0.08);
48+
backdrop-filter: blur(12px);
49+
max-width: 460px;
50+
width: 90%;
51+
animation: ${fadeIn} 0.4s ease-out;
52+
position: relative;
53+
overflow: hidden;
54+
z-index: 10;
55+
56+
&[data-dark="true"] {
57+
background: rgba(37, 38, 43, 0.95);
58+
box-shadow:
59+
0 20px 60px rgba(0, 0, 0, 0.4),
60+
0 1px 3px rgba(0, 0, 0, 0.2);
61+
}
62+
`;
63+
2964
const ShiningButton = styled.div`
3065
position: relative;
3166
overflow: hidden;
3267
display: inline-block;
33-
border-radius: 0.5rem;
68+
border-radius: 8px;
3469
z-index: 10;
70+
width: 100%;
3571
3672
&::before {
3773
content: "";
@@ -44,63 +80,84 @@ const ShiningButton = styled.div`
4480
to right,
4581
rgba(255, 255, 255, 0) 0%,
4682
rgba(255, 255, 255, 0) 35%,
47-
rgba(255, 255, 255, 0.5) 50%,
83+
rgba(255, 255, 255, 0.4) 50%,
4884
rgba(255, 255, 255, 0) 65%,
4985
rgba(255, 255, 255, 0) 100%
5086
);
5187
transform: translateX(-120%) rotate(25deg);
5288
z-index: 20;
5389
pointer-events: none;
54-
animation: ${shineEffect} 4s ease-out infinite;
55-
transition: transform 0.2s ease-out;
90+
animation: ${shineEffect} 5s ease-out infinite;
5691
}
5792
`;
5893

94+
const FEATURES = [
95+
"Unlimited diagram size",
96+
"Compare data side by side",
97+
"Edit data directly on graph",
98+
"AI-powered data filter",
99+
];
100+
59101
export const NotSupported = () => {
60102
const darkmodeEnabled = useConfig(state => state.darkmodeEnabled);
103+
const format = useFile(state => state.format);
61104

62105
return (
63-
<Overlay
64-
backgroundOpacity={0.8}
65-
color={darkmodeEnabled ? "gray" : "rgb(226, 240, 243)"}
66-
blur="1.5"
67-
center
68-
>
69-
<Stack maw="60%" align="center" justify="center" gap="sm">
70-
<Image src="https://todiagram.com/logo.svg" alt="Unsupported" w={72} h={72} />
71-
<Text fz="48" fw={600} c="bright">
72-
Time to upgrade!
73-
</Text>
74-
<Text ta="center" size="lg" fw={500} c="gray" maw="600">
75-
This diagram is too large and not supported at JSON Crack.
76-
<br />
77-
Try{" "}
78-
<Anchor
79-
inherit
80-
c="teal"
81-
fw="500"
82-
href="https://todiagram.com/editor?utm_source=jsoncrack&utm_medium=data_limit"
83-
target="_blank"
84-
rel="noopener"
85-
>
86-
ToDiagram
87-
</Anchor>{" "}
88-
for larger diagrams and more features.
89-
</Text>
90-
<ShiningButton style={{ marginTop: "16px", position: "relative" }}>
91-
<Button
92-
component="a"
93-
href="https://todiagram.com/editor?utm_source=jsoncrack&utm_medium=data_limit"
94-
rel="noopener"
95-
size="lg"
96-
w="200"
97-
target="_blank"
98-
color="teal"
106+
<Overlay backgroundOpacity={0.6} color={darkmodeEnabled ? "#111" : "#e2f0f3"} blur="3" center>
107+
<CardWrapper data-dark={darkmodeEnabled}>
108+
<Stack align="center" gap="md">
109+
<Image src="https://todiagram.com/logo.svg" alt="ToDiagram" w={48} h={48} />
110+
<Badge variant="light" color="teal" size="sm" radius="sm">
111+
Upgrade Required
112+
</Badge>
113+
<Text fz="24" fw={700} c={darkmodeEnabled ? "white" : "dark"} ta="center" lh={1.2}>
114+
Your diagram is too large
115+
</Text>
116+
<Text ta="center" size="sm" c="dimmed" maw="360" lh={1.5}>
117+
JSON Crack can&apos;t render this file.{" "}
118+
<Anchor
119+
inherit
120+
c="teal"
121+
fw={500}
122+
href="https://todiagram.com/editor?utm_source=jsoncrack&utm_medium=data_limit"
123+
target="_blank"
124+
rel="noopener"
125+
>
126+
ToDiagram
127+
</Anchor>{" "}
128+
handles large datasets with ease.
129+
</Text>
130+
<List
131+
spacing="xs"
132+
size="sm"
133+
w="100%"
134+
c={darkmodeEnabled ? "gray.4" : "dark.6"}
135+
icon={
136+
<ThemeIcon color="teal" size={20} radius="xl" variant="light">
137+
<LuCheck size={12} />
138+
</ThemeIcon>
139+
}
99140
>
100-
Try now &rarr;
101-
</Button>
102-
</ShiningButton>
103-
</Stack>
141+
{FEATURES.map(feature => (
142+
<List.Item key={feature}>{feature}</List.Item>
143+
))}
144+
</List>
145+
<ShiningButton>
146+
<Button
147+
component="a"
148+
href={`https://todiagram.com/editor?utm_source=jsoncrack&utm_medium=data_limit&modal=upgrade&format=${format}&example=true`}
149+
rel="noopener"
150+
size="md"
151+
fullWidth
152+
target="_blank"
153+
color="teal"
154+
radius="md"
155+
>
156+
Continue with ToDiagram &rarr;
157+
</Button>
158+
</ShiningButton>
159+
</Stack>
160+
</CardWrapper>
104161
</Overlay>
105162
);
106163
};

0 commit comments

Comments
 (0)