From 0eeaf04b2c57532ad51e171b4cf626983ba052f7 Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Thu, 9 May 2024 15:31:39 +0700 Subject: [PATCH] Add theme customizer --- src/app/@file.grid.tsx | 34 +- src/app/@file.list.tsx | 34 +- src/app/@footer.tsx | 2 +- src/app/[...rest]/deploy/@form.api-config.tsx | 2 +- src/app/[...rest]/deploy/@form.env-config.tsx | 2 +- ...@form.input.tsx => @form.input-config.tsx} | 0 .../[...rest]/deploy/@form.input-theme.tsx | 181 +++++ .../[...rest]/deploy/@form.site-config.tsx | 2 +- src/app/[...rest]/deploy/@form.theme.tsx | 235 +++++++ src/app/[...rest]/deploy/@theme-preview.tsx | 369 ++++++++++ src/app/[...rest]/deploy/docs.tsx | 639 +++++++++++++++++- src/components/ui/slider.tsx | 28 + src/schema.ts | 1 + src/utils/parseConfigFile.ts | 10 + 14 files changed, 1492 insertions(+), 47 deletions(-) rename src/app/[...rest]/deploy/{@form.input.tsx => @form.input-config.tsx} (100%) create mode 100644 src/app/[...rest]/deploy/@form.input-theme.tsx create mode 100644 src/app/[...rest]/deploy/@form.theme.tsx create mode 100644 src/app/[...rest]/deploy/@theme-preview.tsx create mode 100644 src/components/ui/slider.tsx diff --git a/src/app/@file.grid.tsx b/src/app/@file.grid.tsx index ac5d9ba..7359d8b 100644 --- a/src/app/@file.grid.tsx +++ b/src/app/@file.grid.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import { usePathname } from "next/navigation"; +import nProgress from "nprogress"; import { useMemo, useState } from "react"; import toast from "react-hot-toast"; import { z } from "zod"; @@ -38,8 +39,9 @@ import { CreateDownloadToken } from "./actions"; type Props = { data: z.infer; + disabled?: boolean; }; -export default function FileGrid({ data }: Props) { +export default function FileGrid({ data, disabled }: Props) { const pathname = usePathname(); const filePath = useMemo(() => { // const currentPath = pathname.startsWith("/e") ? pathname : `/e${pathname}`; @@ -120,7 +122,10 @@ export default function FileGrid({ data }: Props) { - + {data.mimeType.includes("folder") ? null : ( - +
- - + {data.mimeType.includes("folder") ? null : ( - +
- + + + + + + + + + + + Title + Description + + + Content + Footer + + + + + +