Portofolio
#feat - Create porto - Edit Porto - Upload gambar background profile - List user - Search user ## No issuue
This commit is contained in:
@@ -3,6 +3,6 @@ import Login from "./login/view";
|
||||
import Validasi from "./validasi/view";
|
||||
import LayoutValidasi from "./validasi/layout";
|
||||
import Register from "./register/view";
|
||||
import Logout from "./logout/view";
|
||||
import User_Logout from "./logout/view";
|
||||
|
||||
export { SplashScreen, Login, Validasi, Register, Logout, LayoutValidasi };
|
||||
export { SplashScreen, Login, Validasi, Register, User_Logout as Logout, LayoutValidasi };
|
||||
|
||||
@@ -1,33 +1,28 @@
|
||||
"use client";
|
||||
import { myConsole } from "@/app/fun/my_console";
|
||||
import { ApiHipmi } from "@/app/lib/api";
|
||||
import { ActionIcon, Button, Group, Modal } from "@mantine/core";
|
||||
import { ActionIcon, Button, Group, Modal, Stack, Title } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_nomor, gs_otp } from "../state/state";
|
||||
import { IconLogout } from "@tabler/icons-react";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import { gs_token } from "@/app_modules/home/state/global_state";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
|
||||
export default function Logout() {
|
||||
export default function User_Logout() {
|
||||
const router = useRouter();
|
||||
const [nomor, setnomor] = useAtom(gs_nomor);
|
||||
const [code, setCode] = useAtom(gs_otp);
|
||||
const [token, setToken] = useAtom(gs_token);
|
||||
|
||||
const [opened, { toggle }] = useDisclosure(false);
|
||||
|
||||
const onLogout = async () => {
|
||||
// MyConsole("keluar");
|
||||
|
||||
await fetch(ApiHipmi.logout)
|
||||
.then((res) => res.json())
|
||||
.then((val) => {
|
||||
if (val.status == 200) {
|
||||
setnomor(null);
|
||||
setCode(null);
|
||||
setToken(null);
|
||||
|
||||
return router.push("/dev/auth/login");
|
||||
}
|
||||
@@ -36,25 +31,31 @@ export default function Logout() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal opened={opened} onClose={toggle} centered title="Yakin ingin keluar ?">
|
||||
<Group align="center" position="center">
|
||||
<Button compact onClick={toggle} radius={50}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
compact
|
||||
radius={50}
|
||||
bg={Warna.merah}
|
||||
color="red"
|
||||
onClick={() => onLogout()}
|
||||
>
|
||||
Keluar
|
||||
</Button>
|
||||
</Group>
|
||||
<Modal opened={opened} onClose={toggle} centered withCloseButton={false}>
|
||||
<Stack>
|
||||
<Title order={6}>Anda yakin ingin keluar ?</Title>
|
||||
<Group align="center" position="center">
|
||||
<Button compact onClick={toggle} radius={50}>
|
||||
Batal
|
||||
</Button>
|
||||
<Button
|
||||
compact
|
||||
radius={50}
|
||||
bg={Warna.merah}
|
||||
color="red"
|
||||
onClick={() => onLogout()}
|
||||
>
|
||||
Keluar
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
<ActionIcon variant="transparent">
|
||||
{/* <ActionIcon variant="transparent">
|
||||
<IconLogout color={Warna.merah} onClick={toggle} />
|
||||
</ActionIcon>
|
||||
</ActionIcon> */}
|
||||
<Button radius={"xl"} color={"red"} onClick={toggle}>
|
||||
Logout
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { IconChevronLeft, IconCircleLetterH } from "@tabler/icons-react";
|
||||
import toast from "react-simple-toasts";
|
||||
import { ApiHipmi } from "@/app/lib/api";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
|
||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { NotifBerhasil } from "@/app_modules/donasi/component/notifikasi/notif_berhasil";
|
||||
import { NotifGagal } from "@/app_modules/donasi/component/notifikasi/notif_gagal";
|
||||
|
||||
Reference in New Issue
Block a user