This commit is contained in:
Weixuan Fu
2024-03-02 22:21:18 +08:00
parent 91ab7423b7
commit e8199b8228
3 changed files with 20 additions and 37 deletions
+1
View File
@@ -227,6 +227,7 @@ export default function App() {
app.loadGraphData(JSON.parse(version.json));
} else {
setCurFlowIDAndName(flow);
setCurVersion(null);
app.loadGraphData(JSON.parse(flow.json));
}
setRoute("root");
+2 -1
View File
@@ -1,4 +1,5 @@
import {
Badge,
Button,
Flex,
HStack,
@@ -270,7 +271,7 @@ export default function ShareDialog({ onClose }: Props) {
}}
/>
<Flex color="green">
<Text>New version</Text>
<Badge colorScheme="purple">New version</Badge>
</Flex>
</HStack>
+17 -36
View File
@@ -1,9 +1,8 @@
import { Button, Link, HStack, IconButton } from "@chakra-ui/react";
import { IconCloud, IconCopy } from "@tabler/icons-react";
import { Button, DarkMode } from "@chakra-ui/react";
import { IconCloud } from "@tabler/icons-react";
import { workflowsTable } from "../db-tables/WorkspaceDB";
import { useContext, useEffect, useState } from "react";
import { WorkspaceContext } from "../WorkspaceContext";
import HoverMenu from "../components/HoverMenu";
import { WorkflowPrivacy } from "../types/dbTypes";
import { PrivacyLabel, fetchCloudWorkflowPrivacy } from "./shareUtils";
@@ -29,38 +28,20 @@ export function SharedTopbarButton({}) {
if (!cloudURL) return null;
return (
<>
<HoverMenu
menuButton={
<Button
onClick={() => {
window.open(cloudURL);
}}
variant={"ghost"}
aria-label={"Shared"}
size={"xs"}
iconSpacing={"2px"}
leftIcon={<IconCloud />}
height={"26px"}
px={1}
>
{privacy ? <PrivacyLabel privacy={privacy} /> : "Shared"}
</Button>
}
menuContent={
<HStack width={"200px"} p={1} color={"blue.400"}>
<Link href={cloudURL} noOfLines={1} isExternal>
{cloudURL.replace("https://www.", "")}
</Link>
<IconButton
size={"xs"}
variant={"ghost"}
icon={<IconCopy size={19} />}
aria-label="copy link"
></IconButton>
</HStack>
}
/>
</>
<a href={cloudURL} style={{ textDecoration: "none" }} target="_blank">
<DarkMode>
<Button
variant={"ghost"}
aria-label={"Shared"}
size={"xs"}
iconSpacing={"2px"}
leftIcon={<IconCloud />}
height={"26px"}
px={1}
>
{privacy ? <PrivacyLabel privacy={privacy} /> : "Shared"}
</Button>
</DarkMode>
</a>
);
}