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 ( -
+
{} +interface InstallClientFormProps extends React.HTMLAttributes { + onOpenChange: () => void; +} -export function InstallClientForm({ className, ...props }: InstallClientFormProps) { +export function InstallClientForm({ className, onOpenChange, ...props }: InstallClientFormProps) { const { connectionHub, process, percent } = useConnectionHub(); const { data: branches } = useGithubLauncherVersions(); const { toast } = useToast(); @@ -36,7 +34,9 @@ export function InstallClientForm({ className, ...props }: InstallClientFormProp ) => { process.onIsProcessingToggle(); try { - connectionHub?.invoke("Download", data.branch, data.host, data.folder); + connectionHub?.invoke("Download", data.branch, data.host, data.folder).then(() => { + onOpenChange(); + }); } catch (error: unknown) { toast({ variant: "destructive", diff --git a/src/shared/services/AuthService.ts b/src/shared/services/AuthService.ts index 2467e0a..fefb80e 100644 --- a/src/shared/services/AuthService.ts +++ b/src/shared/services/AuthService.ts @@ -1,4 +1,4 @@ -import { $api } from "@/app/api"; +import { $api } from "@/core/api"; import { TPostSignInRequest, TPostSignInResponse, diff --git a/src/shared/services/IntegrationService.ts b/src/shared/services/IntegrationService.ts index de49bf9..4c3edc2 100644 --- a/src/shared/services/IntegrationService.ts +++ b/src/shared/services/IntegrationService.ts @@ -1,6 +1,6 @@ import { AxiosResponse } from "axios"; -import { $api } from "@/app/api"; +import { $api } from "@/core/api"; import { TGetActiveAuthIntegrationsRequest, TGetActiveAuthIntegrationsResponse, diff --git a/src/shared/services/ProfileService.ts b/src/shared/services/ProfileService.ts index cc8fac1..a98d62e 100644 --- a/src/shared/services/ProfileService.ts +++ b/src/shared/services/ProfileService.ts @@ -1,4 +1,4 @@ -import { $api } from "@/app/api"; +import { $api } from "@/core/api"; import { TDeleteProfileRequest, TDeleteProfileResponse, diff --git a/src/shared/services/SettingsService.ts b/src/shared/services/SettingsService.ts index 336edea..2bd2d4c 100644 --- a/src/shared/services/SettingsService.ts +++ b/src/shared/services/SettingsService.ts @@ -1,4 +1,4 @@ -import { $api } from "@/app/api"; +import { $api } from "@/core/api"; import { TGetSettingsPlatformRequest, TGetSettingsPlatformResponse, diff --git a/src/pages/integrations/index.ts b/src/views/integrations/index.ts similarity index 100% rename from src/pages/integrations/index.ts rename to src/views/integrations/index.ts diff --git a/src/pages/integrations/ui/Integrations.tsx b/src/views/integrations/ui/Integrations.tsx similarity index 52% rename from src/pages/integrations/ui/Integrations.tsx rename to src/views/integrations/ui/Integrations.tsx index d0e9a88..3563125 100644 --- a/src/pages/integrations/ui/Integrations.tsx +++ b/src/views/integrations/ui/Integrations.tsx @@ -1,33 +1,14 @@ -"use client"; - -import { useState } from "react"; - import { GenerateLauncherDialog } from "@/widgets/generate-launcher-dialog"; import { ChooseAuthenticationMethodDialog } from "@/widgets/choose-authentication-method-dialog"; -import { ConnectSentryDialog } from "@/widgets/connect-sentry-dialog"; import { ConnectTexturesDialog } from "@/widgets/connect-textures-dialog"; +import { ConnectSentryDialog } from "@/widgets/connect-sentry-dialog"; import { IntegrationCard } from "@/entities/IntegrationCard"; import { Breadcrumbs } from "@/shared/ui/Breadcrumbs"; -import { useSentry } from "@/shared/hooks"; import { DASHBOARD_PAGES } from "@/shared/routes"; export const IntegrationsPage = () => { - const [isGenerateLauncherDialogOpen, setIsGenerateLauncherDialogOpen] = useState(false); - const onGenerateLauncherDialogToggle = () => setIsGenerateLauncherDialogOpen((prev) => !prev); - - const [isAuthenticationDialogOpen, setIsAuthenticationDialogOpen] = useState(false); - const onAuthenticationDialogToggle = () => setIsAuthenticationDialogOpen((prev) => !prev); - - const [isSentryConnectDialogOpen, setIsSentryConnectDialogOpen] = useState(false); - const onSentryConnectDialogToggle = () => setIsSentryConnectDialogOpen((prev) => !prev); - - const [isConnectTexturesDialogOpen, setIsConnectTexturesDialogOpen] = useState(false); - const onConnectTexturesDialogToggle = () => setIsConnectTexturesDialogOpen((prev) => !prev); - - const { data: sentry, isLoading: isLoadingSentry } = useSentry(); - 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 ( - + + + + Метод аутентификации @@ -64,16 +86,10 @@ export function ChooseAuthenticationMethodDialog(props: AuthenticationMethodDial - {isFormUndefined && ( - props.onOpenChange(false)} /> - )} - {isFormDatalife && ( - props.onOpenChange(false)} /> - )} - {isFormAny && props.onOpenChange(false)} />} - {isFormAzuriom && ( - props.onOpenChange(false)} /> - )} + {isFormUndefined && } + {isFormDatalife && } + {isFormAny && } + {isFormAzuriom && } diff --git a/src/widgets/connect-sentry-dialog/ui/ConnectSentryDialog.tsx b/src/widgets/connect-sentry-dialog/ui/ConnectSentryDialog.tsx index 9070ecf..52a8ec3 100644 --- a/src/widgets/connect-sentry-dialog/ui/ConnectSentryDialog.tsx +++ b/src/widgets/connect-sentry-dialog/ui/ConnectSentryDialog.tsx @@ -1,20 +1,46 @@ -import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/ui/dialog"; -import { ConnectSentryForm } from "@/features/connect-sentry-form/ui/ConnectSentryForm"; +"use client"; -interface AuthenticationMethodDialogProps { - open: boolean; - onOpenChange: (open: boolean) => void; -} +import { PlugIcon, Settings2 } from "lucide-react"; + +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/shared/ui/dialog"; +import { useSentry } from "@/shared/hooks"; +import { Button } from "@/shared/ui/button"; +import { ConnectSentryForm } from "@/features/connect-sentry-form"; +import { useState } from "react"; + +export function ConnectSentryDialog() { + const [open, setOpen] = useState(false); + const onOpenChange = () => setOpen((prev) => !prev); + + const { data: sentry, isLoading } = useSentry(); + + const connectionText = Boolean(sentry?.url) ? "Изменить" : "Подключить"; + const connectionIcon = Boolean(sentry?.url) ? ( + + ) : ( + + ); -export function ConnectSentryDialog(props: AuthenticationMethodDialogProps) { return ( - + + + + Подключение Sentry
- props.onOpenChange(false)} /> +
diff --git a/src/widgets/connect-textures-dialog/ui/ConnectTexturesDialog.tsx b/src/widgets/connect-textures-dialog/ui/ConnectTexturesDialog.tsx index b44ff1b..0b82b98 100644 --- a/src/widgets/connect-textures-dialog/ui/ConnectTexturesDialog.tsx +++ b/src/widgets/connect-textures-dialog/ui/ConnectTexturesDialog.tsx @@ -1,20 +1,55 @@ +"use client"; + +import { useState } from "react"; + +import { Settings2 } from "lucide-react"; + import { ConnectTexturesForm } from "@/features/connect-textures-form"; -import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/ui/dialog"; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/shared/ui/dialog"; +import { Button } from "@/shared/ui/button"; +import { useConnectTextures } from "@/shared/hooks"; +import { TexturesServiceType } from "@/shared/enums"; -interface GenerateLauncherDialogProps { - open: boolean; - onOpenChange: (open: boolean) => void; -} +export function ConnectTexturesDialog() { + const [open, setOpen] = useState(false); + const onOpenChange = () => setOpen((prev) => !prev); + + const { data: textures_skins, isLoading: isLoadingSkins } = useConnectTextures( + TexturesServiceType.TEXTURES_SERVICE_SKINS, + ); + const { data: textures_cloaks, isLoading: isLoadingCloaks } = useConnectTextures( + TexturesServiceType.TEXTURES_SERVICE_CLOAKS, + ); -export function ConnectTexturesDialog(props: GenerateLauncherDialogProps) { return ( - + + + + Подключение сервиса скинов и плащей - + ); diff --git a/src/widgets/create-profile-dialog/ui/CreateProfileDialog.tsx b/src/widgets/create-profile-dialog/ui/CreateProfileDialog.tsx index d820661..82fc92f 100644 --- a/src/widgets/create-profile-dialog/ui/CreateProfileDialog.tsx +++ b/src/widgets/create-profile-dialog/ui/CreateProfileDialog.tsx @@ -1,18 +1,31 @@ +"use client"; + +import { useState } from "react"; + import { CreateProfileForm } from "@/features/create-profile-form"; -import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/ui/dialog"; -interface CreateProfileDialogProps { - open: boolean; - onOpenChange: (open: boolean) => void; -} +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/shared/ui/dialog"; +import { Button } from "@/shared/ui/button"; + +export function CreateProfileDialog() { + const [open, setOpen] = useState(false); + const onOpenChange = () => setOpen((prev) => !prev); -export function CreateProfileDialog(props: CreateProfileDialogProps) { return ( - + + + + Создание профиля - props.onOpenChange(false)} /> + diff --git a/src/widgets/generate-launcher-dialog/ui/GenerateLauncherDialog.tsx b/src/widgets/generate-launcher-dialog/ui/GenerateLauncherDialog.tsx index 9281503..728afb0 100644 --- a/src/widgets/generate-launcher-dialog/ui/GenerateLauncherDialog.tsx +++ b/src/widgets/generate-launcher-dialog/ui/GenerateLauncherDialog.tsx @@ -1,19 +1,37 @@ -import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/ui/dialog"; +"use client"; + +import { useState } from "react"; + +import { Settings2 } from "lucide-react"; + import { InstallClientForm } from "@/features/install-client-form"; -interface GenerateLauncherDialogProps { - open: boolean; - onOpenChange: (open: boolean) => void; -} +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/shared/ui/dialog"; +import { Button } from "@/shared/ui/button"; + +export function GenerateLauncherDialog() { + const [open, setOpen] = useState(false); + const onOpenChange = () => setOpen((prev) => !prev); -export function GenerateLauncherDialog(props: GenerateLauncherDialogProps) { return ( - + + + + Сборка лаунчера - + ); diff --git a/tailwind.config.ts b/tailwind.config.ts index ea94dcc..27d6a04 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -4,9 +4,9 @@ import { fontFamily } from "tailwindcss/defaultTheme"; const config = { darkMode: ["class"], content: [ - "./pages/**/*.{ts,tsx}", + "./views/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", - "./app/**/*.{ts,tsx}", + "./core/**/*.{ts,tsx}", "./src/**/*.{ts,tsx}", ], prefix: "",