From 6c394927306b79c67a525f4b79679e7c707d9cee Mon Sep 17 00:00:00 2001 From: NiklasBuchfink Date: Wed, 22 Mar 2023 21:14:33 +0100 Subject: [PATCH] #36 add: simple mobile editing --- README.md | 1 - src/client/components/Container.tsx | 2 +- src/client/components/DashboardHeader.tsx | 6 +- src/client/components/studio/Navigation.tsx | 225 +++++++++++++----- src/client/components/studio/StudioEditor.tsx | 9 +- 5 files changed, 174 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 56f14c6c..8c48eb54 100644 --- a/README.md +++ b/README.md @@ -77,5 +77,4 @@ All the others are used in CI or by those three main scripts, but you should onl --- - For more information, check out [the in-depth docs](./docs/README.md) diff --git a/src/client/components/Container.tsx b/src/client/components/Container.tsx index 2eff685b..ef4e4c9f 100644 --- a/src/client/components/Container.tsx +++ b/src/client/components/Container.tsx @@ -6,7 +6,7 @@ interface ContainerProps { const Container: FC = ({ children }) => { return ( -
+
{children}
); diff --git a/src/client/components/DashboardHeader.tsx b/src/client/components/DashboardHeader.tsx index 6683e709..6c98c8c0 100644 --- a/src/client/components/DashboardHeader.tsx +++ b/src/client/components/DashboardHeader.tsx @@ -17,7 +17,7 @@ export default function DashboardHeader() { const gradient = generateGradient(user?.firstName ? user.firstName : "Horst"); return ( -
+
{({ open }) => ( <> @@ -154,7 +154,7 @@ export default function DashboardHeader() {
- +
{user.image && ( @@ -166,7 +166,7 @@ export default function DashboardHeader() { />
)} -
+
{user.name}
diff --git a/src/client/components/studio/Navigation.tsx b/src/client/components/studio/Navigation.tsx index e141ae6d..2cb42ec2 100644 --- a/src/client/components/studio/Navigation.tsx +++ b/src/client/components/studio/Navigation.tsx @@ -1,6 +1,9 @@ +import { Popover, Transition } from "@headlessui/react"; import { ArrowLeftIcon } from "@heroicons/react/24/outline"; +import { Bars2Icon, XMarkIcon } from "@heroicons/react/24/solid"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; import clsx from "clsx"; +import { Fragment } from "react"; import { toast } from "react-hot-toast"; import { useNavigate } from "react-router-dom"; import { useRecoilState, useRecoilValue } from "recoil"; @@ -71,70 +74,174 @@ export default function Navigation() { ]; return ( - -
-
-
- + <> +
+ +
+
+
+
+ {/* Mobile menu button */}
-
+
+
+ {navigation.map( + (item) => + item.name === "Add block" && ( + + ) + )} +
+
+ +
+
+
+
+
+ +
+
+
- + ); } diff --git a/src/client/components/studio/StudioEditor.tsx b/src/client/components/studio/StudioEditor.tsx index 11abb46f..c373a6f3 100644 --- a/src/client/components/studio/StudioEditor.tsx +++ b/src/client/components/studio/StudioEditor.tsx @@ -16,7 +16,6 @@ import { PageHeader } from "../PageHeader"; import EmptyState from "./EmptyState"; import { useDropImage } from "./hooks/useDropImage"; import { useHandleLayoutChange } from "./hooks/useHandleLayoutChange"; -import MobileEditor from "./MobileEditor"; const ResponsiveGridLayout = WidthProvider(Responsive); @@ -135,10 +134,10 @@ const StudioEditor = () => { -
+ {/*
-
-
+
*/} +
{ })} >
-
+