diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx
index ede921c..2cfe2fa 100644
--- a/src/app/[locale]/layout.tsx
+++ b/src/app/[locale]/layout.tsx
@@ -12,6 +12,7 @@ import { ReactNode } from 'react';
import { setRequestLocale } from 'next-intl/server';
import QueryProvider from '@/shared/config/react-query/QueryProvider';
import Script from 'next/script';
+import Provider from '@/features/providers/provider';
export const metadata: Metadata = {
title: PRODUCT_INFO.name,
@@ -48,9 +49,11 @@ export default async function RootLayout({ children, params }: Props) {
disableTransitionOnChange
>
-
- {children}
-
+
+
+ {children}
+
+
diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx
index e70e0a8..5bdd1ee 100644
--- a/src/app/[locale]/page.tsx
+++ b/src/app/[locale]/page.tsx
@@ -1,5 +1,5 @@
import { getPosts } from '@/shared/config/api/testApi';
-import Welcome from '@/widgets/welcome';
+import { PlagiarismCheckForm } from '@/widgets/fileUpload/ui/Plagiraismcheckform';
export default async function Home() {
const res = await getPosts({ _limit: 1 });
@@ -7,7 +7,7 @@ export default async function Home() {
return (
);
}
diff --git a/src/features/auth/login/lib/formatPhone.ts b/src/features/auth/login/lib/formatPhone.ts
deleted file mode 100644
index 860154f..0000000
--- a/src/features/auth/login/lib/formatPhone.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export const formatPhone = (value: string) => {
- if (value.length <= 2) return value;
- if (value.length <= 5) return `${value.slice(0, 2)} ${value.slice(2)}`;
- if (value.length <= 7)
- return `${value.slice(0, 2)} ${value.slice(2, 5)} ${value.slice(5)}`;
- return `${value.slice(0, 2)} ${value.slice(2, 5)} ${value.slice(
- 5,
- 7,
- )} ${value.slice(7)}`;
-};
-
-export const normalizeDigits = (value: string) =>
- value.replace(/\D/g, '').slice(0, 9);
diff --git a/src/features/auth/login/lib/index.ts b/src/features/auth/login/lib/index.ts
index 2b42e9e..83f6a19 100644
--- a/src/features/auth/login/lib/index.ts
+++ b/src/features/auth/login/lib/index.ts
@@ -1 +1,3 @@
// Ushbu fayl loyiha structurasi uchun qo'shilgan. O'chirib tashlasangiz bo'ladi
+export * from './useLoginForm';
+export * from '../../../../shared/lib/formatPhone';
diff --git a/src/features/auth/login/lib/togle.ts b/src/features/auth/login/lib/togle.ts
deleted file mode 100644
index adf849b..0000000
--- a/src/features/auth/login/lib/togle.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { create } from 'zustand';
-
-interface LoginModalStore {
- openLoginModal: boolean;
- toggleLoginModal: () => void;
-}
-
-const useLoginModal = create((set) => ({
- openLoginModal: false,
- toggleLoginModal: () =>
- set((state) => ({ openLoginModal: !state.openLoginModal })),
-}));
-
-export { useLoginModal };
diff --git a/src/features/auth/login/model/index.ts b/src/features/auth/login/model/index.ts
deleted file mode 100644
index a8e428b..0000000
--- a/src/features/auth/login/model/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { RegisterModal } from './model';
diff --git a/src/features/auth/login/model/model.tsx b/src/features/auth/login/model/model.tsx
deleted file mode 100644
index b91568c..0000000
--- a/src/features/auth/login/model/model.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-function RegisterModal() {
- return ;
-}
-
-export { RegisterModal };
diff --git a/src/features/auth/login/ui/form.tsx b/src/features/auth/login/ui/form.tsx
index 98de8d8..0d2a4e7 100644
--- a/src/features/auth/login/ui/form.tsx
+++ b/src/features/auth/login/ui/form.tsx
@@ -1,119 +1,165 @@
'use client';
-import { useTranslations } from 'next-intl';
import { useCallback, useState } from 'react';
-import { formatPhone, normalizeDigits } from '../lib/formatPhone';
-import { Input } from '@/shared/ui/input';
-import { Button } from '@/shared/ui/button';
-import PhonePrefix from './phonePrefix';
-import { useLoginForm } from '../lib/useLoginForm';
-import { Label } from '@/shared/ui/label';
import { X } from 'lucide-react';
-import { useLoginModal } from '../lib/togle';
+import {
+ formatPhone,
+ normalizeDigits,
+} from '../../../../shared/lib/formatPhone';
+import PhonePrefix from '../../../../shared/ui/phonePrefix';
+import { MotionWrapper } from '../../../../shared/ui/motion';
+import { useLoginForm } from '../lib/useLoginForm';
+import { useLoginModal } from '@/shared/zustand/auth';
+import Link from 'next/link';
-// ============================= //
-
-export default function LoginForm() {
- const t = useTranslations();
+export function LoginForm() {
const [isFocused, setIsFocused] = useState(false);
- // ========== Handlers ========== //
+ const { phone, setPhone, submit, error, loading } = useLoginForm();
+ const toggleLoginModal = useLoginModal((state) => state.toggleLoginModal);
const handlePhoneChange = useCallback(
(e: React.ChangeEvent) => {
setPhone(normalizeDigits(e.target.value));
},
- [],
+ [setPhone],
);
- // ============================== //
-
- const { phone, setPhone, submit, error, loading } = useLoginForm();
- const toggleLoginModal = useLoginModal((state) => state.toggleLoginModal);
-
return (
-