diff --git a/app/auth/signin/page.tsx b/src/app/auth/signin/page.tsx
similarity index 71%
rename from app/auth/signin/page.tsx
rename to src/app/auth/signin/page.tsx
index 8666542..efd6adc 100644
--- a/app/auth/signin/page.tsx
+++ b/src/app/auth/signin/page.tsx
@@ -1,9 +1,9 @@
-import Link from 'next/link';
+import Link from "next/link";
-import { SignInForm } from '@/features/auth-credentials-form';
-import { cn } from '@/shared/lib/utils';
-import { AUTH_PAGES } from '@/shared/routes';
-import { buttonVariants } from '@/shared/ui/button';
+import { SignInForm } from "../../../features/auth-credentials-form";
+import { cn } from "../../../shared/lib/utils";
+import { AUTH_PAGES } from "../../../shared/routes";
+import { buttonVariants } from "../../../shared/ui/button";
export default function SignInPage() {
return (
@@ -12,8 +12,8 @@ export default function SignInPage() {
Регистрация
diff --git a/app/auth/signup/page.tsx b/src/app/auth/signup/page.tsx
similarity index 71%
rename from app/auth/signup/page.tsx
rename to src/app/auth/signup/page.tsx
index 1080224..52f9b42 100644
--- a/app/auth/signup/page.tsx
+++ b/src/app/auth/signup/page.tsx
@@ -1,9 +1,9 @@
-import Link from 'next/link';
+import Link from "next/link";
-import { SignUpForm } from '@/features/auth-credentials-form';
-import { cn } from '@/shared/lib/utils';
-import { AUTH_PAGES } from '@/shared/routes';
-import { buttonVariants } from '@/shared/ui/button';
+import { SignUpForm } from "../../../features/auth-credentials-form";
+import { cn } from "../../../shared/lib/utils";
+import { AUTH_PAGES } from "../../../shared/routes";
+import { buttonVariants } from "@/shared/ui/button";
export default function SignUPPage() {
return (
@@ -12,8 +12,8 @@ export default function SignUPPage() {
Войти
diff --git a/app/dashboard/account/page.tsx b/src/app/dashboard/account/page.tsx
similarity index 96%
rename from app/dashboard/account/page.tsx
rename to src/app/dashboard/account/page.tsx
index 1b390ac..df9a39a 100644
--- a/app/dashboard/account/page.tsx
+++ b/src/app/dashboard/account/page.tsx
@@ -1,14 +1,18 @@
import { Metadata } from "next";
+import { redirect } from "next/navigation";
import { Button } from "@/shared/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/shared/ui/card";
import { Input } from "@/shared/ui/input";
+import { DASHBOARD_PAGES } from "@/shared/routes";
export const metadata: Metadata = {
title: "Настройки",
};
export default async function SettingsPage() {
+ redirect(DASHBOARD_PAGES.PROFILES);
+
return (
Управление аккаунтом
diff --git a/app/dashboard/integrations/page.tsx b/src/app/dashboard/integrations/page.tsx
similarity index 77%
rename from app/dashboard/integrations/page.tsx
rename to src/app/dashboard/integrations/page.tsx
index 7b63be4..ada37f5 100644
--- a/app/dashboard/integrations/page.tsx
+++ b/src/app/dashboard/integrations/page.tsx
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
-import { IntegrationsPage } from "@/pages/integrations";
+import { IntegrationsPage } from "@/views/integrations";
export const metadata: Metadata = {
title: "Интеграции",
diff --git a/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx
similarity index 100%
rename from app/dashboard/layout.tsx
rename to src/app/dashboard/layout.tsx
diff --git a/app/dashboard/page.tsx b/src/app/dashboard/page.tsx
similarity index 70%
rename from app/dashboard/page.tsx
rename to src/app/dashboard/page.tsx
index e534a0e..6f619c5 100644
--- a/app/dashboard/page.tsx
+++ b/src/app/dashboard/page.tsx
@@ -1,11 +1,16 @@
import { Metadata } from "next";
+import { redirect } from "next/navigation";
+
import { Breadcrumbs } from "@/shared/ui/Breadcrumbs";
+import { DASHBOARD_PAGES } from "@/shared/routes";
export const metadata: Metadata = {
title: "Дашборд",
};
export default async function DashboardPage() {
+ redirect(DASHBOARD_PAGES.PROFILES);
+
return (
<>
diff --git a/app/dashboard/profile/[name]/error.tsx b/src/app/dashboard/profile/[name]/error.tsx
similarity index 100%
rename from app/dashboard/profile/[name]/error.tsx
rename to src/app/dashboard/profile/[name]/error.tsx
diff --git a/app/dashboard/profile/[name]/loading.tsx b/src/app/dashboard/profile/[name]/loading.tsx
similarity index 100%
rename from app/dashboard/profile/[name]/loading.tsx
rename to src/app/dashboard/profile/[name]/loading.tsx
diff --git a/app/dashboard/profile/[name]/page.tsx b/src/app/dashboard/profile/[name]/page.tsx
similarity index 87%
rename from app/dashboard/profile/[name]/page.tsx
rename to src/app/dashboard/profile/[name]/page.tsx
index c4ee650..9ef0720 100644
--- a/app/dashboard/profile/[name]/page.tsx
+++ b/src/app/dashboard/profile/[name]/page.tsx
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
-import { ProfilePage } from "@/pages/profile";
+import { ProfilePage } from "@/views/profile";
export async function generateMetadata({ params: { name } }: Props): Promise {
return { title: `Настройка профиля ${name}` };
diff --git a/app/dashboard/profiles/page.tsx b/src/app/dashboard/profiles/page.tsx
similarity index 78%
rename from app/dashboard/profiles/page.tsx
rename to src/app/dashboard/profiles/page.tsx
index 421ad04..87bf1fb 100644
--- a/app/dashboard/profiles/page.tsx
+++ b/src/app/dashboard/profiles/page.tsx
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
-import { ProfilesPage } from "@/pages/profiles";
+import { ProfilesPage } from "@/views/profiles";
export const metadata: Metadata = {
title: "Профили",
diff --git a/app/dashboard/settings/page.tsx b/src/app/dashboard/settings/page.tsx
similarity index 80%
rename from app/dashboard/settings/page.tsx
rename to src/app/dashboard/settings/page.tsx
index 3cec6dc..7bf68cc 100644
--- a/app/dashboard/settings/page.tsx
+++ b/src/app/dashboard/settings/page.tsx
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
-import { SettingsPage } from "@/pages/settings";
+import { SettingsPage } from "@/views/settings";
export const metadata: Metadata = {
title: "Настройки платформы",
diff --git a/app/favicon.ico b/src/app/favicon.ico
similarity index 100%
rename from app/favicon.ico
rename to src/app/favicon.ico
diff --git a/app/globals.css b/src/app/globals.css
similarity index 100%
rename from app/globals.css
rename to src/app/globals.css
diff --git a/app/layout.tsx b/src/app/layout.tsx
similarity index 83%
rename from app/layout.tsx
rename to src/app/layout.tsx
index 76a6acb..8ad1de5 100644
--- a/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -3,9 +3,9 @@ import type { Metadata } from "next";
import { Manrope } from "next/font/google";
import "./globals.css";
-import { QueryProvider } from "@/app/providers/QueryProvider";
-import { ThemeProvider } from "@/app/providers/ThemeProvider";
-import { TooltipProvider } from "@/app/providers/TooltipProvider";
+import { QueryProvider } from "@/core/providers/QueryProvider";
+import { ThemeProvider } from "@/core/providers/ThemeProvider";
+import { TooltipProvider } from "@/core/providers/TooltipProvider";
import { cn } from "@/shared/lib/utils";
import { Toaster } from "@/shared/ui/toaster";
diff --git a/app/page.tsx b/src/app/page.tsx
similarity index 100%
rename from app/page.tsx
rename to src/app/page.tsx
diff --git a/src/app/api/index.ts b/src/core/api/index.ts
similarity index 100%
rename from src/app/api/index.ts
rename to src/core/api/index.ts
diff --git a/src/app/providers/QueryProvider.tsx b/src/core/providers/QueryProvider.tsx
similarity index 100%
rename from src/app/providers/QueryProvider.tsx
rename to src/core/providers/QueryProvider.tsx
diff --git a/src/app/providers/ThemeProvider.tsx b/src/core/providers/ThemeProvider.tsx
similarity index 100%
rename from src/app/providers/ThemeProvider.tsx
rename to src/core/providers/ThemeProvider.tsx
diff --git a/src/app/providers/TooltipProvider.tsx b/src/core/providers/TooltipProvider.tsx
similarity index 100%
rename from src/app/providers/TooltipProvider.tsx
rename to src/core/providers/TooltipProvider.tsx
diff --git a/src/entities/IntegrationCard/ui/IntegrationCard.tsx b/src/entities/IntegrationCard/ui/IntegrationCard.tsx
index 5b3909f..5ae3ba8 100644
--- a/src/entities/IntegrationCard/ui/IntegrationCard.tsx
+++ b/src/entities/IntegrationCard/ui/IntegrationCard.tsx
@@ -1,18 +1,16 @@
+import { ReactNode } from "react";
+
import { Card } from "@/shared/ui/card";
import { Button } from "@/shared/ui/button";
-import { PlugIcon, Settings2 } from "lucide-react";
interface IntegrationCardProps {
title: string;
description?: string;
- status?: "CONNECTED" | "UNCONNECTED";
- buttonText?: string;
- isDisabled?: boolean;
- action?: () => void;
+ dialog?: ReactNode;
}
export const IntegrationCard = (props: IntegrationCardProps) => {
- const { title, description, buttonText = "Подключить", status, isDisabled, action } = props;
+ const { title, description, dialog } = props;
return (
@@ -22,11 +20,13 @@ export const IntegrationCard = (props: IntegrationCardProps) => {
{description && {description}
}
-
+ {dialog ? (
+ dialog
+ ) : (
+
+ )}
);
};
diff --git a/src/features/connect-textures-form/ui/ConnectTexturesForm.tsx b/src/features/connect-textures-form/ui/ConnectTexturesForm.tsx
index 3e420bf..cef8450 100644
--- a/src/features/connect-textures-form/ui/ConnectTexturesForm.tsx
+++ b/src/features/connect-textures-form/ui/ConnectTexturesForm.tsx
@@ -4,35 +4,34 @@ import React from "react";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
-
-import { cn } from "@/shared/lib/utils";
import { Button } from "@/shared/ui/button";
import { Form, FormControl, FormItem, FormLabel, FormMessage } from "@/shared/ui/form";
import { Input } from "@/shared/ui/input";
import { TexturesServiceType } from "@/shared/enums";
-import { useConnectTextures, useEditConnectTextures } from "@/shared/hooks";
+import { useEditConnectTextures } from "@/shared/hooks";
import { Icons } from "@/shared/ui/icons";
import { ConnectTexturesFormSchemaType, ConnectTexturesSchema } from "../lib/static";
+import { TextureServiceBaseEntity } from "@/shared/api/contracts";
interface ConnectTexturesFormProps extends React.HTMLAttributes {
+ skins?: TextureServiceBaseEntity;
+ cloaks?: TextureServiceBaseEntity;
onOpenChange: (open: boolean) => void;
}
export function ConnectTexturesForm({
- className,
+ skins,
+ cloaks,
onOpenChange,
...props
}: ConnectTexturesFormProps) {
- const { data: textures_skins } = useConnectTextures(TexturesServiceType.TEXTURES_SERVICE_SKINS);
- const { data: textures_cloaks } = useConnectTextures(TexturesServiceType.TEXTURES_SERVICE_CLOAKS);
-
const { mutateAsync, isPending } = useEditConnectTextures();
const form = useForm({
values: {
- url_skins: textures_skins?.url || "",
- url_cloaks: textures_cloaks?.url || "",
+ url_skins: skins?.url || "",
+ url_cloaks: cloaks?.url || "",
},
resolver: zodResolver(ConnectTexturesSchema),
});
@@ -58,7 +57,7 @@ export function ConnectTexturesForm({
};
return (
-
-
-
-
-
-
-
-
-
>
);
};
diff --git a/src/pages/profile/index.ts b/src/views/profile/index.ts
similarity index 100%
rename from src/pages/profile/index.ts
rename to src/views/profile/index.ts
diff --git a/src/pages/profile/ui/Profile.tsx b/src/views/profile/ui/Profile.tsx
similarity index 100%
rename from src/pages/profile/ui/Profile.tsx
rename to src/views/profile/ui/Profile.tsx
diff --git a/src/pages/profile/ui/ProfileLoading.tsx b/src/views/profile/ui/ProfileLoading.tsx
similarity index 100%
rename from src/pages/profile/ui/ProfileLoading.tsx
rename to src/views/profile/ui/ProfileLoading.tsx
diff --git a/src/pages/profiles/index.ts b/src/views/profiles/index.ts
similarity index 100%
rename from src/pages/profiles/index.ts
rename to src/views/profiles/index.ts
diff --git a/src/pages/profiles/ui/Profiles.tsx b/src/views/profiles/ui/Profiles.tsx
similarity index 54%
rename from src/pages/profiles/ui/Profiles.tsx
rename to src/views/profiles/ui/Profiles.tsx
index 814300c..8f10d4d 100644
--- a/src/pages/profiles/ui/Profiles.tsx
+++ b/src/views/profiles/ui/Profiles.tsx
@@ -1,18 +1,10 @@
-"use client";
-
-import { useState } from "react";
-
import { CreateProfileDialog } from "@/widgets/create-profile-dialog";
import { ProfilesTable } from "@/widgets/profiles-table";
-import { Button } from "@/shared/ui/button";
-import { Breadcrumbs } from "@/shared/ui/Breadcrumbs/ui/Breadcrumbs";
+import { Breadcrumbs } from "@/shared/ui/Breadcrumbs";
import { DASHBOARD_PAGES } from "@/shared/routes";
export const ProfilesPage = () => {
- const [isCreateProfileDialog, setIsCreateProfileDialog] = useState(false);
- const onCreateProfileDialogToggle = () => setIsCreateProfileDialog((prev) => !prev);
-
return (
<>
{
Профили
-
+
-
-
>
);
};
diff --git a/src/pages/settings/index.ts b/src/views/settings/index.ts
similarity index 100%
rename from src/pages/settings/index.ts
rename to src/views/settings/index.ts
diff --git a/src/pages/settings/ui/Settings.tsx b/src/views/settings/ui/Settings.tsx
similarity index 98%
rename from src/pages/settings/ui/Settings.tsx
rename to src/views/settings/ui/Settings.tsx
index 99d3dfc..86d9acb 100644
--- a/src/pages/settings/ui/Settings.tsx
+++ b/src/views/settings/ui/Settings.tsx
@@ -1,5 +1,3 @@
-"use client";
-
import { EditSettingsPlatformForm } from "@/features/edit-settings-platform-form";
import { Breadcrumbs } from "@/shared/ui/Breadcrumbs";
diff --git a/src/widgets/choose-authentication-method-dialog/ui/ChooseAuthenticationMethodDialog.tsx b/src/widgets/choose-authentication-method-dialog/ui/ChooseAuthenticationMethodDialog.tsx
index d60c365..fd49001 100644
--- a/src/widgets/choose-authentication-method-dialog/ui/ChooseAuthenticationMethodDialog.tsx
+++ b/src/widgets/choose-authentication-method-dialog/ui/ChooseAuthenticationMethodDialog.tsx
@@ -1,23 +1,34 @@
+"use client";
+
import { useEffect, useState } from "react";
-import { AuthenticationFormDle } from "@/features/authentication-dle-form";
-import { AuthenticationFormAzuriom } from "@/features/authentication-azuriom-form";
+import { Settings2 } from "lucide-react";
+
import { AuthenticationFormUndefined } from "@/features/authentication-undefined-form";
+import { AuthenticationFormDle } from "@/features/authentication-dle-form";
import { AuthenticationAnyForm } from "@/features/authentication-any-form";
+import { AuthenticationFormAzuriom } from "@/features/authentication-azuriom-form";
+
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/shared/ui/dialog";
-import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/ui/dialog";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/shared/ui/select";
import { AuthenticationType, AuthenticationTypeOption } from "@/shared/enums";
import { useActiveAuthIntegrations, useAuthIntegrations } from "@/shared/hooks";
+import { Button } from "@/shared/ui/button";
-interface AuthenticationMethodDialogProps {
- open: boolean;
- onOpenChange: (open: boolean) => void;
-}
+export function ChooseAuthenticationMethodDialog() {
+ const [open, setOpen] = useState(false);
+ const onOpenChange = () => setOpen((prev) => !prev);
-export function ChooseAuthenticationMethodDialog(props: AuthenticationMethodDialogProps) {
- const { data: integrations } = useAuthIntegrations();
- const { data: activeIntegrations } = useActiveAuthIntegrations();
+ const { data: integrations, isLoading: isLoadingIntegration } = useAuthIntegrations();
+ const { data: activeIntegrations, isLoading: isLoadingActiveIntegration } =
+ useActiveAuthIntegrations();
const [authenticationTab, setAuthenticationTab] = useState(String(activeIntegrations?.authType));
const onAuthenticationTabToggle = (tab: string) => setAuthenticationTab(() => tab);
@@ -35,7 +46,18 @@ export function ChooseAuthenticationMethodDialog(props: AuthenticationMethodDial
Number(authenticationTab) === AuthenticationType.AUTHENTICATION_TYPE_AZURIOM;
return (
-