feat
Deskripsi: - Feature splash screen - Create login page
This commit is contained in:
9
src/app/dev/auth/login/page.tsx
Normal file
9
src/app/dev/auth/login/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Login } from "@/app_modules/auth";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<Login />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
import { SplashScreen } from "@/app_modules/auth";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Page(){
|
||||
return<>
|
||||
<SplashScreen/>
|
||||
export default function PageSplash() {
|
||||
return (
|
||||
<>
|
||||
<SplashScreen />
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
9
src/app/dev/home/page.tsx
Normal file
9
src/app/dev/home/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { HomeView } from "@/app_modules/home";
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<HomeView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SplashScreen } from "@/app_modules/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import PageSplash from "./dev/auth/splash/page";
|
||||
|
||||
export default async function Page() {
|
||||
|
||||
return redirect("/dev/auth/splash")
|
||||
return <PageSplash />;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import SplashScreen from "./splash/view";
|
||||
import Login from "./login/view";
|
||||
|
||||
export {SplashScreen}
|
||||
export {SplashScreen, Login}
|
||||
11
src/app_modules/auth/login/view.tsx
Normal file
11
src/app_modules/auth/login/view.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
"use client"
|
||||
import { Center, Title } from "@mantine/core";
|
||||
|
||||
export default function Login(){
|
||||
return <>
|
||||
<Center h={"100vh"}>
|
||||
<Title>Login</Title>
|
||||
|
||||
</Center>
|
||||
</>
|
||||
}
|
||||
@@ -1,10 +1,28 @@
|
||||
"use client"
|
||||
"use client";
|
||||
|
||||
import { Title } from "@mantine/core"
|
||||
import { Title } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function SplashScreen(){
|
||||
return <>
|
||||
<Title>Splash Screen</Title>
|
||||
|
||||
export default function SplashScreen() {
|
||||
const router = useRouter();
|
||||
const [val, setVal] = useState(false);
|
||||
|
||||
useShallowEffect(() => {
|
||||
if (!val) {
|
||||
setTimeout(() => {
|
||||
return router.push("/dev/auth/login");
|
||||
}, 2000);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
return router.push("/dev/home");
|
||||
}, 2000);
|
||||
}
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<Title>Splash Screen</Title>
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
3
src/app_modules/home/index.ts
Normal file
3
src/app_modules/home/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import HomeView from "./view";
|
||||
|
||||
export {HomeView}
|
||||
11
src/app_modules/home/view.tsx
Normal file
11
src/app_modules/home/view.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import { Title } from "@mantine/core";
|
||||
|
||||
export default function HomeView() {
|
||||
return (
|
||||
<>
|
||||
<Title>Home</Title>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user