From 7d52d4a013f04443ffc6b272a6d640730da887c9 Mon Sep 17 00:00:00 2001 From: zsavko Date: Sun, 9 Apr 2023 21:20:30 +0800 Subject: [PATCH] fix: extra style errors --- src/components/dashboard/DashboardLayout.tsx | 98 ++++++++++++-------- src/components/dashboard/DashboardMain.tsx | 7 +- src/components/dashboard/DashboardTopbar.tsx | 8 +- src/components/dashboard/OptionsButton.tsx | 6 ++ src/components/dashboard/PagesManager.tsx | 3 + src/components/ui/Tabs.tsx | 5 +- src/pages/dashboard/[subdomain]/editor.tsx | 11 +-- 7 files changed, 85 insertions(+), 53 deletions(-) diff --git a/src/components/dashboard/DashboardLayout.tsx b/src/components/dashboard/DashboardLayout.tsx index 2dce25d9..4f36dc0e 100644 --- a/src/components/dashboard/DashboardLayout.tsx +++ b/src/components/dashboard/DashboardLayout.tsx @@ -187,44 +187,64 @@ export function DashboardLayout({ } drawerWidget={(close: any) => ( <> -
-
- +
+
+
+ +
+ {"xLog"} +
+
+ {links.map((link) => { + const active = + link.href && + link.isActive({ + pathname: router.asPath, + href: link.href, + }) + return ( +
close()}> + + + {t(link.text)} + +
+ ) + })} +
+
+ + + {{t("Need help?")}} + + + + {{t("View Site")}} +
- {"xLog"} -
-
- {links.map((link) => { - const active = - link.href && - link.isActive({ - pathname: router.asPath, - href: link.href, - }) - return ( -
close()}> - - - {t(link.text)} - -
- ) - })}
)} @@ -329,7 +349,9 @@ export function DashboardLayout({ )} -
{children}
+
+ {children} +
) : ( diff --git a/src/components/dashboard/DashboardMain.tsx b/src/components/dashboard/DashboardMain.tsx index 82ef7561..e194930e 100644 --- a/src/components/dashboard/DashboardMain.tsx +++ b/src/components/dashboard/DashboardMain.tsx @@ -1,5 +1,6 @@ import { cn } from "~/lib/utils" import { useTranslation } from "next-i18next" +import { useMobileLayout } from "~/hooks/useMobileLayout" export const DashboardMain: React.FC<{ children: React.ReactNode @@ -8,15 +9,15 @@ export const DashboardMain: React.FC<{ className?: string }> = ({ children, fullWidth, title, className }) => { const { t } = useTranslation("dashboard") + const isMobileLayout = useMobileLayout() return (
{title &&

{t(title)}

} diff --git a/src/components/dashboard/DashboardTopbar.tsx b/src/components/dashboard/DashboardTopbar.tsx index c92b9673..97162c6e 100644 --- a/src/components/dashboard/DashboardTopbar.tsx +++ b/src/components/dashboard/DashboardTopbar.tsx @@ -13,9 +13,7 @@ export const DashboardTopbar: React.FC<{ const [isOpen, setIsOpen] = useState(false) return ( -
+
{({ open, close }) => (
@@ -23,9 +21,9 @@ export const DashboardTopbar: React.FC<{ as={Fragment} enter="transition ease-out duration-200" enterFrom="opacity-0" - enterTo="opacity-100" + enterTo="opacity-10" leave="transition ease-in duration-150" - leaveFrom="opacity-100" + leaveFrom="opacity-10" leaveTo="opacity-0" > diff --git a/src/components/dashboard/OptionsButton.tsx b/src/components/dashboard/OptionsButton.tsx index 07cd7e6f..8a41582a 100644 --- a/src/components/dashboard/OptionsButton.tsx +++ b/src/components/dashboard/OptionsButton.tsx @@ -121,6 +121,12 @@ export const OptionsButton: React.FC<{ ) }} +
renderPage(!isRendering)} + > + +
) } diff --git a/src/components/dashboard/PagesManager.tsx b/src/components/dashboard/PagesManager.tsx index baf94f3b..5645a64e 100644 --- a/src/components/dashboard/PagesManager.tsx +++ b/src/components/dashboard/PagesManager.tsx @@ -25,6 +25,7 @@ import { Tooltip } from "../ui/Tooltip" import { APP_NAME } from "~/lib/env" import { Trans, useTranslation } from "next-i18next" import { readFiles } from "~/lib/read-files" +import { useMobileLayout } from "~/hooks/useMobileLayout" export const PagesManager: React.FC<{ isPost: boolean @@ -47,6 +48,8 @@ export const PagesManager: React.FC<{ const { t } = useTranslation(["dashboard", "site"]) const date = useDate() + const isMobileLayout = useMobileLayout() + useEffect(() => { if (deletePage.isSuccess) { toast.success(t("Deleted!"), { diff --git a/src/components/ui/Tabs.tsx b/src/components/ui/Tabs.tsx index 93030410..c1ff0353 100644 --- a/src/components/ui/Tabs.tsx +++ b/src/components/ui/Tabs.tsx @@ -21,7 +21,10 @@ export const Tabs: React.FC<{ items: TabItem[]; className?: string }> = ({ return (
{items.map((item) => { if (item.hidden) return null diff --git a/src/pages/dashboard/[subdomain]/editor.tsx b/src/pages/dashboard/[subdomain]/editor.tsx index ffa523b7..9985cae6 100644 --- a/src/pages/dashboard/[subdomain]/editor.tsx +++ b/src/pages/dashboard/[subdomain]/editor.tsx @@ -526,11 +526,10 @@ export default function SubdomainEditor() {
@@ -605,7 +604,7 @@ export default function SubdomainEditor() {
- {/*
+
-
*/} +
)}