diff --git a/src/pages/dashboard/[subdomain]/editor.tsx b/src/pages/dashboard/[subdomain]/editor.tsx index d3cbd22e..1cc7ba08 100644 --- a/src/pages/dashboard/[subdomain]/editor.tsx +++ b/src/pages/dashboard/[subdomain]/editor.tsx @@ -38,6 +38,7 @@ import { Button } from "~/components/ui/Button" import { Modal } from "~/components/ui/Modal" import { CSB_SCAN } from "~/lib/env" import { showConfetti } from "~/lib/confetti" +import type { ReactElement } from "react" const getInputDatetimeValue = (date: Date | string) => { const str = dayjs(date).format() @@ -374,199 +375,194 @@ export default function SubdomainEditor() { return ( <> - - - {page.isLoading ? ( -
- Loading... -
- ) : ( - <> -
-
- - - Tip: xLog Flavored Markdown - -
-
- - {visibility?.toLowerCase()} - - - -
-
-
-
-
-
- { - if (e.key === "Enter") { - view?.focus() - } - }} - onChange={(e) => updateValue("title", e.target.value)} - className="h-12 ml-1 inline-flex items-center border-none text-3xl font-bold w-full focus:outline-none" - placeholder="Title goes here.." - /> -
-
- { - setCurrentScrollArea("editor") - }} - /> - { - setCurrentScrollArea("preview") - }} - > -
-
-
-
-
- ) => { - const value = inLocalTimezone( - e.target.value, - ).toISOString() - updateValue("publishedAt", value) + + {page.isLoading ? ( +
+ Loading... +
+ ) : ( + <> +
+
+ + + Tip: xLog Flavored Markdown + +
+
+ + {visibility?.toLowerCase()} + + + +
+
+
+
+
+
+ { + if (e.key === "Enter") { + view?.focus() + } }} - help={`This ${ - isPost ? "post" : "page" - } will be accessible from this time`} + onChange={(e) => updateValue("title", e.target.value)} + className="h-12 ml-1 inline-flex items-center border-none text-3xl font-bold w-full focus:outline-none" + placeholder="Title goes here.." />
-
- ) => - updateValue("slug", e.target.value) - } - help={ - <> - {(values.slug || defaultSlug) && ( - <> - This {isPost ? "post" : "page"} will be accessible - at{" "} - - {getSiteLink({ - subdomain, - domain: site.data?.custom_domain, - noProtocol: true, - })} - /{values.slug || defaultSlug} - - - )} - - } - /> -
-
- ) => - updateValue("tags", e.target.value) - } - help='Separate multiple tags with English commas ","' - /> -
-
- ) => { - updateValue("excerpt", e.target.value) +
+ { + setCurrentScrollArea("editor") }} - help="Leave it blank to use auto-generated excerpt" /> + { + setCurrentScrollArea("preview") + }} + >
- - )} - - +
+
+ ) => { + const value = inLocalTimezone( + e.target.value, + ).toISOString() + updateValue("publishedAt", value) + }} + help={`This ${ + isPost ? "post" : "page" + } will be accessible from this time`} + /> +
+
+ ) => + updateValue("slug", e.target.value) + } + help={ + <> + {(values.slug || defaultSlug) && ( + <> + This {isPost ? "post" : "page"} will be accessible + at{" "} + + {getSiteLink({ + subdomain, + domain: site.data?.custom_domain, + noProtocol: true, + })} + /{values.slug || defaultSlug} + + + )} + + } + /> +
+
+ ) => + updateValue("tags", e.target.value) + } + help='Separate multiple tags with English commas ","' + /> +
+
+ ) => { + updateValue("excerpt", e.target.value) + }} + help="Leave it blank to use auto-generated excerpt" + /> +
+
+
+ + )} + ) } + +SubdomainEditor.getLayout = (page: ReactElement) => { + return {page} +} diff --git a/src/pages/dashboard/[subdomain]/index.tsx b/src/pages/dashboard/[subdomain]/index.tsx index aa0f981a..706ce46e 100644 --- a/src/pages/dashboard/[subdomain]/index.tsx +++ b/src/pages/dashboard/[subdomain]/index.tsx @@ -5,90 +5,93 @@ import { UniLink } from "~/components/ui/UniLink" import Image from "next/image" import { DISCORD_LINK, TWITTER_LINK, GITHUB_LINK, APP_NAME } from "~/lib/env" import { getSiteLink } from "~/lib/helpers" +import type { ReactElement } from "react" export default function SubdomainIndex() { const router = useRouter() const subdomain = router.query.subdomain as string return ( - - -
-
- logo -
-

Hello there,

-

- This page is quite empty for now, but we will polish it very soon! - Maybe some useful analytics! -

-

Here{`'`}re some useful links to get started:

-
    -
  • - - Create a Post - -
  • -
  • - - Change Site Name or Icon - -
  • -
  • - Subscribe the{" "} - - posts feed - {" "} - and{" "} - - notifications feed - {" "} - via RSS Reader -
  • -
-

- You are not alone, join the community to meet friends or give xLog - some advice: -

-
    -
  • - - Join {APP_NAME} - {`'`}s Discord channel - -
  • -
  • - - Follow {APP_NAME} - {`'`}s xLog - -
  • -
  • - - View {APP_NAME} - {`'`}s source code or participate in its development - -
  • -
  • - - Follow {APP_NAME} - {`'`}s Twitter - -
  • -
+ +
+
+ logo
- - +

Hello there,

+

+ This page is quite empty for now, but we will polish it very soon! + Maybe some useful analytics! +

+

Here{`'`}re some useful links to get started:

+
    +
  • + + Create a Post + +
  • +
  • + + Change Site Name or Icon + +
  • +
  • + Subscribe the{" "} + + posts feed + {" "} + and{" "} + + notifications feed + {" "} + via RSS Reader +
  • +
+

+ You are not alone, join the community to meet friends or give xLog + some advice: +

+
    +
  • + + Join {APP_NAME} + {`'`}s Discord channel + +
  • +
  • + + Follow {APP_NAME} + {`'`}s xLog + +
  • +
  • + + View {APP_NAME} + {`'`}s source code or participate in its development + +
  • +
  • + + Follow {APP_NAME} + {`'`}s Twitter + +
  • +
+
+
) } + +SubdomainIndex.getLayout = (page: ReactElement) => { + return {page} +} diff --git a/src/pages/dashboard/[subdomain]/pages.tsx b/src/pages/dashboard/[subdomain]/pages.tsx index cb702187..47bed5ff 100644 --- a/src/pages/dashboard/[subdomain]/pages.tsx +++ b/src/pages/dashboard/[subdomain]/pages.tsx @@ -1,10 +1,11 @@ import { DashboardLayout } from "~/components/dashboard/DashboardLayout" import { PagesManager } from "~/components/dashboard/PagesManager" +import type { ReactElement } from "react" export default function SubdomainPages() { - return ( - - - - ) + return +} + +SubdomainPages.getLayout = (page: ReactElement) => { + return {page} } diff --git a/src/pages/dashboard/[subdomain]/posts.tsx b/src/pages/dashboard/[subdomain]/posts.tsx index 058e1128..6846d877 100644 --- a/src/pages/dashboard/[subdomain]/posts.tsx +++ b/src/pages/dashboard/[subdomain]/posts.tsx @@ -1,10 +1,11 @@ import { DashboardLayout } from "~/components/dashboard/DashboardLayout" import { PagesManager } from "~/components/dashboard/PagesManager" +import type { ReactElement } from "react" export default function SubdomainPosts() { - return ( - - - - ) + return +} + +SubdomainPosts.getLayout = (page: ReactElement) => { + return {page} } diff --git a/src/pages/dashboard/[subdomain]/settings/css.tsx b/src/pages/dashboard/[subdomain]/settings/css.tsx index 134e8204..91b24693 100644 --- a/src/pages/dashboard/[subdomain]/settings/css.tsx +++ b/src/pages/dashboard/[subdomain]/settings/css.tsx @@ -7,8 +7,9 @@ import { Button } from "~/components/ui/Button" import { useGetSite, useUpdateSite } from "~/queries/site" import Editor from "@monaco-editor/react" import { FieldLabel } from "~/components/ui/FieldLabel" +import type { ReactElement } from "react" -export default function SettingsDomainsPage() { +export default function SettingsCSSPage() { const router = useRouter() const subdomain = router.query.subdomain as string @@ -45,71 +46,73 @@ export default function SettingsDomainsPage() { }, [site.data, site.isSuccess, css, hasSet]) return ( - - -
-
-
-

Scope

-

- These styles will be applied to your entire blog, including this - dashboard. -

-

- Support ipfs:// -

-

- Tips: you can override the built-in CSS variables -

-

- - --theme-color: #4f46e5; - -

-

- - --theme-color-emphasis: #4338ca; - -

-

- - --header-height: auto; - -

-

- - --banner-bg-color: #fff; - -

-

- - --font-fans: ui-sans-serif, system-ui, -apple-system, - BlinkMacSystemFont, "Segoe UI", Roboto, - "Helvetica Neue", Arial, "Noto Sans", - sans-serif, "Apple Color Emoji", "Segoe UI - Emoji", "Segoe UI Symbol", "Noto Color - Emoji"; - -

-
- - setCss(value || "")} - options={{ - fontSize: 14, - }} - /> + + +
+
+

Scope

+

+ These styles will be applied to your entire blog, including this + dashboard. +

+

+ Support ipfs:// +

+

+ Tips: you can override the built-in CSS variables +

+

+ + --theme-color: #4f46e5; + +

+

+ + --theme-color-emphasis: #4338ca; + +

+

+ + --header-height: auto; + +

+

+ + --banner-bg-color: #fff; + +

+

+ + --font-fans: ui-sans-serif, system-ui, -apple-system, + BlinkMacSystemFont, "Segoe UI", Roboto, + "Helvetica Neue", Arial, "Noto Sans", + sans-serif, "Apple Color Emoji", "Segoe UI + Emoji", "Segoe UI Symbol", "Noto Color + Emoji"; + +

-
- -
- - - + + setCss(value || "")} + options={{ + fontSize: 14, + }} + /> +
+
+ +
+ +
) } + +SettingsCSSPage.getLayout = (page: ReactElement) => { + return {page} +} diff --git a/src/pages/dashboard/[subdomain]/settings/domains.tsx b/src/pages/dashboard/[subdomain]/settings/domains.tsx index 68d0decf..c58dd048 100644 --- a/src/pages/dashboard/[subdomain]/settings/domains.tsx +++ b/src/pages/dashboard/[subdomain]/settings/domains.tsx @@ -11,6 +11,7 @@ import { useGetSite, useUpdateSite } from "~/queries/site" import { useAccountState, useUpgradeAccountModal } from "@crossbell/connect-kit" import { UniLink } from "~/components/ui/UniLink" import { getSiteLink } from "~/lib/helpers" +import type { ReactElement } from "react" export default function SettingsDomainsPage() { const router = useRouter() @@ -74,90 +75,90 @@ export default function SettingsDomainsPage() { }, [form, site.data, site.isSuccess, customDomain, hasSet]) return ( - - -
-
- - {isEmailAccount && ( -
- Email users cannot change subdomain/handle.{" "} - - Learn more - {" "} - or{" "} - - upgrade account - - . -
- )} -
-
- - {customDomain && ( -
-

- Set the following record on your DNS provider to active your - custom domain: -

- - - - - - - - - - - - - - - - - - -
TypeNameValue
CNAME - {customSubdomain || "@"} - cname.{OUR_DOMAIN}
TXT{`_xlog-challenge${ - customSubdomain - ? `.${customSubdomain}` - : customSubdomain - }`}{subdomain}
-
- )} -
-
- -
-
-
-
+ +
+
+ + {isEmailAccount && ( +
+ Email users cannot change subdomain/handle.{" "} + + Learn more + {" "} + or{" "} + + upgrade account + + . +
+ )} +
+
+ + {customDomain && ( +
+

+ Set the following record on your DNS provider to active your + custom domain: +

+ + + + + + + + + + + + + + + + + + +
TypeNameValue
CNAME + {customSubdomain || "@"} + cname.{OUR_DOMAIN}
TXT{`_xlog-challenge${ + customSubdomain ? `.${customSubdomain}` : customSubdomain + }`}{subdomain}
+
+ )} +
+
+ +
+
+
) } + +SettingsDomainsPage.getLayout = (page: ReactElement) => { + return {page} +} diff --git a/src/pages/dashboard/[subdomain]/settings/general.tsx b/src/pages/dashboard/[subdomain]/settings/general.tsx index b000e7c7..b02a0a56 100644 --- a/src/pages/dashboard/[subdomain]/settings/general.tsx +++ b/src/pages/dashboard/[subdomain]/settings/general.tsx @@ -10,6 +10,7 @@ import { useGetSite, useUpdateSite } from "~/queries/site" import { UniLink } from "~/components/ui/UniLink" import { ImageUploader } from "~/components/ui/ImageUploader" import { toIPFS } from "~/lib/ipfs-parser" +import type { ReactElement } from "react" export default function SiteSettingsGeneralPage() { const router = useRouter() @@ -86,118 +87,120 @@ export default function SiteSettingsGeneralPage() { const [bannerUploading, setBannerUploading] = useState(false) return ( - - -
-
- - ( - { - setIconUploading(true) - }} - uploadEnd={(key) => { - form.setValue("icon", key as string) - setIconUploading(false) - }} - {...field} - /> - )} - /> + + +
+ + ( + { + setIconUploading(true) + }} + uploadEnd={(key) => { + form.setValue("icon", key as string) + setIconUploading(false) + }} + {...field} + /> + )} + /> +
+
+ + ( +
+ + {/*
+

Danger Zone

+
+ +
+
*/} +
) } + +SiteSettingsGeneralPage.getLayout = (page: ReactElement) => { + return {page} +} diff --git a/src/pages/dashboard/[subdomain]/settings/navigation.tsx b/src/pages/dashboard/[subdomain]/settings/navigation.tsx index ce1f7358..1f1dace3 100644 --- a/src/pages/dashboard/[subdomain]/settings/navigation.tsx +++ b/src/pages/dashboard/[subdomain]/settings/navigation.tsx @@ -10,6 +10,7 @@ import { nanoid } from "nanoid" import { ReactSortable } from "react-sortablejs" import equal from "fast-deep-equal" import { useGetSite, useUpdateSite } from "~/queries/site" +import type { ReactElement } from "react" type UpdateItem = (id: string, newItem: Partial) => void @@ -128,74 +129,70 @@ export default function SiteSettingsNavigationPage() { }, [site.data?.navigation, hasSet]) return ( - - -
-

- Tips: built-in pages -

-

- - Home page (use your own Label to replace the default Label): - {" "} - / -

-

- Archives page:{" "} - /archives -

-

- Tag page:{" "} - /tag/[tag] -

-

- NFT Showcase page:{" "} - /nft -

+ +
+

Tips: built-in pages

+

+ + Home page (use your own Label to replace the default Label): + {" "} + / +

+

+ Archives page:{" "} + /archives +

+

+ Tag page:{" "} + /tag/[tag] +

+

+ NFT Showcase page:{" "} + /nft +

+
+
+
+ {items.length === 0 && ( +
+ No navigation items yet +
+ )} + + {items.map((item) => { + return ( + + ) + })} + +
- -
- {items.length === 0 && ( -
- No navigation items yet -
- )} - - {items.map((item) => { - return ( - - ) - })} - - -
-
- - -
-
-
- +
+ + +
+ + ) } + +SiteSettingsNavigationPage.getLayout = (page: ReactElement) => { + return {page} +} diff --git a/src/pages/dashboard/[subdomain]/settings/operator.tsx b/src/pages/dashboard/[subdomain]/settings/operator.tsx index f76c23ca..cfef91f6 100644 --- a/src/pages/dashboard/[subdomain]/settings/operator.tsx +++ b/src/pages/dashboard/[subdomain]/settings/operator.tsx @@ -16,6 +16,7 @@ import { CharacterCard } from "~/components/common/CharacterCard" import { useAccountState, useUpgradeAccountModal } from "@crossbell/connect-kit" import { UniLink } from "~/components/ui/UniLink" import { getSiteLink } from "~/lib/helpers" +import type { ReactElement } from "react" type RemoveItem = (operator: string) => void @@ -51,7 +52,7 @@ const SortableNavigationItem: React.FC<{ ) } -export default function SiteSettingsNavigationPage() { +export default function SettingsOperatorPage() { const router = useRouter() const subdomain = router.query.subdomain as string @@ -114,120 +115,122 @@ export default function SiteSettingsNavigationPage() { const [address, setAddress] = useState("") return ( - - - setIsOpen(false)} - className="fixed z-10 inset-0 overflow-y-auto" - > -
- + + setIsOpen(false)} + className="fixed z-10 inset-0 overflow-y-auto" + > +
+ -
- - New operator - +
+ + New operator + -
- { - setAddress(e.target.value) - }} +
+ { + setAddress(e.target.value) + }} + /> +
Operator Character Check
+
+ -
Operator Character Check
-
- -
-
- -
-
+ +
+ +
-
-
-

⚠️ Warning:

-

- - {isEmailAccount ? ( - - Email users cannot set operators.{" "} - - Learn more - {" "} - or{" "} - - upgrade account - - . - - ) : ( - - Operators have permissions to enter your dashboard, change - your settings(excluding xLog subdomain) and post contents on - your site. - - )} - -

-
-
- {items.length === 0 && ( -
- No operators yet -
+
+
+

⚠️ Warning:

+

+ + {isEmailAccount ? ( + + Email users cannot set operators.{" "} + + Learn more + {" "} + or{" "} + + upgrade account + + . + + ) : ( + + Operators have permissions to enter your dashboard, change your + settings(excluding xLog subdomain) and post contents on your + site. + )} - {items.map((item, index) => { - return ( - - ) - })} - -

-
- -
+ +

+
+
+
+ {items.length === 0 && ( +
+ No operators yet +
+ )} + {items.map((item, index) => { + return ( + + ) + })} +
- - +
+ +
+
+
) } + +SettingsOperatorPage.getLayout = (page: ReactElement) => { + return {page} +}