11import React from "react" ;
2- import type { ModalProps } from "@mantine/core" ;
3- import { Button , Modal , FocusTrap , Image , Text , Group , Divider } from "@mantine/core" ;
2+ import Link from "next/link" ;
3+ import type { FlexProps , ModalProps } from "@mantine/core" ;
4+ import {
5+ Modal ,
6+ Text ,
7+ Flex ,
8+ List ,
9+ ThemeIcon ,
10+ Divider ,
11+ Button ,
12+ Group ,
13+ Anchor ,
14+ Image ,
15+ Box ,
16+ } from "@mantine/core" ;
417import Cookie from "js-cookie" ;
18+ import { LuCheck } from "react-icons/lu" ;
19+ import { Logo } from "src/features/editor/Toolbar/Logo" ;
520import useConfig from "src/store/useConfig" ;
621
7- export const UpgradeModal = ( { opened , onClose } : ModalProps ) => {
22+ export const UpgradeContent = ( props : FlexProps ) => {
823 const darkmodeEnabled = useConfig ( state => state . darkmodeEnabled ) ;
924
25+ return (
26+ < Flex direction = "column" gap = "0" { ...props } >
27+ < Flex gap = "xl" >
28+ < List
29+ icon = {
30+ < ThemeIcon color = "green" variant = "transparent" >
31+ < LuCheck />
32+ </ ThemeIcon >
33+ }
34+ >
35+ < List . Item > Load larger datasets (100x more)</ List . Item >
36+ < List . Item > See parent-child relationships</ List . Item >
37+ < List . Item > Modify data from diagrams</ List . Item >
38+ </ List >
39+ < List
40+ icon = {
41+ < ThemeIcon color = "green" variant = "transparent" >
42+ < LuCheck />
43+ </ ThemeIcon >
44+ }
45+ >
46+ < List . Item > Customization options</ List . Item >
47+ < List . Item > Improved UI & Tools </ List . Item >
48+ < List . Item >
49+ < Anchor
50+ href = "https://chromewebstore.google.com/detail/todiagram/gpcnkpjdmgihedngamkhendifclghjhn"
51+ rel = "noopener"
52+ target = "_blank"
53+ inherit
54+ >
55+ Chrome Extension
56+ </ Anchor >
57+ </ List . Item >
58+ </ List >
59+ </ Flex >
60+ < Box mt = "lg" >
61+ < Image
62+ src = { `/assets/diagram-${ darkmodeEnabled ? "dark" : "light" } .png` }
63+ alt = "diagram"
64+ mah = "120"
65+ fit = "cover"
66+ mx = "auto"
67+ width = "auto"
68+ style = { {
69+ filter : "drop-shadow(3px -3px 2px rgba(0, 0, 0, 0.2))" ,
70+ objectPosition : "top" ,
71+ } }
72+ />
73+ < Divider maw = "600" w = "100%" mb = "lg" />
74+ </ Box >
75+ </ Flex >
76+ ) ;
77+ } ;
78+
79+ export const UpgradeModal = ( { opened, onClose } : ModalProps ) => {
1080 const handleCloseModal = ( ) => {
1181 Cookie . set ( "upgrade_shown" , "true" , { expires : 3 } ) ;
1282 onClose ( ) ;
1383 } ;
1484
1585 return (
1686 < Modal
17- size = "500 "
87+ size = "auto "
1888 opened = { opened }
1989 onClose = { handleCloseModal }
2090 zIndex = { 1001 }
@@ -23,45 +93,29 @@ export const UpgradeModal = ({ opened, onClose }: ModalProps) => {
2393 overlayProps = { { blur : 2 } }
2494 withCloseButton = { false }
2595 closeOnClickOutside = { false }
96+ title = {
97+ < Flex align = "center" gap = "sm" >
98+ < Logo />
99+ < Text fz = "lg" fw = "600" >
100+ Upgrade to New Editor
101+ </ Text >
102+ </ Flex >
103+ }
26104 >
27- < FocusTrap . InitialFocus />
28- < Image
29- src = { `/assets/diagram-${ darkmodeEnabled ? "dark" : "light" } .png` }
30- alt = "diagram"
31- width = "auto"
32- style = { {
33- filter : "drop-shadow(4px -3px 3px rgba(0, 0, 0, 0.2))" ,
34- } }
35- />
36- < Divider mx = "-md" />
37- < Text ta = "center" fz = "md" mt = "lg" >
38- We've been working on something big -{ " " }
39- < Text component = "span" fw = "bold" inherit >
40- Ready to explore?
41- </ Text >
42- </ Text >
43- < Group mt = "md" justify = "space-between" >
44- < Button variant = "default" size = "md" onClick = { handleCloseModal } >
45- Not now
105+ < UpgradeContent />
106+ < Group justify = "space-between" >
107+ < Button onClick = { handleCloseModal } color = "gray" variant = "subtle" >
108+ Maybe later
46109 </ Button >
47- < Button
48- component = "a "
49- href = "https://todiagram.com/?utm_source=jsoncrack & utm_medium = upgrade_modal "
110+ < Link
111+ href = "https://todiagram.com/?utm_source=app & utm_medium = upgrade_modal "
112+ rel = "noopener "
50113 target = "_blank"
51- color = "green"
52- size = "md"
53- onClick = { handleCloseModal }
54- leftSection = {
55- < Image
56- src = "https://todiagram.com/logo.svg"
57- alt = "logo"
58- w = { 20 }
59- style = { { filter : "grayscale(1) brightness(0) invert(1)" } }
60- />
61- }
62114 >
63- Try ToDiagram!
64- </ Button >
115+ < Button onClick = { handleCloseModal } color = "gray" variant = "outline" >
116+ Try for Free →
117+ </ Button >
118+ </ Link >
65119 </ Group >
66120 </ Modal >
67121 ) ;
0 commit comments