login register comlated
This commit is contained in:
@@ -174,7 +174,9 @@
|
||||
"sending": "Sending…",
|
||||
"sendCode": "Login",
|
||||
"registerPrompt": "Don't have an account?",
|
||||
"registerLink": "Register"
|
||||
"registerLink": "Register",
|
||||
"passwordLabel": "Password",
|
||||
"passwordPlaceholder": "Must be at least 8 characters"
|
||||
},
|
||||
"Register": {
|
||||
"successTitle": "You're registered",
|
||||
@@ -189,7 +191,9 @@
|
||||
"surnamePlaceholder": "Karimov",
|
||||
"terms": "I agree to the Terms of Service and Privacy Policy",
|
||||
"submitButton": "Create account",
|
||||
"loginPrompt": "Already have an account?"
|
||||
"loginPrompt": "Already have an account?",
|
||||
"passwordLabel": "Password",
|
||||
"passwordPlaceholder": "Must be at least 8 characters"
|
||||
}
|
||||
},
|
||||
"Payment": {
|
||||
|
||||
@@ -174,7 +174,9 @@
|
||||
"sending": "Отправка…",
|
||||
"sendCode": "Вход",
|
||||
"registerPrompt": "Нет аккаунта?",
|
||||
"registerLink": "Зарегистрироваться"
|
||||
"registerLink": "Зарегистрироваться",
|
||||
"passwordLabel": "Пароль",
|
||||
"passwordPlaceholder": "8 символов или более"
|
||||
},
|
||||
"Register": {
|
||||
"successTitle": "Вы зарегистрированы",
|
||||
@@ -189,7 +191,9 @@
|
||||
"surnamePlaceholder": "Каримов",
|
||||
"terms": "Я согласен с Условиями обслуживания и Политикой конфиденциальности",
|
||||
"submitButton": "Создать аккаунт",
|
||||
"loginPrompt": "Уже есть аккаунт?"
|
||||
"loginPrompt": "Уже есть аккаунт?",
|
||||
"passwordLabel": "Пароль",
|
||||
"passwordPlaceholder": "8 символов или более"
|
||||
}
|
||||
},
|
||||
"Payment": {
|
||||
|
||||
@@ -178,6 +178,8 @@ declare const messages: {
|
||||
sendCode: 'Kirish';
|
||||
registerPrompt: "Hisobingiz yo'qmi?";
|
||||
registerLink: "Ro'yxatdan o'tish";
|
||||
passwordLabel: 'Parol';
|
||||
passwordPlaceholder: "8 ta belgidan iborat bo'lsin";
|
||||
};
|
||||
Register: {
|
||||
successTitle: "Siz ro'yxatdan o'tdingiz";
|
||||
@@ -193,6 +195,8 @@ declare const messages: {
|
||||
terms: "Men Xizmat ko'rsatish shartlari va Maxfiylik siyosatiga roziman";
|
||||
submitButton: 'Hisob yaratish';
|
||||
loginPrompt: 'Hisobingiz bormi?';
|
||||
passwordLabel: 'Parol';
|
||||
passwordPlaceholder: "8 ta belgidan iborat bo'lsin";
|
||||
};
|
||||
};
|
||||
Payment: {
|
||||
|
||||
@@ -174,7 +174,9 @@
|
||||
"sending": "Yuborilmoqda…",
|
||||
"sendCode": "Kirish",
|
||||
"registerPrompt": "Hisobingiz yo'qmi?",
|
||||
"registerLink": "Ro'yxatdan o'tish"
|
||||
"registerLink": "Ro'yxatdan o'tish",
|
||||
"passwordLabel": "Parol",
|
||||
"passwordPlaceholder": "8 ta belgidan iborat bo'lsin"
|
||||
},
|
||||
"Register": {
|
||||
"successTitle": "Siz ro'yxatdan o'tdingiz",
|
||||
@@ -189,7 +191,9 @@
|
||||
"surnamePlaceholder": "Karimov",
|
||||
"terms": "Men Xizmat ko'rsatish shartlari va Maxfiylik siyosatiga roziman",
|
||||
"submitButton": "Hisob yaratish",
|
||||
"loginPrompt": "Hisobingiz bormi?"
|
||||
"loginPrompt": "Hisobingiz bormi?",
|
||||
"passwordLabel": "Parol",
|
||||
"passwordPlaceholder": "8 ta belgidan iborat bo'lsin"
|
||||
}
|
||||
},
|
||||
"Payment": {
|
||||
|
||||
80
src/shared/config/jsonId.tsx
Normal file
80
src/shared/config/jsonId.tsx
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* JsonLd — injects structured data (schema.org) into <head>.
|
||||
* Helps Google understand your site type, sitelinks searchbox, etc.
|
||||
*
|
||||
* Usage in layout.tsx (inside <head> or anywhere in the tree):
|
||||
* import { JsonLd } from '@/shared/components/JsonLd';
|
||||
* ...
|
||||
* <JsonLd locale={locale} />
|
||||
*/
|
||||
|
||||
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? 'https://antiplagiat.uz';
|
||||
|
||||
interface Props {
|
||||
locale: string;
|
||||
}
|
||||
|
||||
export function JsonLd({ locale }: Props) {
|
||||
const schema = {
|
||||
'@context': 'https://schema.org',
|
||||
'@graph': [
|
||||
// ── Organization ──────────────────────────────────────────────────────
|
||||
{
|
||||
'@type': 'Organization',
|
||||
'@id': `${SITE_URL}/#organization`,
|
||||
name: 'AntiPlagiat.uz',
|
||||
url: SITE_URL,
|
||||
logo: {
|
||||
'@type': 'ImageObject',
|
||||
url: `${SITE_URL}/icons/icon-512.png`,
|
||||
width: 512,
|
||||
height: 512,
|
||||
},
|
||||
sameAs: [
|
||||
// Add your social profile URLs here
|
||||
// 'https://t.me/antiplagiatuz',
|
||||
],
|
||||
contactPoint: {
|
||||
'@type': 'ContactPoint',
|
||||
contactType: 'customer support',
|
||||
availableLanguage: ['Uzbek', 'Russian', 'English'],
|
||||
},
|
||||
},
|
||||
|
||||
// ── WebSite (enables Google Sitelinks Searchbox) ──────────────────────
|
||||
{
|
||||
'@type': 'WebSite',
|
||||
'@id': `${SITE_URL}/#website`,
|
||||
url: SITE_URL,
|
||||
name: 'AntiPlagiat.uz',
|
||||
publisher: { '@id': `${SITE_URL}/#organization` },
|
||||
inLanguage: [locale],
|
||||
potentialAction: {
|
||||
'@type': 'SearchAction',
|
||||
target: {
|
||||
'@type': 'EntryPoint',
|
||||
urlTemplate: `${SITE_URL}/search?q={search_term_string}`,
|
||||
},
|
||||
'query-input': 'required name=search_term_string',
|
||||
},
|
||||
},
|
||||
|
||||
// ── WebPage ───────────────────────────────────────────────────────────
|
||||
{
|
||||
'@type': 'WebPage',
|
||||
'@id': `${SITE_URL}/${locale}/#webpage`,
|
||||
url: `${SITE_URL}/${locale}`,
|
||||
isPartOf: { '@id': `${SITE_URL}/#website` },
|
||||
about: { '@id': `${SITE_URL}/#organization` },
|
||||
inLanguage: locale,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
return (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
76
src/shared/config/seo.config.ts
Normal file
76
src/shared/config/seo.config.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
// ─── SEO Metadata per locale ───────────────────────────────────────────────────
|
||||
// Used by generateMetadata() in layout.tsx
|
||||
|
||||
export type SupportedLocale = 'uz' | 'ru' | 'en';
|
||||
|
||||
interface LocaleSeoData {
|
||||
siteName: string;
|
||||
title: string;
|
||||
titleTemplate: string;
|
||||
description: string;
|
||||
keywords: string[];
|
||||
ogTitle: string;
|
||||
ogDescription: string;
|
||||
}
|
||||
|
||||
export const SEO_DATA: Record<SupportedLocale, LocaleSeoData> = {
|
||||
uz: {
|
||||
siteName: 'AntiPlagiat.uz',
|
||||
title: 'AntiPlagiat.uz — Plagiat tekshiruvi onlayn',
|
||||
titleTemplate: '%s | AntiPlagiat.uz',
|
||||
description:
|
||||
"Dissertatsiya, kurs ishi va ilmiy maqolalaringizni tezkor va ishonchli plagiat tekshiruvidan o'tkazing. Natija daqiqalar ichida tayyor.",
|
||||
keywords: [
|
||||
'plagiat tekshiruvi',
|
||||
'antiplagiat',
|
||||
'dissertatsiya tekshiruvi',
|
||||
'kurs ishi plagiat',
|
||||
'ilmiy maqola tekshiruvi',
|
||||
'onlayn plagiat',
|
||||
"o'zbekiston antiplagiat",
|
||||
],
|
||||
ogTitle: 'AntiPlagiat.uz — Tezkor plagiat tekshiruvi',
|
||||
ogDescription:
|
||||
'Ishingizni bir necha daqiqada plagiatga tekshiring. Sertifikat bilan natija oling.',
|
||||
},
|
||||
|
||||
ru: {
|
||||
siteName: 'AntiPlagiat.uz',
|
||||
title: 'AntiPlagiat.uz — Проверка на плагиат онлайн',
|
||||
titleTemplate: '%s | AntiPlagiat.uz',
|
||||
description:
|
||||
'Быстрая и надёжная проверка диссертаций, курсовых работ и научных статей на плагиат. Результат готов за несколько минут.',
|
||||
keywords: [
|
||||
'проверка на плагиат',
|
||||
'антиплагиат',
|
||||
'проверка диссертации',
|
||||
'курсовая плагиат',
|
||||
'проверка научной статьи',
|
||||
'онлайн антиплагиат',
|
||||
'антиплагиат узбекистан',
|
||||
],
|
||||
ogTitle: 'AntiPlagiat.uz — Быстрая проверка на плагиат',
|
||||
ogDescription:
|
||||
'Проверьте вашу работу на плагиат за несколько минут. Получите результат с сертификатом.',
|
||||
},
|
||||
|
||||
en: {
|
||||
siteName: 'AntiPlagiat.uz',
|
||||
title: 'AntiPlagiat.uz — Online Plagiarism Checker',
|
||||
titleTemplate: '%s | AntiPlagiat.uz',
|
||||
description:
|
||||
'Fast and reliable plagiarism detection for dissertations, coursework, and research papers. Get your results in minutes.',
|
||||
keywords: [
|
||||
'plagiarism checker',
|
||||
'anti-plagiarism',
|
||||
'dissertation plagiarism check',
|
||||
'coursework plagiarism',
|
||||
'research paper checker',
|
||||
'online plagiarism detection',
|
||||
'uzbekistan plagiarism',
|
||||
],
|
||||
ogTitle: 'AntiPlagiat.uz — Fast Plagiarism Checker',
|
||||
ogDescription:
|
||||
'Check your work for plagiarism in minutes. Receive your result with an official certificate.',
|
||||
},
|
||||
};
|
||||
137
src/shared/lib/metadata.ts
Normal file
137
src/shared/lib/metadata.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
import type { Metadata } from 'next';
|
||||
import { SEO_DATA, type SupportedLocale } from '../config/seo.config';
|
||||
|
||||
// ─── Site-wide constants ───────────────────────────────────────────────────────
|
||||
|
||||
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? 'https://antiplagiat.uz';
|
||||
const OG_IMAGE_URL = `${SITE_URL}/og-image.png`; // 1200×630 px recommended
|
||||
const TWITTER_HANDLE = '@antiplagiatuz'; // update or remove if unused
|
||||
|
||||
// ─── Root layout metadata (called in app/[locale]/layout.tsx) ─────────────────
|
||||
|
||||
export function generateRootMetadata(locale: string): Metadata {
|
||||
const seo = SEO_DATA[locale as SupportedLocale] ?? SEO_DATA.ru;
|
||||
|
||||
// Build alternate-language links for <head>
|
||||
const languages: Record<string, string> = {
|
||||
uz: `${SITE_URL}/uz`,
|
||||
ru: `${SITE_URL}/ru`,
|
||||
en: `${SITE_URL}/en`,
|
||||
'x-default': `${SITE_URL}/ru`,
|
||||
};
|
||||
|
||||
return {
|
||||
// ── Basic ──────────────────────────────────────────────────────────────────
|
||||
metadataBase: new URL(SITE_URL),
|
||||
title: {
|
||||
default: seo.title,
|
||||
template: seo.titleTemplate,
|
||||
},
|
||||
description: seo.description,
|
||||
keywords: seo.keywords,
|
||||
authors: [{ name: seo.siteName, url: SITE_URL }],
|
||||
creator: seo.siteName,
|
||||
publisher: seo.siteName,
|
||||
applicationName: seo.siteName,
|
||||
generator: 'Next.js',
|
||||
|
||||
// ── Canonical & alternates ─────────────────────────────────────────────────
|
||||
alternates: {
|
||||
canonical: `${SITE_URL}/${locale}`,
|
||||
languages,
|
||||
},
|
||||
|
||||
// ── Robots ────────────────────────────────────────────────────────────────
|
||||
robots: {
|
||||
index: true,
|
||||
follow: true,
|
||||
nocache: false,
|
||||
googleBot: {
|
||||
index: true,
|
||||
follow: true,
|
||||
noimageindex: false,
|
||||
'max-video-preview': -1,
|
||||
'max-image-preview': 'large',
|
||||
'max-snippet': -1,
|
||||
},
|
||||
},
|
||||
|
||||
// ── Open Graph ────────────────────────────────────────────────────────────
|
||||
openGraph: {
|
||||
type: 'website',
|
||||
locale: ogLocale(locale),
|
||||
alternateLocale: ogAlternates(locale),
|
||||
url: `${SITE_URL}/${locale}`,
|
||||
siteName: seo.siteName,
|
||||
title: seo.ogTitle,
|
||||
description: seo.ogDescription,
|
||||
images: [
|
||||
{
|
||||
url: OG_IMAGE_URL,
|
||||
width: 1200,
|
||||
height: 630,
|
||||
alt: seo.ogTitle,
|
||||
type: 'image/png',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
// ── Twitter / X ───────────────────────────────────────────────────────────
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
site: TWITTER_HANDLE,
|
||||
creator: TWITTER_HANDLE,
|
||||
title: seo.ogTitle,
|
||||
description: seo.ogDescription,
|
||||
images: [OG_IMAGE_URL],
|
||||
},
|
||||
|
||||
// ── Icons ─────────────────────────────────────────────────────────────────
|
||||
icons: {
|
||||
icon: [
|
||||
{ url: '/favicon.ico' },
|
||||
{ url: '/icons/icon-16.png', sizes: '16x16', type: 'image/png' },
|
||||
{ url: '/icons/icon-32.png', sizes: '32x32', type: 'image/png' },
|
||||
{ url: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||
],
|
||||
apple: [
|
||||
{
|
||||
url: '/icons/apple-touch-icon.png',
|
||||
sizes: '180x180',
|
||||
type: 'image/png',
|
||||
},
|
||||
],
|
||||
shortcut: '/favicon.ico',
|
||||
},
|
||||
|
||||
// ── Web app manifest ──────────────────────────────────────────────────────
|
||||
manifest: '/manifest.webmanifest',
|
||||
|
||||
// ── Verification (add your Search Console token) ──────────────────────────
|
||||
verification: {
|
||||
google: process.env.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION ?? '',
|
||||
yandex: process.env.NEXT_PUBLIC_YANDEX_VERIFICATION ?? '',
|
||||
},
|
||||
|
||||
// ── Extra meta ────────────────────────────────────────────────────────────
|
||||
category: 'education',
|
||||
};
|
||||
}
|
||||
|
||||
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
||||
|
||||
/** Maps locale code to Open Graph locale string */
|
||||
function ogLocale(locale: string): string {
|
||||
const map: Record<string, string> = {
|
||||
uz: 'uz_UZ',
|
||||
ru: 'ru_RU',
|
||||
en: 'en_US',
|
||||
};
|
||||
return map[locale] ?? 'ru_RU';
|
||||
}
|
||||
|
||||
/** Returns the other two OG locales for alternateLocale */
|
||||
function ogAlternates(currentLocale: string): string[] {
|
||||
const all = ['uz_UZ', 'ru_RU', 'en_US'];
|
||||
return all.filter((l) => l !== ogLocale(currentLocale));
|
||||
}
|
||||
@@ -13,17 +13,19 @@ export const apiRequest = async <T>(
|
||||
url: string,
|
||||
data?: unknown,
|
||||
config?: Omit<AxiosRequestConfig, 'method' | 'url' | 'data'>,
|
||||
): Promise<T> => {
|
||||
): Promise<AxiosResponse<T>> => {
|
||||
// ← return full response
|
||||
const response: AxiosResponse<T> = await api.request<T>({
|
||||
method,
|
||||
url,
|
||||
data,
|
||||
...config,
|
||||
headers: {
|
||||
'Accept-Language': getRouteLang(), // evaluated per-request
|
||||
'Accept-Language': getRouteLang(),
|
||||
...config?.headers,
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
return response.data;
|
||||
return response; // ← return response, not response.data
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export const links = {
|
||||
login: '/users/login/',
|
||||
register: '/users/register/',
|
||||
plagiarismCheck: '/plagiarism/check/',
|
||||
};
|
||||
|
||||
65
src/shared/ui/field.tsx
Normal file
65
src/shared/ui/field.tsx
Normal file
@@ -0,0 +1,65 @@
|
||||
export function Field({
|
||||
id,
|
||||
label,
|
||||
type = 'text',
|
||||
placeholder,
|
||||
value,
|
||||
name,
|
||||
onChange,
|
||||
error,
|
||||
maxLength,
|
||||
minLength,
|
||||
require = false,
|
||||
}: {
|
||||
id: string;
|
||||
label: string;
|
||||
type?: string;
|
||||
placeholder?: string;
|
||||
value: string;
|
||||
name: string;
|
||||
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
error?: string;
|
||||
maxLength?: number;
|
||||
minLength?: number;
|
||||
require?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<label
|
||||
htmlFor={id}
|
||||
className="text-[0.7rem] font-medium tracking-widest uppercase text-stone-500"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
<input
|
||||
id={id}
|
||||
name={name}
|
||||
type={type}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
maxLength={maxLength}
|
||||
minLength={minLength}
|
||||
autoComplete="off"
|
||||
className={`
|
||||
w-full rounded-sm border bg-stone-50 px-3.5 py-2.5
|
||||
font-sans text-[0.95rem] text-stone-900 outline-none
|
||||
placeholder:text-stone-300
|
||||
transition-all duration-150
|
||||
focus:border-stone-400 focus:ring-2 focus:ring-stone-300/30
|
||||
${
|
||||
error
|
||||
? 'border-red-400 ring-2 ring-red-200/40'
|
||||
: 'border-stone-200 hover:border-stone-300'
|
||||
}
|
||||
`}
|
||||
required={require}
|
||||
/>
|
||||
{error && (
|
||||
<span className="text-[0.7rem] text-red-500 tracking-tight">
|
||||
{error}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
id: number;
|
||||
name: string;
|
||||
surname: string;
|
||||
}
|
||||
|
||||
interface UserLoginStore {
|
||||
interface UserStore {
|
||||
user: User | null;
|
||||
setUser: (user: User) => void;
|
||||
setUser: (user: User | null) => void;
|
||||
clearUser: () => void;
|
||||
getUser: () => User | null;
|
||||
}
|
||||
|
||||
export const useUserLogin = create<UserLoginStore>((set, get) => ({
|
||||
export const useUserStore = create<UserStore>((set, get) => ({
|
||||
user: null,
|
||||
setUser: (user: User) => set({ user }),
|
||||
setUser: (user: User | null) => set({ user }),
|
||||
clearUser: () => set({ user: null }),
|
||||
getUser: () => get().user,
|
||||
}));
|
||||
Reference in New Issue
Block a user