diff --git a/app/(auth)/change-password/page.tsx b/app/(auth)/change-password/page.tsx index 9435131..699f412 100644 --- a/app/(auth)/change-password/page.tsx +++ b/app/(auth)/change-password/page.tsx @@ -1,102 +1,76 @@ +import React from 'react'; import ComponentsAuthUnlockForm from '@/components/auth/components-auth-unlock-form'; import { Metadata } from 'next'; import Link from 'next/link'; -import React from 'react'; export const metadata: Metadata = { - title: 'Unlock Cover', + title: 'Unlock', }; -const CoverLockScreen = () => { +export default function CoverLockScreen() { return ( -
- {/* Background */} -
- background -
+
-
- {/* Decorative images */} - image - image - image - image + {/* ===== Background Glows (SAME AS LOGIN) ===== */} - {/* Main container */} -
- - {/* LEFT SIDE */} -
-
+ {/* Blue */} +
- {/* Centered Image */} -
- Login Illustration + {/* Green left */} +
+ + {/* Pink left */} +
+ + {/* Pink bottom */} +
+ + {/* Orange */} +
+ + {/* Green right */} +
+ + {/* Purple */} +
+ + {/* Yellow */} +
+ + {/* ===== CARD ===== */} +
+ {/* Logo */} +
+ SocialBuddy Logo + + {/* User info */} +
+
+

+ Change password +

- {/* RIGHT SIDE */} -
- - {/* ✅ Top-right logo (responsive + transparent) */} -
- - data4autos - -
- -
-
-
- images -
-
-

Shaun Park

-

Enter your password to unlock your ID

-
-
- -
-

- © {new Date().getFullYear()}. Data4Autos All Rights Reserved. -

-
+
+ + {/* Unlock Form (UNCHANGED) */} + + + {/* Footer */} +
+ Not you?{' '} + + Switch account +
); -}; - -export default CoverLockScreen; +} diff --git a/app/(auth)/forgot-password/page.tsx b/app/(auth)/forgot-password/page.tsx index ef0b606..ff45ee3 100644 --- a/app/(auth)/forgot-password/page.tsx +++ b/app/(auth)/forgot-password/page.tsx @@ -1,150 +1,55 @@ -import ComponentsAuthForgotForm from '@/components/auth/components-auth-forgot-form'; -import IconFacebookCircle from '@/components/icon/icon-facebook-circle'; -import IconGoogle from '@/components/icon/icon-google'; -import IconInstagram from '@/components/icon/icon-instagram'; -import IconTwitter from '@/components/icon/icon-twitter'; import { Metadata } from 'next'; import Link from 'next/link'; import React from 'react'; +import ForgotPasswordForm from '@/components/auth/components-auth-forgot-form'; export const metadata: Metadata = { title: 'Forgot Password', }; -export default function CoverForgotPassword() { +export default function ForgotPasswordPage() { return ( -
- {/* Background */} -
- background -
+
-
- {/* Decorative images */} - image - image - image - image + {/* ===== Background Glows ===== */} +
+
+
+
+
+
+
+
- {/* Main container */} -
- - {/* LEFT SIDE */} -
+ {/* Logo / Heading */} +
+ SocialBuddy Logo +

+ Forgot your password? +

+

+ Enter your email and we’ll send you a reset link +

+
- p-5 lg:inline-flex lg:max-w-[835px] - xl:-ms-28 ltr:xl:skew-x-[14deg] rtl:xl:skew-x-[-14deg]" - > -
+ {/* Forgot Password Form */} + - {/* Centered Image */} -
- Login Illustration -
-
- - {/* RIGHT SIDE */} -
- - - {/* Triple Logos */} -
- {/* Logo 1 */} - - Turn14 + {/* Back to login */} +
+ Remember your password?{' '} + + SIGN IN - - {/* Logo 2 */} - - Data4Autos - - - {/* Logo 3 */} - - eBay - -
- - - - - - {/* Forgot pwd Form Section */} -
-
-

- Forgot Password -

-

- Enter your email to receive the reset link -

-
- - {/* forgot form */} - - -
- Remember your password?  - - SIGN IN - -
-
- -

- © {new Date().getFullYear()}. Data4Autos All Rights Reserved. -

-
); -} +} \ No newline at end of file diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx index 5284334..4139cc1 100644 --- a/app/(auth)/login/page.tsx +++ b/app/(auth)/login/page.tsx @@ -1,211 +1,49 @@ +import React from 'react'; import ComponentsAuthLoginForm from '@/components/auth/components-auth-login-form'; -import IconFacebookCircle from '@/components/icon/icon-facebook-circle'; -import IconGoogle from '@/components/icon/icon-google'; -import IconInstagram from '@/components/icon/icon-instagram'; -import IconTwitter from '@/components/icon/icon-twitter'; import { Metadata } from 'next'; import Link from 'next/link'; -import React from 'react'; export const metadata: Metadata = { title: 'Login', }; -const CoverLogin = () => { +export default function SocialBuddyLogin() { return ( -
- {/* Background */} -
- background +
+ + {/* ===== Background Glows ===== */} + + {/* Blue */} +
+ + {/* Green left */} +
+ + {/* Pink left */} +
+ + {/* Pink bottom */} +
+ + {/* Orange */} +
+ + {/* Green right */} +
+ + {/* Purple */} +
+ + {/* Yellow */} +
+ + + + + +
-
- {/* Decorative images */} - image - image - image - image - - {/* Main container */} -
- - {/* LEFT SIDE */} -
-
- - {/* Centered Image */} -
- Login Illustration -
-
- - {/* RIGHT SIDE */} -
- - - {/* Triple Logos */} -
- {/* Logo 1 */} - - Turn14 - - - {/* Logo 2 */} - - Data4Autos - - - {/* Logo 3 */} - - eBay - -
- - - - - - {/* Login Form Section */} -
-
-

- Sign In -

- -

- Enter your email and password to login -

-
- - {/* Login form */} - - - {/* Divider */} -
- - - or - -
- - {/* Social icons */} -
-
    -
  • - - - - -
  • -
  • - - - -
  • - {/*
  • - - - -
  • */} -
  • - - - -
  • -
-
- - {/* Sign-up link */} -
- Don't have an account?  - - SIGN UP - -
-
- - {/* Footer */} -

- © {new Date().getFullYear()}. Data4Autos All Rights Reserved. -

-
-
-
-
+ ); -}; - -export default CoverLogin; +} \ No newline at end of file diff --git a/app/(auth)/reset-password/page.tsx b/app/(auth)/reset-password/page.tsx index ae68123..6e691d6 100644 --- a/app/(auth)/reset-password/page.tsx +++ b/app/(auth)/reset-password/page.tsx @@ -1,87 +1,72 @@ +import React from 'react'; import ComponentsAuthResetPasswordForm from '@/components/auth/components-auth-reset-password-form'; import { Metadata } from 'next'; import Link from 'next/link'; -import React from 'react'; export const metadata: Metadata = { - title: 'Recover Id Cover', + title: 'Recover ID', }; -const CoverPasswordReset = () => { +export default function CoverPasswordReset() { return ( -
-
- background -
-
- {/* Decorative images */} - image - image - image - image -
- {/* LEFT SIDE */} -
-
+
- {/* Centered Image */} -
- Login Illustration -
-
-
- {/* ✅ Top-right logo (responsive + transparent) */} -
- - data4autos - -
-
-
-

Password Reset

-

Enter your email to recover your ID

-
- -
-

© {new Date().getFullYear()}.Data4Autos All Rights Reserved.

-
+ {/* ===== Background Glows (SAME AS LOGIN) ===== */} + + {/* Blue */} +
+ + {/* Green left */} +
+ + {/* Pink left */} +
+ + {/* Pink bottom */} +
+ + {/* Orange */} +
+ + {/* Green right */} +
+ + {/* Purple */} +
+ + {/* Yellow */} +
+ + {/* ===== CARD ===== */} +
+ + {/* Logo */} +
+ SocialBuddy Logo +

+ Recover Your Account +

+

+ Enter your email to recover your ID +

+
+ + {/* Reset Form (UNCHANGED) */} + + + {/* Footer */} +
+ Remembered your password?{' '} + + SIGN IN +
); -}; - -export default CoverPasswordReset; +} diff --git a/app/(auth)/signup/page.tsx b/app/(auth)/signup/page.tsx index d87d893..e5887aa 100644 --- a/app/(auth)/signup/page.tsx +++ b/app/(auth)/signup/page.tsx @@ -1,218 +1,61 @@ import ComponentsAuthRegisterForm from '@/components/auth/components-auth-register-form'; -import IconFacebookCircle from '@/components/icon/icon-facebook-circle'; -import IconGoogle from '@/components/icon/icon-google'; -import IconInstagram from '@/components/icon/icon-instagram'; -import IconTwitter from '@/components/icon/icon-twitter'; import { Metadata } from 'next'; import Link from 'next/link'; import React from 'react'; export const metadata: Metadata = { - title: 'Register Cover', + title: 'Sign Up', }; -const CoverRegister = () => { +export default function BoxedSignUp() { return ( -
- {/* Background gradient */} -
- background -
+
-
- {/* Decorative images */} - image - image - image - image + {/* ===== Background Glows ===== */} +
+
+
+
+
+
+
+
- {/* Main container */} -
- - {/* LEFT SIDE */} -
+ {/* Logo */} +
+ SocialBuddy Logo - p-5 lg:inline-flex lg:max-w-[835px] - xl:-ms-28 ltr:xl:skew-x-[14deg] rtl:xl:skew-x-[-14deg]" +

+ Create Your SocialBuddy Account +

+
+ + {/* Register Form */} + + + {/* Footer link */} +
+ Already have an account?{' '} + -
- - {/* Centered Image */} -
- Login Illustration -
-
- - {/* RIGHT SIDE */} -
- - {/* Triple Logos */} -
- {/* Logo 1 */} - - Turn14 - - - {/* Logo 2 */} - - Data4Autos - - - {/* Logo 3 */} - - eBay - -
- - - - - - {/* signup Section */} -
-
-

- Sign Up -

-

- Enter your email and password to register -

-
- - {/* Register Form */} - - - {/* Divider */} -
- - - or - -
- - {/* Social Icons */} -
-
    -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
-
- - {/* Login link */} -
- Already have an account?  - - SIGN IN - -
-
- - {/* Footer text */} -

- © {new Date().getFullYear()}. Data4Autos All Rights Reserved. -

-
+ SIGN IN +
); -}; - -export default CoverRegister; +} diff --git a/app/(defaults)/page.tsx b/app/(defaults)/page.tsx index 3c765d6..9ff7913 100644 --- a/app/(defaults)/page.tsx +++ b/app/(defaults)/page.tsx @@ -6,7 +6,76 @@ export const metadata: Metadata = { }; const Sales = () => { - return
starter page
; + return ( +
+ + {/* ================= BACKGROUND GLOWS (FROM UserModule) ================= */} +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + {/* ================= PAGE CONTENT ================= */} +
+ +
+ + + + + {/* Title */} +

+ Sales Admin +

+ +
+
+
+ + + + ); }; export default Sales; diff --git a/app/api/users/[id]/roue.ts b/app/api/users/[id]/roue.ts new file mode 100644 index 0000000..8ffd11b --- /dev/null +++ b/app/api/users/[id]/roue.ts @@ -0,0 +1,48 @@ +import { NextResponse } from 'next/server'; + +const API_BASE = 'https://api.socialbuddy.co/api/users'; + +const normalizeUser = (u: any) => ({ + userid: u._id, + name: u.name, + email: u.email, + mobile: u.mobileNumber, + role: u.role, + createdAt: u.createdAt, +}); + +// GET by id +export async function GET( + _req: Request, + { params }: { params: { id: string } } +) { + const res = await fetch(`${API_BASE}/${params.id}`); + const data = await res.json(); + return NextResponse.json(normalizeUser(data)); +} + +// UPDATE (admin) +export async function PUT( + req: Request, + { params }: { params: { id: string } } +) { + const body = await req.json(); + + const res = await fetch(`${API_BASE}/${params.id}`, { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(body), + }); + + const data = await res.json(); + return NextResponse.json(normalizeUser(data)); +} + +// DELETE (admin) +export async function DELETE( + _req: Request, + { params }: { params: { id: string } } +) { + await fetch(`${API_BASE}/${params.id}`, { method: 'DELETE' }); + return NextResponse.json({ success: true }); +} diff --git a/app/api/users/route.ts b/app/api/users/route.ts new file mode 100644 index 0000000..6851cd4 --- /dev/null +++ b/app/api/users/route.ts @@ -0,0 +1,57 @@ +import { NextResponse } from 'next/server'; + +const API_BASE = 'https://api.socialbuddy.co/api/users'; + +const normalizeUser = (u: any) => ({ + userid: u._id, + name: u.name, + email: u.email, + mobileNumber: + u.mobileNumber || + u.mobile || + u.phone || + u.phonenumber || + '', + role: u.role, +}); + +// GET users +export async function GET() { + const res = await fetch(API_BASE, { + credentials: 'include', + }); + const data = await res.json(); + return NextResponse.json(data.map(normalizeUser)); +} + +// ✅ ADD USER (ADMIN ONLY) +export async function POST(req: Request) { + const body = await req.json(); + + const res = await fetch(`${API_BASE}/create`, { + method: 'POST', + + // REQUIRED + credentials: 'include', + + headers: { + 'Content-Type': 'application/json', + + // THIS LINE IS WHY ADD USER WAS FAILING + Cookie: req.headers.get('cookie') || '', + }, + + body: JSON.stringify(body), + }); + + if (!res.ok) { + const error = await res.text(); + return NextResponse.json( + { error }, + { status: res.status } + ); + } + + const data = await res.json(); + return NextResponse.json(normalizeUser(data)); +} diff --git a/components/auth/components-auth-forgot-form.tsx b/components/auth/components-auth-forgot-form.tsx index c3d8a60..569636b 100644 --- a/components/auth/components-auth-forgot-form.tsx +++ b/components/auth/components-auth-forgot-form.tsx @@ -2,6 +2,7 @@ import React, { useState } from "react"; import axios from "axios"; +import { Mail } from "lucide-react"; export default function ForgotPasswordForm() { const [email, setEmail] = useState(""); @@ -12,12 +13,16 @@ export default function ForgotPasswordForm() { e.preventDefault(); setLoading(true); setMessage(""); + try { - const res = await axios.post("https://ebay.backend.data4autos.com/api/auth/forgot-password", { email }); + await axios.post( + "https://ebay.backend.data4autos.com/api/auth/forgot-password", + { email } + ); setMessage("✅ We’ve emailed you a reset code / link. Enter it below."); - } catch (err: any) { + } catch (err) { console.error(err); - setMessage("Something went wrong. Try again."); + setMessage("❌ Something went wrong. Try again."); } finally { setLoading(false); } @@ -25,27 +30,59 @@ export default function ForgotPasswordForm() { return (
+ {/* Email */}
- setEmail(e.target.value)} - className="form-input ps-10 placeholder:text-white-dark" - placeholder="you@example.com" - /> + +
+ {/* Icon */} + + + setEmail(e.target.value)} + placeholder="Enter your email" + className=" + form-input w-full + ps-12 + bg-[#0F172A] text-white + placeholder:text-gray-400 + border border-white/10 + rounded-xl + focus:border-cyan-400 + focus:ring-1 focus:ring-cyan-400 + " + /> +
- - {message &&

{message}

} + + {/* Message */} + {message && ( +

+ {message} +

+ )}
); -} +} \ No newline at end of file diff --git a/components/auth/components-auth-login-form.tsx b/components/auth/components-auth-login-form.tsx index ce0fe72..830c025 100644 --- a/components/auth/components-auth-login-form.tsx +++ b/components/auth/components-auth-login-form.tsx @@ -1,148 +1,217 @@ 'use client'; + import React, { useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import IconLockDots from '@/components/icon/icon-lock-dots'; import IconMail from '@/components/icon/icon-mail'; +import Link from 'next/link'; +import { Eye, EyeOff } from 'lucide-react'; +import { FcGoogle } from 'react-icons/fc'; const ComponentsAuthLoginForm = () => { const router = useRouter(); const searchParams = useSearchParams(); const nextUrl = searchParams.get('next') || '/'; - const [email, setEmail] = useState(''); - const [password, setPassword] = useState(''); + const [formData, setFormData] = useState({ + email: '', + password: '', + }); const [loading, setLoading] = useState(false); const [err, setErr] = useState(null); const [msg, setMsg] = useState(null); + const [showPassword, setShowPassword] = useState(false); + + const handleChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setFormData((prev) => ({ ...prev, [name]: value })); + }; const submitForm = async (e: React.FormEvent) => { e.preventDefault(); setErr(null); setMsg(null); - if (!email || !password) { + if (!formData.email || !formData.password) { setErr('Please enter email and password.'); return; } setLoading(true); try { - // ✅ Call your Next.js API (same origin), which sets d4a_uid, d4a_session, d4a_exp cookies - const res = await fetch('https://ebay.backend.data4autos.com/api/auth/login', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - // credentials not required for same-origin, but harmless: - credentials: 'same-origin', - body: JSON.stringify({ email, password }), - }); + // ✅ SAME backend logic as your old working code + const res = await fetch( + 'https://ebay.backend.data4autos.com/api/auth/login', + { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + credentials: 'same-origin', + body: JSON.stringify(formData), + } + ); const contentType = res.headers.get('content-type') || ''; - const data = contentType.includes('application/json') ? await res.json() : await res.text(); - console.log("data data", data) - try { - console.log('data:', data.store); - sessionStorage.setItem('USERID', data.userid); - sessionStorage.setItem('EBAYSTOREID', data.store.urlPath); - localStorage.setItem('data4auto_uid', data.userid); - localStorage.setItem('d4a_email', data.email); - data?.payment?.stripeSessionId && localStorage.setItem('payment_session', data?.payment?.stripeSessionId); - - console.log('set sessionStorage USERID'); - } catch { - console.log('no sessionStorage'); - } + const data = + contentType.includes('application/json') + ? await res.json() + : await res.text(); if (!res.ok) { - throw new Error((typeof data === 'object' && (data?.message || data?.error)) || `Login failed (${res.status})`); + throw new Error( + (typeof data === 'object' && + (data?.message || data?.error)) || + `Login failed (${res.status})` + ); } - // (DEV ONLY) quick check that cookies were set: - if (process.env.NODE_ENV !== 'production') { - try { - const who = await fetch('/api/debug/whoami', { cache: 'no-store' }).then((r) => r.json()); - console.log('whoami:', who); + // ✅ Preserve existing storage behavior + try { + sessionStorage.setItem('USERID', data.userid); + sessionStorage.setItem('EBAYSTOREID', data.store?.urlPath); + localStorage.setItem('data4auto_uid', data.userid); + localStorage.setItem('d4a_email', data.email); - } catch { } - } + data?.payment?.stripeSessionId && + localStorage.setItem( + 'payment_session', + data.payment.stripeSessionId + ); + } catch {} setMsg('Login successful!'); setTimeout(() => router.push(nextUrl), 500); } catch (e: any) { - setErr(e?.message || 'Something went wrong. Please try again.'); + setErr(e?.message || 'Login failed'); } finally { setLoading(false); } }; return ( -
- {/* Alerts */} - {err &&
{err}
} - {msg &&
{msg}
} + - {/* Email */} -
- -
+ {/* Alerts */} + {err && ( +
+ {err} +
+ )} + {msg && ( +
+ {msg} +
+ )} + +
+ + {/* Logo */} +
+ Logo +

+ Sign in to SocialBuddy +

+
+ + {/* Email */} +
setEmail(e.target.value)} + placeholder="Email Address" + className="w-full ps-10 py-3 bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg text-white + focus:outline-none focus:border-white/30" + value={formData.email} + onChange={handleChange} autoComplete="email" /> - - + +
-
- {/* Password */} -
- -
+ {/* Password */} +
setPassword(e.target.value)} + name="password" + type={showPassword ? 'text' : 'password'} + placeholder="Password" + className="w-full ps-10 py-3 bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg text-white + focus:outline-none focus:border-white/30" + value={formData.password} + onChange={handleChange} autoComplete="current-password" /> - - + + + + +
+ + {/* Forgot password */} +
+ + Forgot Password? + +
+ + {/* Login button */} + + + {/* Divider */} +
+ + + or
-
- {/* Optional newsletter */} -
- -
+ {/* Google Sign-in */} +
+ + + Continue with Google + +
- {/* */} - + {/* Footer */} +
+ Don’t have an account?{' '} + + SIGN UP + +
+
); }; -export default ComponentsAuthLoginForm; +export default ComponentsAuthLoginForm; \ No newline at end of file diff --git a/components/auth/components-auth-register-form.tsx b/components/auth/components-auth-register-form.tsx index bba0fc2..decd3b3 100644 --- a/components/auth/components-auth-register-form.tsx +++ b/components/auth/components-auth-register-form.tsx @@ -7,9 +7,7 @@ import IconUser from '@/components/icon/icon-user'; const API_BASE = process.env.NEXT_PUBLIC_API_BASE_URL?.replace(/\/$/, '') || - // 'https://ebay.backend.data4autos.com'; - 'https://ebay.backend.data4autos.com'; - + 'https://ebay.backend.data4autos.com'; const ComponentsAuthRegisterForm = () => { const router = useRouter(); @@ -18,7 +16,6 @@ const ComponentsAuthRegisterForm = () => { const [phonenumber, setPhonenumber] = useState(''); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); - const [subscribe, setSubscribe] = useState(false); const [loading, setLoading] = useState(false); const [err, setErr] = useState(null); @@ -39,157 +36,127 @@ const ComponentsAuthRegisterForm = () => { const res = await fetch(`${API_BASE}/api/auth/signup`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - // If your API sets cookies, uncomment: - // credentials: 'include', body: JSON.stringify({ name, email, password, phonenumber, - // You can also send `subscribe` if your API supports it - // subscribe, }), }); - const contentType = res.headers.get('content-type') || ''; - let data: any = null; - if (contentType.includes('application/json')) { - data = await res.json(); - } else { - data = await res.text(); - } + const data = await res.json(); + if (!res.ok) throw new Error(data?.message || 'Signup failed'); - if (!res.ok) { - const message = - (typeof data === 'object' && (data?.message || data?.error)) || - `Signup failed (${res.status})`; - throw new Error(message); - } - - setMsg( - (typeof data === 'object' && (data?.message || 'Signup successful!')) || - 'Signup successful!' - ); - // Redirect to login (or wherever you like) + setMsg('Signup successful!'); setTimeout(() => router.push('/login'), 1000); } catch (e: any) { - setErr(e?.message || 'Something went wrong. Please try again.'); + setErr(e?.message || 'Something went wrong.'); } finally { setLoading(false); } }; return ( -
- - {/* Name */} -
- -
- setName(e.target.value)} - autoComplete="name" - /> - - - -
-
- - {/* Email */} -
- -
- setEmail(e.target.value)} - autoComplete="email" - /> - - - -
-
- - {/* Password */} -
- -
- setPassword(e.target.value)} - autoComplete="new-password" - /> - - - -
-
- - {/* Phone Number */} -
- -
- setPhonenumber(e.target.value)} - autoComplete="tel" - /> - {/* Simple emoji icon to match the padded layout without adding a new component */} - 📞 -
-
- - {/* Subscribe */} - {/*
- -
*/} + {/* Alerts */} {err && ( -
+
{err}
)} {msg && ( -
+
{msg}
)} - {/* Submit */} - +
+ + {/* Name */} +
+ setName(e.target.value)} + className="w-full ps-10 py-3 + bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg + text-white placeholder:text-gray-400 + focus:outline-none focus:border-white/30" + /> + + + +
+ + {/* Email */} +
+ setEmail(e.target.value)} + className="w-full ps-10 py-3 + bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg + text-white placeholder:text-gray-400 + focus:outline-none focus:border-white/30" + /> + + + +
+ + {/* Password */} +
+ setPassword(e.target.value)} + className="w-full ps-10 py-3 + bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg + text-white placeholder:text-gray-400 + focus:outline-none focus:border-white/30" + /> + + + +
+ + {/* Phone */} +
+ setPhonenumber(e.target.value)} + className="w-full ps-10 py-3 + bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg + text-white placeholder:text-gray-400 + focus:outline-none focus:border-white/30" + /> + + 📞 + +
+ + {/* Submit */} + + +
); }; diff --git a/components/auth/components-auth-reset-password-form.tsx b/components/auth/components-auth-reset-password-form.tsx index 3e478ae..70bb2cf 100644 --- a/components/auth/components-auth-reset-password-form.tsx +++ b/components/auth/components-auth-reset-password-form.tsx @@ -10,22 +10,48 @@ const ComponentsAuthResetPasswordForm = () => { e.preventDefault(); router.push('/'); }; + return ( -
-
- -
- - - + + +
+ + {/* Email */} +
+ + + + + +
+ + {/* Submit */} + +
- ); }; diff --git a/components/auth/components-auth-unlock-form.tsx b/components/auth/components-auth-unlock-form.tsx index 1856ca8..4e3c233 100644 --- a/components/auth/components-auth-unlock-form.tsx +++ b/components/auth/components-auth-unlock-form.tsx @@ -33,27 +33,21 @@ const ComponentsAuthChangePasswordForm = () => { return; } - // ✅ Create FormData and append fields const formData = new FormData(); formData.append('currentPassword', currentPassword); formData.append('newPassword', newPassword); - // ✅ Axios call with generic type const res = await axios.post( `https://ebay.backend.data4autos.com/api/auth/change-password`, formData, { headers: { Authorization: `Bearer ${token}`, - // If you're sending FormData, remove JSON content-type - // Axios will automatically set multipart/form-data }, } ); setSuccess(res.data.message || 'Password updated successfully!'); - - // Optional: force re-login after password change localStorage.removeItem('token'); router.push('/login'); } catch (err: any) { @@ -65,59 +59,91 @@ const ComponentsAuthChangePasswordForm = () => { }; return ( -
- {/* Current password */} -
- -
+ + + {/* Alerts */} + {error && ( +
+ {error} +
+ )} + {success && ( +
+ {success} +
+ )} + +
+ + {/* Current Password */} +
+ + setCurrentPassword(e.target.value)} required + className="w-full ps-10 py-3 + bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg + text-white placeholder:text-gray-400 + focus:outline-none focus:border-white/30" /> - - + + +
-
- {/* New password */} -
- -
+ {/* New Password */} +
+ + setNewPassword(e.target.value)} required + className="w-full ps-10 py-3 + bg-[rgba(7,13,30,0.7)] + border border-white/15 rounded-lg + text-white placeholder:text-gray-400 + focus:outline-none focus:border-white/30" /> - - + + +
+ + {/* Submit */} + +
- - {error &&

{error}

} - {success &&

{success}

} - - ); }; diff --git a/components/layouts/content-animation.tsx b/components/layouts/content-animation.tsx index a7094d9..f07eb5e 100644 --- a/components/layouts/content-animation.tsx +++ b/components/layouts/content-animation.tsx @@ -1,4 +1,5 @@ 'use client'; + import { IRootState } from '@/store'; import { usePathname } from 'next/navigation'; import React, { useEffect, useState } from 'react'; @@ -18,11 +19,21 @@ const ContentAnimation = ({ children }: { children: React.ReactNode }) => { setTimeout(() => { setAnimation(''); }, 1100); - }, [pathname]); + }, [pathname, themeConfig.animation]); + return ( <> {/* BEGIN CONTENT AREA */} -
{children}
+
+ {children} +
{/* END CONTENT AREA */} ); diff --git a/components/layouts/footer.tsx b/components/layouts/footer.tsx index 29c2de7..88fbd10 100644 --- a/components/layouts/footer.tsx +++ b/components/layouts/footer.tsx @@ -1,6 +1,23 @@ const Footer = () => { return ( -
© {new Date().getFullYear()}. Vristo All rights reserved.
+
+ +
+ © {new Date().getFullYear()}. SocialBuddy All rights reserved. Powered By{' '} + + MetatronCube + +
+
); }; diff --git a/components/layouts/header.tsx b/components/layouts/header.tsx index 9e29fb2..276da6b 100644 --- a/components/layouts/header.tsx +++ b/components/layouts/header.tsx @@ -208,8 +208,17 @@ const Header = () => { return (
-
-
+
+ +
- logo - logo + logo + +logo + + {/* Data4Autos */} @@ -244,7 +264,7 @@ const Header = () => {
*/} -
+
{/*
} >
  • -
    +
    -

    - Data4Autos +

    + socialbuddy {/* Pro */}

    -
  • - {/*
  • - +
  • + Profile
  • -
  • + {/*
  • Inbox @@ -525,7 +545,7 @@ const Header = () => { Lock Screen
  • */} -
  • +
  • -
    -
    - -

    TEMPLATE CUSTOMIZER

    -

    Set preferences that will be cookied for your live preview demonstration.

    +

    + Template Customizer +

    + +

    + UI preferences (saved automatically) +

    -
    -
    Color Scheme
    -

    Overall light or dark presentation.

    -
    - + {/* ================================================== + SETTINGS SECTIONS + ================================================== */} +
    - + {/* COLOR SCHEME */} +
    +
    Color Scheme
    - -
    -
    +
    + -
    -
    Navigation Position
    -

    Select the primary navigation paradigm for your app.

    -
    - + - + +
    + - -
    -
    - -
    -
    + {/* NAVIGATION */} +
    +
    Navigation
    -
    -
    Layout Style
    -

    Select the primary layout style for your app.

    -
    - +
    + - -
    -
    + -
    -
    Direction
    -

    Select the direction for your app.

    -
    - + +
    - -
    -
    - -
    -
    Navbar Type
    -

    Sticky or Floating.

    -
    -
    -
    +
    -
    -
    Router Transition
    -

    Animation of main content.

    -
    - dispatch(toggleNavbar(val))} + /> + {val.replace('navbar-', '')} + + ) + )} +
    + + + {/* PAGE ANIMATION */} +
    +
    Page Transition
    + + -
    + +
    diff --git a/components/layouts/sidebar.tsx b/components/layouts/sidebar.tsx index 150d1fc..1651be8 100644 --- a/components/layouts/sidebar.tsx +++ b/components/layouts/sidebar.tsx @@ -40,14 +40,14 @@ const Sidebar = () => { } } } - }, [pathname]); + }, [dispatch, themeConfig.sidebar]); useEffect(() => { setActiveRoute(); if (window.innerWidth < 1024 && themeConfig.sidebar) { dispatch(toggleSidebar()); } - }, [pathname]); + }, [dispatch, themeConfig.sidebar]); const setActiveRoute = () => { let allLinks = document.querySelectorAll('.sidebar ul a.active'); @@ -60,15 +60,13 @@ const Sidebar = () => { }; return ( -
    -