Initial Changes
This commit is contained in:
@@ -1,12 +1,27 @@
|
||||
"use client";
|
||||
|
||||
import MainContext from "@/app/contexts/mainContext";
|
||||
import { backendUrl, serAxios } from "@/utils/axios";
|
||||
import Image from "next/image";
|
||||
import React, { useContext, useState } from "react";
|
||||
import React, { useContext, useEffect, useState } from "react";
|
||||
|
||||
const getAuthPageData = async () => {
|
||||
// Fetch data from external API
|
||||
try {
|
||||
const res = await serAxios.get("/dynamic-ui/page/auth/");
|
||||
const data = res.data;
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
return null;
|
||||
}
|
||||
// Pass data to the page via props
|
||||
};
|
||||
|
||||
const LoginSignup = () => {
|
||||
const [isLogin, setIsLogin] = useState(true);
|
||||
const { loginUser, registerUser } = useContext(MainContext);
|
||||
const [loginPageData, setLoginPageData] = useState(null);
|
||||
const [formData, setFormData] = useState({
|
||||
email: "",
|
||||
password: "",
|
||||
@@ -34,12 +49,22 @@ const LoginSignup = () => {
|
||||
setFormData({ email: "", password: "", confirmPassword: "" });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getAuthPageData().then((data) => {
|
||||
setLoginPageData(data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex h-screen bg-gray-100">
|
||||
{/* Left section with video */}
|
||||
<div className="hidden lg:flex lg:w-[60%] bg-cover bg-center">
|
||||
<video
|
||||
src="/loginvideo.mp4"
|
||||
src={`${
|
||||
loginPageData?.bannerVideo?.path
|
||||
? backendUrl + loginPageData?.bannerVideo?.path
|
||||
: "/loginvideo.mp4"
|
||||
}`}
|
||||
className="object-cover w-full h-full"
|
||||
autoPlay
|
||||
loop
|
||||
@@ -130,13 +155,13 @@ const LoginSignup = () => {
|
||||
</div>
|
||||
</form>
|
||||
<div className="text-center">
|
||||
<h2 className="text-[#AC8C6B] font-semibold">
|
||||
{/* <h2 className="text-[#AC8C6B] font-semibold">
|
||||
Manage subscriptions
|
||||
</h2>
|
||||
<h2 className="text-xl my-3">or</h2>
|
||||
</h2> */}
|
||||
{/* <h2 className="text-xl my-3">or</h2>
|
||||
<h2 className="capitalize border-2 px-5 py-3">
|
||||
Continue with google
|
||||
</h2>
|
||||
</h2> */}
|
||||
<button
|
||||
onClick={toggleMode}
|
||||
className="font-medium text-[#C19A5B] mt-10"
|
||||
|
||||
Reference in New Issue
Block a user