Skip to content

Commit 3e9d2f5

Browse files
committed
feat: update node modal
1 parent d521a02 commit 3e9d2f5

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/features/editor/Toolbar/index.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const Toolbar = () => {
5656
<JSONCrackLogo fontSize="0.8rem" hideLogo />
5757
</Flex>
5858
</StyledToolElement>
59-
6059
<Select
6160
defaultValue="json"
6261
size="xs"
@@ -71,19 +70,19 @@ export const Toolbar = () => {
7170
<FileMenu />
7271
<ViewMenu />
7372
<ToolsMenu />
74-
</Group>
75-
<Group gap="6" justify="right" w="100%" style={{ flexWrap: "nowrap" }}>
7673
<Button
77-
variant="gradient"
78-
gradient={{ from: "purple", to: "violet", deg: 45 }}
74+
color="teal"
7975
autoContrast
8076
size="compact-sm"
8177
fz="12"
8278
fw="600"
8379
onClick={() => setVisible("UpgradeModal", true)}
80+
leftSection={"⚡️"}
8481
>
85-
🔥 JSON Crack v2.0
82+
Try New Editor
8683
</Button>
84+
</Group>
85+
<Group gap="6" justify="right" w="100%" style={{ flexWrap: "nowrap" }}>
8786
<Link href="https://github.com/AykutSarac/jsoncrack.com" rel="noopener" target="_blank">
8887
<StyledToolElement title="GitHub">
8988
<FaGithub size="18" />

src/features/modals/NodeModal/index.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React from "react";
22
import type { ModalProps } from "@mantine/core";
3-
import { Modal, Stack, Text, ScrollArea, Button } from "@mantine/core";
3+
import { Modal, Stack, Text, ScrollArea } from "@mantine/core";
44
import { CodeHighlight } from "@mantine/code-highlight";
5-
import { event as gaEvent } from "nextjs-google-analytics";
6-
import { useModal } from "../../../store/useModal";
75
import useGraph from "../../editor/views/GraphView/stores/useGraph";
86

97
const dataToString = (data: any) => {
@@ -17,7 +15,6 @@ const dataToString = (data: any) => {
1715
};
1816

1917
export const NodeModal = ({ opened, onClose }: ModalProps) => {
20-
const setVisible = useModal(state => state.setVisible);
2118
const nodeData = useGraph(state => dataToString(state.selectedNode?.text));
2219
const path = useGraph(state => state.selectedNode?.path || "");
2320

@@ -32,14 +29,6 @@ export const NodeModal = ({ opened, onClose }: ModalProps) => {
3229
<CodeHighlight code={nodeData} miw={350} maw={600} language="json" withCopyButton />
3330
</ScrollArea.Autosize>
3431
</Stack>
35-
<Button
36-
onClick={() => {
37-
setVisible("UpgradeModal", true);
38-
gaEvent("click_node_edit");
39-
}}
40-
>
41-
Edit
42-
</Button>
4332
<Text fz="xs" fw={500}>
4433
JSON Path
4534
</Text>

0 commit comments

Comments
 (0)