diff --git a/src/viser/client/package.json b/src/viser/client/package.json index 3a1578f5d..532b45bdf 100644 --- a/src/viser/client/package.json +++ b/src/viser/client/package.json @@ -32,6 +32,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-error-boundary": "^4.0.10", + "react-qr-code": "^2.0.12", "react-redux": "^8.0.5", "react-router-dom": "^6.10.0", "redux": "^4.2.1", diff --git a/src/viser/client/src/App.tsx b/src/viser/client/src/App.tsx index 15db03318..5b2a19add 100644 --- a/src/viser/client/src/App.tsx +++ b/src/viser/client/src/App.tsx @@ -187,8 +187,7 @@ function ViewerContents() { smallerThan={"xs"} styles={{ right: 0, - bottom: - "4.5em" /* 4em to account for BottomPanel minimum height. */, + bottom: "3.5em" /* account for BottomPanel minimum height. */, }} > ({ - backgroundColor: + borderBottom: panelContext.expanded ? "1px solid" : undefined, + borderColor: theme.colorScheme == "dark" - ? theme.colors.dark[5] - : theme.colors.gray[1], + ? theme.colors.dark[4] + : theme.colors.gray[3], cursor: "pointer", position: "relative", fontWeight: 400, diff --git a/src/viser/client/src/ControlPanel/ControlPanel.tsx b/src/viser/client/src/ControlPanel/ControlPanel.tsx index 231828143..b444fc1a3 100644 --- a/src/viser/client/src/ControlPanel/ControlPanel.tsx +++ b/src/viser/client/src/ControlPanel/ControlPanel.tsx @@ -1,7 +1,8 @@ -import { useDisclosure, useMediaQuery } from "@mantine/hooks"; +import { useDisclosure, useMediaQuery, useToggle } from "@mantine/hooks"; import GeneratedGuiContainer from "./Generated"; import { ViewerContext } from "../App"; +import QRCode from "react-qr-code"; import ServerControls from "./ServerControls"; import { ActionIcon, @@ -28,6 +29,8 @@ import { IconCopy, IconCheck, IconPlugConnectedX, + IconQrcode, + IconQrcodeOff, } from "@tabler/icons-react"; import React from "react"; import BottomPanel from "./BottomPanel"; @@ -195,6 +198,8 @@ function ShareButton() { const [shareModalOpened, { open: openShareModal, close: closeShareModal }] = useDisclosure(false); + const [showQrCode, { toggle: toggleShowQrcode }] = useDisclosure(); + // Turn off loader when share URL is set. React.useEffect(() => { if (shareUrl !== null) { @@ -208,6 +213,7 @@ function ShareButton() { if (viewer.useGui((state) => state.theme).show_share_button === false) return null; + const theme = useMantineTheme(); return ( <> ) : ( <> - Share URL is connected: - + Share URL is connected. + {({ copied, copy }) => ( )} +