diff --git a/src/app_modules/auth/login/view.tsx b/src/app_modules/auth/login/view.tsx index a8dfc89f..6f08325d 100644 --- a/src/app_modules/auth/login/view.tsx +++ b/src/app_modules/auth/login/view.tsx @@ -24,6 +24,11 @@ import { RouterAuth } from "@/app/lib/router_hipmi/router_auth"; import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil"; import { PhoneInput } from "react-international-phone"; import "react-international-phone/style.css"; +import { + AccentColor, + MainColor, +} from "@/app_modules/component_global/color/color_pallet"; +import ComponentGlobal_ErrorInput from "@/app_modules/component_global/error_input"; export default function Login() { const router = useRouter(); @@ -31,15 +36,13 @@ export default function Login() { const focusTrapRef = useFocusTrap(); const [phone, setPhone] = useState(""); const [loading, setLoading] = useState(false); + const [isError, setError] = useState(false); async function onLogin() { - // if (nomor.length < 10) - // return ComponentGlobal_NotifikasiPeringatan("Nomor minimal 10 digit"); - // if (nomor.length > 13) - // return ComponentGlobal_NotifikasiPeringatan("Nomor maximal 13 digit"); - const nomorHp = phone.substring(1); - // console.log(nomorHp) + console.log(nomorHp); + + if (nomorHp.length <= 4) return setError(true); await auth_funLogin(nomorHp).then((res) => { if (res.status === 200) { @@ -79,47 +82,54 @@ export default function Login() { return ( <> - -
- -
- logo -
- - Selamat Datang di HIPMI App - - Silahkan masukan nomor telepon anda untuk masuk ! - - + + + + WELCOME TO + + HIPMI APPS + - { - setPhone(val); - }} - /> + +
+ Nomor telepon +
+ { + setPhone(val); + }} + /> - -
-
+ {isError ? ( + + ) : ( + "" + )} + + +
); diff --git a/src/app_modules/auth/splash/view.tsx b/src/app_modules/auth/splash/view.tsx index 80df56af..b7ae6b7a 100644 --- a/src/app_modules/auth/splash/view.tsx +++ b/src/app_modules/auth/splash/view.tsx @@ -1,23 +1,17 @@ "use client"; +import { MainColor } from "@/app_modules/component_global/color/color_pallet"; import { - AspectRatio, - Box, Center, - Flex, Image, Paper, - Stack, - Text, - Title, + Stack } from "@mantine/core"; import { useShallowEffect } from "@mantine/hooks"; import { useRouter } from "next/navigation"; -import { useState } from "react"; export default function SplashScreen({ data }: { data: any }) { const router = useRouter(); - const [val, setVal] = useState(false); useShallowEffect(() => { if (!data) { @@ -32,16 +26,16 @@ export default function SplashScreen({ data }: { data: any }) { }, []); return ( <> -
+
{/* Welcome to */} - +
diff --git a/src/app_modules/component_global/color/color_pallet.ts b/src/app_modules/component_global/color/color_pallet.ts new file mode 100644 index 00000000..9ce5fab0 --- /dev/null +++ b/src/app_modules/component_global/color/color_pallet.ts @@ -0,0 +1,12 @@ +export const MainColor = { + black: "#202020", + darkblue: "#001D3D", + yellow: "#FFC300", +}; + +export const AccentColor = { + blackgray: "#333533", + darkblue: "#002E59", + blue: "#00447D", + yellow: "#FFD60A", +};