From 59c1bd992c8711e5c2fb7da4e70a986575ea0090 Mon Sep 17 00:00:00 2001 From: Grant Date: Wed, 14 Feb 2024 00:49:34 -0700 Subject: [PATCH] add nextui --- .../client-next/src/components/CanvasMeta.tsx | 62 +++++++++++++++++++ .../client-next/src/components/Header.tsx | 2 +- .../client-next/src/components/Pallete.tsx | 23 +------ packages/client-next/src/style.scss | 8 +-- packages/client-next/tailwind.config.js | 1 + 5 files changed, 68 insertions(+), 28 deletions(-) create mode 100644 packages/client-next/src/components/CanvasMeta.tsx diff --git a/packages/client-next/src/components/CanvasMeta.tsx b/packages/client-next/src/components/CanvasMeta.tsx new file mode 100644 index 0000000..8be4e9f --- /dev/null +++ b/packages/client-next/src/components/CanvasMeta.tsx @@ -0,0 +1,62 @@ +import { + Modal, + ModalBody, + ModalContent, + ModalHeader, + useDisclosure, +} from "@nextui-org/react"; +import { useAppContext } from "../contexts/AppContext"; + +export const CanvasMeta = () => { + const { canvasPosition } = useAppContext(); + const { isOpen, onOpen, onOpenChange } = useDisclosure(); + + return ( + <> +
+ {canvasPosition && ( + + + + )} + + Pixels: 123 + + + Users Online: 321 + +
+ + + ); +}; + +const ShareModal = ({ + isOpen, + onOpenChange, +}: { + isOpen: boolean; + onOpenChange: () => void; +}) => { + return ( + + + {() => ( + <> + + share modal + + +

share the current zoom level & position as a url

+

+ params would be not a hash so the server can generate an oembed +

+
+ + )} +
+
+ ); +}; diff --git a/packages/client-next/src/components/Header.tsx b/packages/client-next/src/components/Header.tsx index 92d7f89..fdfa58b 100644 --- a/packages/client-next/src/components/Header.tsx +++ b/packages/client-next/src/components/Header.tsx @@ -2,7 +2,7 @@ import React from "react"; export const Header = () => { return ( -
+
diff --git a/packages/client-next/src/components/Pallete.tsx b/packages/client-next/src/components/Pallete.tsx index 89e0725..d068ae5 100644 --- a/packages/client-next/src/components/Pallete.tsx +++ b/packages/client-next/src/components/Pallete.tsx @@ -4,6 +4,7 @@ import { Canvas } from "../lib/canvas"; import { IPalleteContext } from "../types"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faXmark } from "@fortawesome/free-solid-svg-icons"; +import { CanvasMeta } from "./CanvasMeta"; export const Pallete = () => { const { config, user } = useAppContext(); @@ -66,25 +67,3 @@ export const Pallete = () => {
); }; - -export const CanvasMeta = () => { - const { canvasPosition } = useAppContext(); - - return ( -
- {canvasPosition && ( - - - - )} - - Pixels: 123 - - - Users Online: 321 - -
- ); -}; diff --git a/packages/client-next/src/style.scss b/packages/client-next/src/style.scss index 767fe2d..faba6f0 100644 --- a/packages/client-next/src/style.scss +++ b/packages/client-next/src/style.scss @@ -10,13 +10,11 @@ html, body { overscroll-behavior: contain; touch-action: none; + + background-color: #ddd !important; } -body { - background-color: #ddd; -} - -header { +header#main-header { position: fixed; top: 0; left: 0; diff --git a/packages/client-next/tailwind.config.js b/packages/client-next/tailwind.config.js index 952e1c5..c5f2d91 100644 --- a/packages/client-next/tailwind.config.js +++ b/packages/client-next/tailwind.config.js @@ -7,6 +7,7 @@ export default { "./index.html", "./src/**/*.{js,ts,jsx,tsx}", "./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}", + "../../node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {},