Update Fix
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import GridShape from "../../components/common/GridShape";
|
||||
import { Link } from "react-router-dom";
|
||||
import ThemeTogglerTwo from "../../components/common/ThemeTogglerTwo";
|
||||
import { apiGet } from "../../lib/api";
|
||||
|
||||
export default function AuthLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [storeName, setStoreName] = useState("POS");
|
||||
const [storeLogo, setStoreLogo] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
let mounted = true;
|
||||
apiGet<{ data: { toko?: { nama?: string } } }>("/admin-api/pengaturan")
|
||||
.then((res) => {
|
||||
const name = res?.data?.toko?.nama?.trim();
|
||||
const logo = res?.data?.toko?.logo || "";
|
||||
if (mounted && name) setStoreName(name);
|
||||
if (mounted) setStoreLogo(logo);
|
||||
})
|
||||
.catch(() => {});
|
||||
return () => {
|
||||
mounted = false;
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="relative p-6 bg-white z-1 dark:bg-gray-900 sm:p-0">
|
||||
<div className="relative flex flex-col justify-center w-full h-screen lg:flex-row dark:bg-gray-900 sm:p-0">
|
||||
{children}
|
||||
<div className="items-center hidden w-full h-full lg:w-1/2 bg-brand-950 dark:bg-white/5 lg:grid">
|
||||
<div className="relative flex items-center justify-center z-1">
|
||||
{/* <!-- ===== Common Grid Shape Start ===== --> */}
|
||||
<GridShape />
|
||||
<div className="flex flex-col items-center max-w-xs">
|
||||
<Link to="/" className="block mb-4">
|
||||
<div className="flex flex-col items-center gap-3">
|
||||
{storeLogo ? (
|
||||
<img
|
||||
src={storeLogo}
|
||||
alt="Logo"
|
||||
className="h-16 w-16 rounded-xl border border-white/10 bg-white/5 object-contain"
|
||||
/>
|
||||
) : null}
|
||||
<span className="text-2xl font-semibold text-white">
|
||||
{storeName}
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
<p className="text-center text-gray-400 dark:text-white/60">
|
||||
Sistem kasir sederhana untuk operasional harian
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="fixed z-50 hidden bottom-6 right-6 sm:block">
|
||||
<ThemeTogglerTwo />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
17
resources/js/admin/tailadmin/pages/AuthPages/SignIn.tsx
Normal file
17
resources/js/admin/tailadmin/pages/AuthPages/SignIn.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import PageMeta from "../../components/common/PageMeta";
|
||||
import AuthLayout from "./AuthPageLayout";
|
||||
import SignInForm from "../../components/auth/SignInForm";
|
||||
|
||||
export default function SignIn() {
|
||||
return (
|
||||
<>
|
||||
<PageMeta
|
||||
title="React.js SignIn Dashboard | TailAdmin - Next.js Admin Dashboard Template"
|
||||
description="This is React.js SignIn Tables Dashboard page for TailAdmin - React.js Tailwind CSS Admin Dashboard Template"
|
||||
/>
|
||||
<AuthLayout>
|
||||
<SignInForm />
|
||||
</AuthLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
17
resources/js/admin/tailadmin/pages/AuthPages/SignUp.tsx
Normal file
17
resources/js/admin/tailadmin/pages/AuthPages/SignUp.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import PageMeta from "../../components/common/PageMeta";
|
||||
import AuthLayout from "./AuthPageLayout";
|
||||
import SignUpForm from "../../components/auth/SignUpForm";
|
||||
|
||||
export default function SignUp() {
|
||||
return (
|
||||
<>
|
||||
<PageMeta
|
||||
title="React.js SignUp Dashboard | TailAdmin - Next.js Admin Dashboard Template"
|
||||
description="This is React.js SignUp Tables Dashboard page for TailAdmin - React.js Tailwind CSS Admin Dashboard Template"
|
||||
/>
|
||||
<AuthLayout>
|
||||
<SignUpForm />
|
||||
</AuthLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user