From ea1f0f2c671f0e32039b3a5518c3ac97141e14ee Mon Sep 17 00:00:00 2001 From: aXenDeveloper Date: Mon, 17 Jun 2024 20:14:45 +0200 Subject: [PATCH] feat(frontend)!: Remove themes folder --- .../(main)/(container)/login/page.tsx | 15 ++----------- .../(main)/(container)/register/page.tsx | 15 ++----------- .../(container)/settings/devices/page.tsx | 20 +++-------------- .../(container)/settings/files/page.tsx | 22 +++---------------- .../(main)/(container)/settings/layout.tsx | 18 ++------------- .../settings/notifications/page.tsx | 17 ++------------ .../(main)/(container)/settings/page.tsx | 17 ++------------ frontend/app/[locale]/(main)/layout.tsx | 21 ++++-------------- frontend/app/[locale]/(main)/not-found.tsx | 7 ++---- frontend/app/[locale]/(main)/page.tsx | 11 ++++------ .../app/[locale]/(main)/profile/[id]/page.tsx | 17 ++------------ frontend/components/views/error-view-ssr.tsx | 16 +++----------- .../blog/views}/default-page.tsx | 0 .../core/views}/layout/global.css | 0 .../core/views}/layout/header/header.tsx | 0 .../header/user-bar/auth/auth-user-bar.tsx | 0 .../layout/header/user-bar/user-bar.tsx | 0 .../core/views}/layout/layout.tsx | 4 ++-- .../core/views}/layout/nav/item.tsx | 0 .../core/views}/layout/nav/list-wrapper.tsx | 0 .../core/views}/layout/nav/nav.tsx | 0 .../core/views}/layout/nav/wrapper.tsx | 0 .../layout/quick-menu/drawer/button.tsx | 0 .../layout/quick-menu/drawer/drawer.tsx | 0 .../layout/quick-menu/drawer/header.tsx | 0 .../layout/quick-menu/drawer/nav/item.tsx | 0 .../layout/quick-menu/drawer/nav/nav.tsx | 0 .../core/views}/layout/quick-menu/item.tsx | 0 .../views}/layout/quick-menu/quick-menu.tsx | 0 .../core/views}/layout/quick-menu/wrapper.tsx | 0 .../views/auth/sign/in/form/form-sign-in.tsx | 0 .../views/auth/sign/in/sign-in-view.tsx | 4 ++-- .../views/auth/sign/up/form/form-sign-up.tsx | 0 .../views/auth/sign/up/form/success.tsx | 0 .../views/auth/sign/up/sign-up-view.tsx | 4 ++-- .../views}/views/global/error/error-view.tsx | 4 ++-- .../views/global/loading/loading-view.tsx | 0 .../views}/views/profile/profile-view.tsx | 6 ++--- .../views/settings/layout-settings-view.tsx | 4 ++-- .../core/views}/views/settings/nav/drawer.tsx | 0 .../settings/nav/item/item-nav-settings.tsx | 0 .../nav/item/link/link-item-nav-settings.tsx | 0 .../views/settings/nav/nav-settings.tsx | 0 .../views/settings/views/devices/content.tsx | 0 .../views/devices/devices-settings-view.tsx | 7 +++--- .../views/settings/views/files/content.tsx | 0 .../views/files/files-settings-view.tsx | 6 ++--- .../header/header-notifications-settings.tsx | 0 .../notifications-settings-view.tsx | 4 ++-- .../header/change-avatar/change-avatar.tsx | 0 .../cropper/cropper-modal-change-avatar.tsx | 0 .../modal/modal-change-avatar.tsx | 0 .../header/header-overview-settings.tsx | 0 .../views/overview/overview-settings-view.tsx | 4 ++-- frontend/themes/1/config.json | 8 ------- 55 files changed, 53 insertions(+), 198 deletions(-) rename frontend/{themes/1/blog => plugins/blog/views}/default-page.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/global.css (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/header/header.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/header/user-bar/auth/auth-user-bar.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/header/user-bar/user-bar.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/layout.tsx (94%) rename frontend/{themes/1/core => plugins/core/views}/layout/nav/item.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/nav/list-wrapper.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/nav/nav.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/nav/wrapper.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/drawer/button.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/drawer/drawer.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/drawer/header.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/drawer/nav/item.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/drawer/nav/nav.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/item.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/quick-menu.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/layout/quick-menu/wrapper.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/auth/sign/in/form/form-sign-in.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/auth/sign/in/sign-in-view.tsx (94%) rename frontend/{themes/1/core => plugins/core/views}/views/auth/sign/up/form/form-sign-up.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/auth/sign/up/form/success.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/auth/sign/up/sign-up-view.tsx (94%) rename frontend/{themes/1/core => plugins/core/views}/views/global/error/error-view.tsx (95%) rename frontend/{themes/1/core => plugins/core/views}/views/global/loading/loading-view.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/profile/profile-view.tsx (92%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/layout-settings-view.tsx (90%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/nav/drawer.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/nav/item/item-nav-settings.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/nav/item/link/link-item-nav-settings.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/nav/nav-settings.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/devices/content.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/devices/devices-settings-view.tsx (79%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/files/content.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/files/files-settings-view.tsx (90%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/notifications/header/header-notifications-settings.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/notifications/notifications-settings-view.tsx (82%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/overview/header/change-avatar/change-avatar.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/overview/header/change-avatar/modal/cropper/cropper-modal-change-avatar.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/overview/header/change-avatar/modal/modal-change-avatar.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/overview/header/header-overview-settings.tsx (100%) rename frontend/{themes/1/core => plugins/core/views}/views/settings/views/overview/overview-settings-view.tsx (69%) delete mode 100644 frontend/themes/1/config.json diff --git a/frontend/app/[locale]/(main)/(container)/login/page.tsx b/frontend/app/[locale]/(main)/(container)/login/page.tsx index 2a1deeea2..f11044280 100644 --- a/frontend/app/[locale]/(main)/(container)/login/page.tsx +++ b/frontend/app/[locale]/(main)/(container)/login/page.tsx @@ -1,18 +1,7 @@ import * as React from "react"; -import { getSessionData } from "@/graphql/get-session-data"; +import { SignInView } from "@/plugins/core/views/views/auth/sign/in/sign-in-view"; export default async function Page() { - const { theme_id } = await getSessionData(); - const PageFromTheme: React.LazyExoticComponent<() => JSX.Element> = - React.lazy(async () => - import( - `../../../../../themes/${theme_id}/core/views/auth/sign/in/sign-in-view` - ).catch( - async () => - import("../../../../../themes/1/core/views/auth/sign/in/sign-in-view") - ) - ); - - return ; + return ; } diff --git a/frontend/app/[locale]/(main)/(container)/register/page.tsx b/frontend/app/[locale]/(main)/(container)/register/page.tsx index 94ecaf1d4..73a017d15 100644 --- a/frontend/app/[locale]/(main)/(container)/register/page.tsx +++ b/frontend/app/[locale]/(main)/(container)/register/page.tsx @@ -1,18 +1,7 @@ import * as React from "react"; -import { getSessionData } from "@/graphql/get-session-data"; +import { SignUpView } from "@/plugins/core/views/views/auth/sign/up/sign-up-view"; export default async function Page() { - const { theme_id } = await getSessionData(); - const PageFromTheme: React.LazyExoticComponent<() => JSX.Element> = - React.lazy(async () => - import( - `../../../../../themes/${theme_id}/core/views/auth/sign/up/sign-up-view` - ).catch( - async () => - import("../../../../../themes/1/core/views/auth/sign/up/sign-up-view") - ) - ); - - return ; + return ; } diff --git a/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx b/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx index 8838c0c23..379d4a826 100644 --- a/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx +++ b/frontend/app/[locale]/(main)/(container)/settings/devices/page.tsx @@ -6,9 +6,8 @@ import { Core_Sessions__Devices__ShowQuery, Core_Sessions__Devices__ShowQueryVariables } from "@/graphql/hooks"; -import { DevicesSettingsViewProps } from "@/themes/1/core/views/settings/views/devices/devices-settings-view"; +import { DevicesSettingsView } from "@/plugins/core/views/views/settings/views/devices/devices-settings-view"; import { fetcher } from "@/graphql/fetcher"; -import { getSessionData } from "@/graphql/get-session-data"; const getData = async () => { const { data } = await fetcher< @@ -22,7 +21,7 @@ const getData = async () => { }; export default async function Page() { - const [{ theme_id }, data] = await Promise.all([getSessionData(), getData()]); + const data = await getData(); const cookieStore = cookies(); const loginToken = cookieStore.get("vitnode-login-token")?.value; @@ -30,18 +29,5 @@ export default async function Page() { return null; } - const PageFromTheme: React.LazyExoticComponent< - (props: DevicesSettingsViewProps) => JSX.Element - > = React.lazy(async () => - import( - `../../../../../../themes/${theme_id}/core/views/settings/views/devices/devices-settings-view` - ).catch( - async () => - import( - "../../../../../../themes/1/core/views/settings/views/devices/devices-settings-view" - ) - ) - ); - - return ; + return ; } diff --git a/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx b/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx index 8d65e603a..dee044aaf 100644 --- a/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx +++ b/frontend/app/[locale]/(main)/(container)/settings/files/page.tsx @@ -11,7 +11,7 @@ import { SearchParamsPagination } from "@/plugins/core/hooks/utils/use-pagination-api-ssr"; import { fetcher } from "@/graphql/fetcher"; -import { getSessionData } from "@/graphql/get-session-data"; +import { FilesSettingsView } from "@/plugins/core/views/views/settings/views/files/files-settings-view"; const getData = async (variables: Core_Members__Files__ShowQueryVariables) => { const { data } = await fetcher< @@ -37,23 +37,7 @@ export default async function Page({ searchParams }: Props) { search: true, sortByEnum: ShowCoreFilesSortingColumnEnum }); - const [{ theme_id }, data] = await Promise.all([ - getSessionData(), - getData(variables) - ]); + const data = await getData(variables); - const PageFromTheme: React.LazyExoticComponent< - (props: Core_Members__Files__ShowQuery) => JSX.Element - > = React.lazy(async () => - import( - `../../../../../../themes/${theme_id}/core/views/settings/views/files/files-settings-view` - ).catch( - async () => - import( - "../../../../../../themes/1/core/views/settings/views/files/files-settings-view" - ) - ) - ); - - return ; + return ; } diff --git a/frontend/app/[locale]/(main)/(container)/settings/layout.tsx b/frontend/app/[locale]/(main)/(container)/settings/layout.tsx index d46528bfd..0162255d8 100644 --- a/frontend/app/[locale]/(main)/(container)/settings/layout.tsx +++ b/frontend/app/[locale]/(main)/(container)/settings/layout.tsx @@ -3,7 +3,7 @@ import { Metadata } from "next"; import { getTranslations } from "next-intl/server"; import { getConfigFile } from "@/config/helpers"; -import { getSessionData } from "@/graphql/get-session-data"; +import { LayoutSettingsView } from "@/plugins/core/views/views/settings/layout-settings-view"; interface Props { children: React.ReactNode; @@ -23,19 +23,5 @@ export async function generateMetadata(): Promise { } export default async function Layout({ children }: Props) { - const { theme_id } = await getSessionData(); - const LayoutFromLazy: React.LazyExoticComponent< - ({ children }: { children: React.ReactNode }) => JSX.Element - > = React.lazy(async () => - import( - `../../../../../themes/${theme_id}/core/views/settings/layout-settings-view` - ).catch( - async () => - import( - "../../../../../themes/1/core/views/settings/layout-settings-view" - ) - ) - ); - - return {children}; + return {children}; } diff --git a/frontend/app/[locale]/(main)/(container)/settings/notifications/page.tsx b/frontend/app/[locale]/(main)/(container)/settings/notifications/page.tsx index 23aaa78c1..438a1e22b 100644 --- a/frontend/app/[locale]/(main)/(container)/settings/notifications/page.tsx +++ b/frontend/app/[locale]/(main)/(container)/settings/notifications/page.tsx @@ -1,20 +1,7 @@ import * as React from "react"; -import { getSessionData } from "@/graphql/get-session-data"; +import { NotificationsSettingsView } from "@/plugins/core/views/views/settings/views/notifications/notifications-settings-view"; export default async function Page() { - const { theme_id } = await getSessionData(); - const PageFromTheme: React.LazyExoticComponent<() => JSX.Element> = - React.lazy(async () => - import( - `../../../../../../themes/${theme_id}/core/views/settings/views/notifications/notifications-settings-view` - ).catch( - async () => - import( - "../../../../../../themes/1/core/views/settings/views/notifications/notifications-settings-view" - ) - ) - ); - - return ; + return ; } diff --git a/frontend/app/[locale]/(main)/(container)/settings/page.tsx b/frontend/app/[locale]/(main)/(container)/settings/page.tsx index 556339992..f9a89baec 100644 --- a/frontend/app/[locale]/(main)/(container)/settings/page.tsx +++ b/frontend/app/[locale]/(main)/(container)/settings/page.tsx @@ -1,20 +1,7 @@ import * as React from "react"; -import { getSessionData } from "@/graphql/get-session-data"; +import { OverviewSettingsView } from "@/plugins/core/views/views/settings/views/overview/overview-settings-view"; export default async function Page() { - const { theme_id } = await getSessionData(); - const PageFromTheme: React.LazyExoticComponent<() => JSX.Element> = - React.lazy(async () => - import( - `../../../../../themes/${theme_id}/core/views/settings/views/overview/overview-settings-view` - ).catch( - async () => - import( - "../../../../../themes/1/core/views/settings/views/overview/overview-settings-view" - ) - ) - ); - - return ; + return ; } diff --git a/frontend/app/[locale]/(main)/layout.tsx b/frontend/app/[locale]/(main)/layout.tsx index 07d2f82bd..b1e1349e4 100644 --- a/frontend/app/[locale]/(main)/layout.tsx +++ b/frontend/app/[locale]/(main)/layout.tsx @@ -3,9 +3,9 @@ import { isRedirectError } from "next/dist/client/components/redirect"; import { redirect } from "@vitnode/frontend/navigation"; import { SessionProvider } from "./session-provider"; -import { TextLanguage } from "@/graphql/hooks"; import { InternalErrorView } from "@/plugins/admin/global/internal-error/internal-error-view"; import { getSessionData } from "@/graphql/get-session-data"; +import { Layout as LayoutCore } from "@/plugins/core/views/layout/layout"; interface Props { children: React.ReactNode; @@ -14,29 +14,16 @@ interface Props { export default async function Layout({ children }: Props) { try { - const { data, theme_id } = await getSessionData(); + const { data } = await getSessionData(); if (data.core_languages__show.edges.length === 0) { redirect("/admin/install"); } - const Layout: React.LazyExoticComponent< - ({ - children - }: { - children: React.ReactNode; - copyright?: TextLanguage[]; - }) => JSX.Element - > = React.lazy(async () => - import(`../../../themes/${theme_id}/core/layout/layout`).catch( - async () => import("../../../themes/1/core/layout/layout") - ) - ); - return ( - + {children} - + ); } catch (error) { diff --git a/frontend/app/[locale]/(main)/not-found.tsx b/frontend/app/[locale]/(main)/not-found.tsx index 3788966c2..f52b56da2 100644 --- a/frontend/app/[locale]/(main)/not-found.tsx +++ b/frontend/app/[locale]/(main)/not-found.tsx @@ -1,12 +1,9 @@ import { ErrorViewSSR } from "@/components/views/error-view-ssr"; -import { getSessionData } from "@/graphql/get-session-data"; - -export default async function NotFoundPage() { - const { theme_id } = await getSessionData(); +export default function NotFoundPage() { return (
- +
); } diff --git a/frontend/app/[locale]/(main)/page.tsx b/frontend/app/[locale]/(main)/page.tsx index d0c49e928..2124f1a3b 100644 --- a/frontend/app/[locale]/(main)/page.tsx +++ b/frontend/app/[locale]/(main)/page.tsx @@ -38,14 +38,11 @@ export async function generateMetadata({ } export default async function Page() { - const { default_plugin, theme_id } = await getSessionData(); + const { default_plugin } = await getSessionData(); const PageFromTheme: React.LazyExoticComponent<() => JSX.Element> = - React.lazy(async () => - import( - `../../../themes/${theme_id}/${default_plugin}/default-page` - ).catch( - async () => import(`../../../themes/1/${default_plugin}/default-page`) - ) + React.lazy( + async () => + import(`../../../plugins/${default_plugin}/views/default-page`) ); return ; diff --git a/frontend/app/[locale]/(main)/profile/[id]/page.tsx b/frontend/app/[locale]/(main)/profile/[id]/page.tsx index f666d382e..3a550b28b 100644 --- a/frontend/app/[locale]/(main)/profile/[id]/page.tsx +++ b/frontend/app/[locale]/(main)/profile/[id]/page.tsx @@ -2,14 +2,13 @@ import { Metadata } from "next"; import { notFound } from "next/navigation"; import * as React from "react"; -import { ProfileViewProps } from "@/themes/1/core/views/profile/profile-view"; +import { ProfileView } from "@/plugins/core/views/views/profile/profile-view"; import { Core_Members__Profiles, Core_Members__ProfilesQuery, Core_Members__ProfilesQueryVariables } from "@/graphql/hooks"; import { fetcher } from "@/graphql/fetcher"; -import { getSessionData } from "@/graphql/get-session-data"; const getData = async ({ id }: { id: string }) => { const { data } = await fetcher< @@ -50,17 +49,5 @@ export default async function Page({ params: { id } }: Props) { notFound(); } - const { theme_id } = await getSessionData(); - const PageFromTheme: React.LazyExoticComponent< - (props: ProfileViewProps) => JSX.Element - > = React.lazy(async () => - import( - `../../../../../themes/${theme_id}/core/views/profile/profile-view` - ).catch( - async () => - import("../../../../../themes/1/core/views/profile/profile-view") - ) - ); - - return ; + return ; } diff --git a/frontend/components/views/error-view-ssr.tsx b/frontend/components/views/error-view-ssr.tsx index ebe1f3378..47f1b7bf2 100644 --- a/frontend/components/views/error-view-ssr.tsx +++ b/frontend/components/views/error-view-ssr.tsx @@ -1,22 +1,12 @@ import * as React from "react"; +import { ErrorView } from "@/plugins/core/views/views/global/error/error-view"; + export interface ErrorViewProps { code: string | "403" | "404" | "500"; className?: string; } -interface Props extends ErrorViewProps { - theme_id: number; -} - -export const ErrorViewSSR = ({ theme_id, ...props }: Props) => { - const ErrorView: React.LazyExoticComponent< - (props: ErrorViewProps) => JSX.Element - > = React.lazy(async () => - import(`../../themes/${theme_id}/core/views/global/error/error-view`).catch( - async () => import("../../themes/1/core/views/global/error/error-view") - ) - ); - +export const ErrorViewSSR = (props: ErrorViewProps) => { return ; }; diff --git a/frontend/themes/1/blog/default-page.tsx b/frontend/plugins/blog/views/default-page.tsx similarity index 100% rename from frontend/themes/1/blog/default-page.tsx rename to frontend/plugins/blog/views/default-page.tsx diff --git a/frontend/themes/1/core/layout/global.css b/frontend/plugins/core/views/layout/global.css similarity index 100% rename from frontend/themes/1/core/layout/global.css rename to frontend/plugins/core/views/layout/global.css diff --git a/frontend/themes/1/core/layout/header/header.tsx b/frontend/plugins/core/views/layout/header/header.tsx similarity index 100% rename from frontend/themes/1/core/layout/header/header.tsx rename to frontend/plugins/core/views/layout/header/header.tsx diff --git a/frontend/themes/1/core/layout/header/user-bar/auth/auth-user-bar.tsx b/frontend/plugins/core/views/layout/header/user-bar/auth/auth-user-bar.tsx similarity index 100% rename from frontend/themes/1/core/layout/header/user-bar/auth/auth-user-bar.tsx rename to frontend/plugins/core/views/layout/header/user-bar/auth/auth-user-bar.tsx diff --git a/frontend/themes/1/core/layout/header/user-bar/user-bar.tsx b/frontend/plugins/core/views/layout/header/user-bar/user-bar.tsx similarity index 100% rename from frontend/themes/1/core/layout/header/user-bar/user-bar.tsx rename to frontend/plugins/core/views/layout/header/user-bar/user-bar.tsx diff --git a/frontend/themes/1/core/layout/layout.tsx b/frontend/plugins/core/views/layout/layout.tsx similarity index 94% rename from frontend/themes/1/core/layout/layout.tsx rename to frontend/plugins/core/views/layout/layout.tsx index af9ff4936..8a9fa0b40 100644 --- a/frontend/themes/1/core/layout/layout.tsx +++ b/frontend/plugins/core/views/layout/layout.tsx @@ -12,7 +12,7 @@ interface Props { copyright?: TextLanguage[]; } -export default function Layout({ children, copyright }: Props) { +export const Layout = ({ children, copyright }: Props) => { const { convertText } = useTextLang(); /** @@ -38,4 +38,4 @@ export default function Layout({ children, copyright }: Props) { ); -} +}; diff --git a/frontend/themes/1/core/layout/nav/item.tsx b/frontend/plugins/core/views/layout/nav/item.tsx similarity index 100% rename from frontend/themes/1/core/layout/nav/item.tsx rename to frontend/plugins/core/views/layout/nav/item.tsx diff --git a/frontend/themes/1/core/layout/nav/list-wrapper.tsx b/frontend/plugins/core/views/layout/nav/list-wrapper.tsx similarity index 100% rename from frontend/themes/1/core/layout/nav/list-wrapper.tsx rename to frontend/plugins/core/views/layout/nav/list-wrapper.tsx diff --git a/frontend/themes/1/core/layout/nav/nav.tsx b/frontend/plugins/core/views/layout/nav/nav.tsx similarity index 100% rename from frontend/themes/1/core/layout/nav/nav.tsx rename to frontend/plugins/core/views/layout/nav/nav.tsx diff --git a/frontend/themes/1/core/layout/nav/wrapper.tsx b/frontend/plugins/core/views/layout/nav/wrapper.tsx similarity index 100% rename from frontend/themes/1/core/layout/nav/wrapper.tsx rename to frontend/plugins/core/views/layout/nav/wrapper.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/drawer/button.tsx b/frontend/plugins/core/views/layout/quick-menu/drawer/button.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/drawer/button.tsx rename to frontend/plugins/core/views/layout/quick-menu/drawer/button.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/drawer/drawer.tsx b/frontend/plugins/core/views/layout/quick-menu/drawer/drawer.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/drawer/drawer.tsx rename to frontend/plugins/core/views/layout/quick-menu/drawer/drawer.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/drawer/header.tsx b/frontend/plugins/core/views/layout/quick-menu/drawer/header.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/drawer/header.tsx rename to frontend/plugins/core/views/layout/quick-menu/drawer/header.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/drawer/nav/item.tsx b/frontend/plugins/core/views/layout/quick-menu/drawer/nav/item.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/drawer/nav/item.tsx rename to frontend/plugins/core/views/layout/quick-menu/drawer/nav/item.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/drawer/nav/nav.tsx b/frontend/plugins/core/views/layout/quick-menu/drawer/nav/nav.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/drawer/nav/nav.tsx rename to frontend/plugins/core/views/layout/quick-menu/drawer/nav/nav.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/item.tsx b/frontend/plugins/core/views/layout/quick-menu/item.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/item.tsx rename to frontend/plugins/core/views/layout/quick-menu/item.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/quick-menu.tsx b/frontend/plugins/core/views/layout/quick-menu/quick-menu.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/quick-menu.tsx rename to frontend/plugins/core/views/layout/quick-menu/quick-menu.tsx diff --git a/frontend/themes/1/core/layout/quick-menu/wrapper.tsx b/frontend/plugins/core/views/layout/quick-menu/wrapper.tsx similarity index 100% rename from frontend/themes/1/core/layout/quick-menu/wrapper.tsx rename to frontend/plugins/core/views/layout/quick-menu/wrapper.tsx diff --git a/frontend/themes/1/core/views/auth/sign/in/form/form-sign-in.tsx b/frontend/plugins/core/views/views/auth/sign/in/form/form-sign-in.tsx similarity index 100% rename from frontend/themes/1/core/views/auth/sign/in/form/form-sign-in.tsx rename to frontend/plugins/core/views/views/auth/sign/in/form/form-sign-in.tsx diff --git a/frontend/themes/1/core/views/auth/sign/in/sign-in-view.tsx b/frontend/plugins/core/views/views/auth/sign/in/sign-in-view.tsx similarity index 94% rename from frontend/themes/1/core/views/auth/sign/in/sign-in-view.tsx rename to frontend/plugins/core/views/views/auth/sign/in/sign-in-view.tsx index 072b67d0e..85b9d7869 100644 --- a/frontend/themes/1/core/views/auth/sign/in/sign-in-view.tsx +++ b/frontend/plugins/core/views/views/auth/sign/in/sign-in-view.tsx @@ -9,7 +9,7 @@ import { } from "@/components/ui/card"; import { FormSignIn } from "./form/form-sign-in"; -export default function SignInView() { +export const SignInView = () => { const t = useTranslations("core.sign_in"); return ( @@ -27,4 +27,4 @@ export default function SignInView() { ); -} +}; diff --git a/frontend/themes/1/core/views/auth/sign/up/form/form-sign-up.tsx b/frontend/plugins/core/views/views/auth/sign/up/form/form-sign-up.tsx similarity index 100% rename from frontend/themes/1/core/views/auth/sign/up/form/form-sign-up.tsx rename to frontend/plugins/core/views/views/auth/sign/up/form/form-sign-up.tsx diff --git a/frontend/themes/1/core/views/auth/sign/up/form/success.tsx b/frontend/plugins/core/views/views/auth/sign/up/form/success.tsx similarity index 100% rename from frontend/themes/1/core/views/auth/sign/up/form/success.tsx rename to frontend/plugins/core/views/views/auth/sign/up/form/success.tsx diff --git a/frontend/themes/1/core/views/auth/sign/up/sign-up-view.tsx b/frontend/plugins/core/views/views/auth/sign/up/sign-up-view.tsx similarity index 94% rename from frontend/themes/1/core/views/auth/sign/up/sign-up-view.tsx rename to frontend/plugins/core/views/views/auth/sign/up/sign-up-view.tsx index e9dc4848a..a2eb2ad07 100644 --- a/frontend/themes/1/core/views/auth/sign/up/sign-up-view.tsx +++ b/frontend/plugins/core/views/views/auth/sign/up/sign-up-view.tsx @@ -9,7 +9,7 @@ import { } from "@/components/ui/card"; import { FormSignUp } from "./form/form-sign-up"; -export default function SignUpView() { +export const SignUpView = () => { const t = useTranslations("core.sign_up"); return ( @@ -28,4 +28,4 @@ export default function SignUpView() { ); -} +}; diff --git a/frontend/themes/1/core/views/global/error/error-view.tsx b/frontend/plugins/core/views/views/global/error/error-view.tsx similarity index 95% rename from frontend/themes/1/core/views/global/error/error-view.tsx rename to frontend/plugins/core/views/views/global/error/error-view.tsx index aefc28b3c..ec1f68db0 100644 --- a/frontend/themes/1/core/views/global/error/error-view.tsx +++ b/frontend/plugins/core/views/views/global/error/error-view.tsx @@ -14,7 +14,7 @@ import { import { buttonVariants } from "@/components/ui/button"; import { ErrorViewProps } from "@/components/views/error-view-ssr"; -export default function ErrorView({ className, code }: ErrorViewProps) { +export const ErrorView = ({ className, code }: ErrorViewProps) => { const t = useTranslations("core"); return ( @@ -47,4 +47,4 @@ export default function ErrorView({ className, code }: ErrorViewProps) { ); -} +}; diff --git a/frontend/themes/1/core/views/global/loading/loading-view.tsx b/frontend/plugins/core/views/views/global/loading/loading-view.tsx similarity index 100% rename from frontend/themes/1/core/views/global/loading/loading-view.tsx rename to frontend/plugins/core/views/views/global/loading/loading-view.tsx diff --git a/frontend/themes/1/core/views/profile/profile-view.tsx b/frontend/plugins/core/views/views/profile/profile-view.tsx similarity index 92% rename from frontend/themes/1/core/views/profile/profile-view.tsx rename to frontend/plugins/core/views/views/profile/profile-view.tsx index b2e690157..941ca4069 100644 --- a/frontend/themes/1/core/views/profile/profile-view.tsx +++ b/frontend/plugins/core/views/views/profile/profile-view.tsx @@ -3,11 +3,11 @@ import { Core_Members__ProfilesQuery } from "@/graphql/hooks"; import { AvatarUser } from "@/components/user/avatar/avatar-user"; import { useTextLang } from "@/plugins/core/hooks/use-text-lang"; -export interface ProfileViewProps { +interface Props { data: Core_Members__ProfilesQuery; } -export default function ProfileView({ data: dataApi }: ProfileViewProps) { +export const ProfileView = ({ data: dataApi }: Props) => { const { convertText } = useTextLang(); const { edges } = dataApi.core_members__show; @@ -40,4 +40,4 @@ export default function ProfileView({ data: dataApi }: ProfileViewProps) {
test
); -} +}; diff --git a/frontend/themes/1/core/views/settings/layout-settings-view.tsx b/frontend/plugins/core/views/views/settings/layout-settings-view.tsx similarity index 90% rename from frontend/themes/1/core/views/settings/layout-settings-view.tsx rename to frontend/plugins/core/views/views/settings/layout-settings-view.tsx index 9c2137807..32f95389c 100644 --- a/frontend/themes/1/core/views/settings/layout-settings-view.tsx +++ b/frontend/plugins/core/views/views/settings/layout-settings-view.tsx @@ -9,7 +9,7 @@ interface Props { children: React.ReactNode; } -export default function LayoutSettingsView({ children }: Props) { +export const LayoutSettingsView = ({ children }: Props) => { const t = useTranslations("core"); return ( @@ -26,4 +26,4 @@ export default function LayoutSettingsView({ children }: Props) { ); -} +}; diff --git a/frontend/themes/1/core/views/settings/nav/drawer.tsx b/frontend/plugins/core/views/views/settings/nav/drawer.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/nav/drawer.tsx rename to frontend/plugins/core/views/views/settings/nav/drawer.tsx diff --git a/frontend/themes/1/core/views/settings/nav/item/item-nav-settings.tsx b/frontend/plugins/core/views/views/settings/nav/item/item-nav-settings.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/nav/item/item-nav-settings.tsx rename to frontend/plugins/core/views/views/settings/nav/item/item-nav-settings.tsx diff --git a/frontend/themes/1/core/views/settings/nav/item/link/link-item-nav-settings.tsx b/frontend/plugins/core/views/views/settings/nav/item/link/link-item-nav-settings.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/nav/item/link/link-item-nav-settings.tsx rename to frontend/plugins/core/views/views/settings/nav/item/link/link-item-nav-settings.tsx diff --git a/frontend/themes/1/core/views/settings/nav/nav-settings.tsx b/frontend/plugins/core/views/views/settings/nav/nav-settings.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/nav/nav-settings.tsx rename to frontend/plugins/core/views/views/settings/nav/nav-settings.tsx diff --git a/frontend/themes/1/core/views/settings/views/devices/content.tsx b/frontend/plugins/core/views/views/settings/views/devices/content.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/views/devices/content.tsx rename to frontend/plugins/core/views/views/settings/views/devices/content.tsx diff --git a/frontend/themes/1/core/views/settings/views/devices/devices-settings-view.tsx b/frontend/plugins/core/views/views/settings/views/devices/devices-settings-view.tsx similarity index 79% rename from frontend/themes/1/core/views/settings/views/devices/devices-settings-view.tsx rename to frontend/plugins/core/views/views/settings/views/devices/devices-settings-view.tsx index b754d55b2..5d25d59fa 100644 --- a/frontend/themes/1/core/views/settings/views/devices/devices-settings-view.tsx +++ b/frontend/plugins/core/views/views/settings/views/devices/devices-settings-view.tsx @@ -4,12 +4,11 @@ import { CardContent, CardDescription, CardHeader } from "@/components/ui/card"; import { Core_Sessions__Devices__ShowQuery } from "@/graphql/hooks"; import { ContentDevicesSettings } from "./content"; -export interface DevicesSettingsViewProps - extends Core_Sessions__Devices__ShowQuery { +interface Props extends Core_Sessions__Devices__ShowQuery { loginToken: string; } -export default function DevicesSettingsView(props: DevicesSettingsViewProps) { +export const DevicesSettingsView = (props: Props) => { const t = useTranslations("core.settings.devices"); return ( @@ -26,4 +25,4 @@ export default function DevicesSettingsView(props: DevicesSettingsViewProps) { ); -} +}; diff --git a/frontend/themes/1/core/views/settings/views/files/content.tsx b/frontend/plugins/core/views/views/settings/views/files/content.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/views/files/content.tsx rename to frontend/plugins/core/views/views/settings/views/files/content.tsx diff --git a/frontend/themes/1/core/views/settings/views/files/files-settings-view.tsx b/frontend/plugins/core/views/views/settings/views/files/files-settings-view.tsx similarity index 90% rename from frontend/themes/1/core/views/settings/views/files/files-settings-view.tsx rename to frontend/plugins/core/views/views/settings/views/files/files-settings-view.tsx index 16fe8e0b7..9fc90b11b 100644 --- a/frontend/themes/1/core/views/settings/views/files/files-settings-view.tsx +++ b/frontend/plugins/core/views/views/settings/views/files/files-settings-view.tsx @@ -11,9 +11,7 @@ const ContentFilesSettings = React.lazy(async () => })) ); -export default function FilesSettingsView( - props: Core_Members__Files__ShowQuery -) { +export const FilesSettingsView = (props: Core_Members__Files__ShowQuery) => { const t = useTranslations("core.settings.files"); return ( @@ -32,4 +30,4 @@ export default function FilesSettingsView( ); -} +}; diff --git a/frontend/themes/1/core/views/settings/views/notifications/header/header-notifications-settings.tsx b/frontend/plugins/core/views/views/settings/views/notifications/header/header-notifications-settings.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/views/notifications/header/header-notifications-settings.tsx rename to frontend/plugins/core/views/views/settings/views/notifications/header/header-notifications-settings.tsx diff --git a/frontend/themes/1/core/views/settings/views/notifications/notifications-settings-view.tsx b/frontend/plugins/core/views/views/settings/views/notifications/notifications-settings-view.tsx similarity index 82% rename from frontend/themes/1/core/views/settings/views/notifications/notifications-settings-view.tsx rename to frontend/plugins/core/views/views/settings/views/notifications/notifications-settings-view.tsx index b561968b7..094dc17cc 100644 --- a/frontend/themes/1/core/views/settings/views/notifications/notifications-settings-view.tsx +++ b/frontend/plugins/core/views/views/settings/views/notifications/notifications-settings-view.tsx @@ -1,11 +1,11 @@ import { CardContent } from "@/components/ui/card"; import { HeaderNotificationsSettings } from "./header/header-notifications-settings"; -export default function NotificationsSettingsView() { +export const NotificationsSettingsView = () => { return ( <> Not implemented! ); -} +}; diff --git a/frontend/themes/1/core/views/settings/views/overview/header/change-avatar/change-avatar.tsx b/frontend/plugins/core/views/views/settings/views/overview/header/change-avatar/change-avatar.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/views/overview/header/change-avatar/change-avatar.tsx rename to frontend/plugins/core/views/views/settings/views/overview/header/change-avatar/change-avatar.tsx diff --git a/frontend/themes/1/core/views/settings/views/overview/header/change-avatar/modal/cropper/cropper-modal-change-avatar.tsx b/frontend/plugins/core/views/views/settings/views/overview/header/change-avatar/modal/cropper/cropper-modal-change-avatar.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/views/overview/header/change-avatar/modal/cropper/cropper-modal-change-avatar.tsx rename to frontend/plugins/core/views/views/settings/views/overview/header/change-avatar/modal/cropper/cropper-modal-change-avatar.tsx diff --git a/frontend/themes/1/core/views/settings/views/overview/header/change-avatar/modal/modal-change-avatar.tsx b/frontend/plugins/core/views/views/settings/views/overview/header/change-avatar/modal/modal-change-avatar.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/views/overview/header/change-avatar/modal/modal-change-avatar.tsx rename to frontend/plugins/core/views/views/settings/views/overview/header/change-avatar/modal/modal-change-avatar.tsx diff --git a/frontend/themes/1/core/views/settings/views/overview/header/header-overview-settings.tsx b/frontend/plugins/core/views/views/settings/views/overview/header/header-overview-settings.tsx similarity index 100% rename from frontend/themes/1/core/views/settings/views/overview/header/header-overview-settings.tsx rename to frontend/plugins/core/views/views/settings/views/overview/header/header-overview-settings.tsx diff --git a/frontend/themes/1/core/views/settings/views/overview/overview-settings-view.tsx b/frontend/plugins/core/views/views/settings/views/overview/overview-settings-view.tsx similarity index 69% rename from frontend/themes/1/core/views/settings/views/overview/overview-settings-view.tsx rename to frontend/plugins/core/views/views/settings/views/overview/overview-settings-view.tsx index b92a94cce..0b070a43d 100644 --- a/frontend/themes/1/core/views/settings/views/overview/overview-settings-view.tsx +++ b/frontend/plugins/core/views/views/settings/views/overview/overview-settings-view.tsx @@ -1,5 +1,5 @@ import { HeaderOverviewSettings } from "./header/header-overview-settings"; -export default function OverviewSettingsView() { +export const OverviewSettingsView = () => { return ; -} +}; diff --git a/frontend/themes/1/config.json b/frontend/themes/1/config.json deleted file mode 100644 index 7b2443293..000000000 --- a/frontend/themes/1/config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "Default Theme", - "version": "0.1.0", - "version_code": 10000, - "author": "VitNode", - "author_url": "https://vitnode.com/", - "support_url": "https://github.com/aXenDeveloper/vitnode/issues" -}