feat
Deskripsi: - Feature splash screen - Create login page
This commit is contained in:
@@ -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