style : update module
Deskripsi: - add global - add users No issue
This commit is contained in:
@@ -5,6 +5,7 @@ import LoadingPage from "./layout/layout_loading_page";
|
||||
import LayoutLogin from "./layout/layout_login";
|
||||
import LayoutNavbarHome from "./layout/layout_navbar_home";
|
||||
import { isDrawer } from "./val/isDrawer";
|
||||
import { isModal } from "./val/isModal";
|
||||
|
||||
export { WARNA }
|
||||
export { LayoutLogin }
|
||||
@@ -12,4 +13,5 @@ export { LayoutNavbarHome }
|
||||
export { LayoutIconBack }
|
||||
export { LoadingPage }
|
||||
export { LayoutDrawer }
|
||||
export { isDrawer }
|
||||
export { isDrawer }
|
||||
export { isModal }
|
||||
30
src/module/_global/layout/layout_modal.tsx
Normal file
30
src/module/_global/layout/layout_modal.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { useHookstate } from '@hookstate/core';
|
||||
import { Box, Button, Flex, Modal, Text } from '@mantine/core';
|
||||
import React from 'react';
|
||||
import { BsQuestionCircleFill } from 'react-icons/bs';
|
||||
import { isModal } from '../val/isModal';
|
||||
|
||||
export default function LayoutModal({ opened, onClose, description, onYes }: { opened: boolean, onClose: () => void, description: string, onYes: (val: boolean) => void }) {
|
||||
const openModal = useHookstate(isModal)
|
||||
return (
|
||||
<Modal styles={{
|
||||
body: {
|
||||
margin: 10,
|
||||
},
|
||||
content: {
|
||||
border: `2px solid ${'#828AFC'}`,
|
||||
borderRadius: 10
|
||||
}
|
||||
}} opened={opened} onClose={onClose} withCloseButton={false} centered closeOnClickOutside={false}>
|
||||
<Flex justify={"center"} align={"center"} direction={"column"}>
|
||||
<BsQuestionCircleFill size={100} color="red" />
|
||||
<Text mt={30} ta={"center"} fw={"bold"} fz={18}>{description}</Text>
|
||||
<Box mt={30} w={'100%'}>
|
||||
<Button mb={20} fullWidth size="lg" radius={'xl'} bg={'#4754F0'} onClick={() => onYes(true)}>YA</Button>
|
||||
<Button fullWidth size="lg" radius={'xl'} bg={'#DCE1FE'} c={'#4754F0'} onClick={() => openModal.set(false)}>TIDAK</Button>
|
||||
</Box>
|
||||
</Flex>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
4
src/module/_global/val/isModal.ts
Normal file
4
src/module/_global/val/isModal.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
'use client'
|
||||
import { hookstate } from '@hookstate/core';
|
||||
|
||||
export const isModal = hookstate(false)
|
||||
94
src/module/user/profile/component/edit_profile.tsx
Normal file
94
src/module/user/profile/component/edit_profile.tsx
Normal file
@@ -0,0 +1,94 @@
|
||||
"use client"
|
||||
import { isModal, WARNA } from "@/module/_global";
|
||||
import { Box, Button, Flex, Modal, Stack, Text, TextInput } from "@mantine/core";
|
||||
import HeaderEditProfile from "../component/ui/header_edit_profile";
|
||||
import { HiUser } from "react-icons/hi2";
|
||||
import { useHookstate } from "@hookstate/core";
|
||||
import { BsQuestionCircleFill } from "react-icons/bs"
|
||||
import toast from "react-hot-toast";
|
||||
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||
|
||||
export default function EditProfile() {
|
||||
const openModal = useHookstate(isModal)
|
||||
|
||||
function onTrue() {
|
||||
toast.success("Sukses! Data tersimpan");
|
||||
openModal.set(false)
|
||||
}
|
||||
return (
|
||||
<Box>
|
||||
<HeaderEditProfile />
|
||||
<Stack
|
||||
align="center"
|
||||
justify="center"
|
||||
gap="xs"
|
||||
pt={30}
|
||||
px={20}
|
||||
>
|
||||
<Box bg={WARNA.biruTua} py={30} px={50}
|
||||
style={{
|
||||
borderRadius: 10,
|
||||
}}>
|
||||
<HiUser size={100} color={WARNA.bgWhite} />
|
||||
</Box>
|
||||
<TextInput
|
||||
size="md" type="number" radius={30} placeholder="NIK" withAsterisk label="NIK" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
size="md" type="text" radius={30} placeholder="Nama" withAsterisk label="Nama" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
size="md" type="email" radius={30} placeholder="Email" withAsterisk label="Email" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
size="md" type="number" radius={30} placeholder="+62...." withAsterisk label="Nomor Telepon" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
<Box mt={30} mx={20} pb={20}>
|
||||
<Button
|
||||
c={"white"}
|
||||
bg={WARNA.biruTua}
|
||||
size="md"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => openModal.set(true)}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Box>
|
||||
<LayoutModal opened={openModal.get()} onClose={() => openModal.set(false)}
|
||||
description="Apakah Anda Ingin Mengganti
|
||||
Status Aktivasi Data?"
|
||||
onYes={onTrue} />
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import React from 'react';
|
||||
|
||||
export default function HeaderEditProfile() {
|
||||
return (
|
||||
<Box>
|
||||
<LayoutNavbarHome>
|
||||
<Grid justify='center' align='center'>
|
||||
<Grid.Col span="auto">
|
||||
@@ -17,7 +16,6 @@ export default function HeaderEditProfile() {
|
||||
<Grid.Col span="auto"></Grid.Col>
|
||||
</Grid>
|
||||
</LayoutNavbarHome>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,77 +1,13 @@
|
||||
import { WARNA } from "@/module/_global";
|
||||
import { Box, Button, Stack, TextInput } from "@mantine/core";
|
||||
|
||||
import { isModal, WARNA } from "@/module/_global";
|
||||
import { Box, Button, Modal, Stack, TextInput } from "@mantine/core";
|
||||
import HeaderEditProfile from "../component/ui/header_edit_profile";
|
||||
import { HiUser } from "react-icons/hi2";
|
||||
import { useHookstate } from "@hookstate/core";
|
||||
import EditProfile from "../component/edit_profile";
|
||||
|
||||
export default function ViewEditProfile() {
|
||||
return (
|
||||
<Box>
|
||||
<HeaderEditProfile />
|
||||
<Stack
|
||||
align="center"
|
||||
justify="center"
|
||||
gap="xs"
|
||||
pt={30}
|
||||
px={20}
|
||||
>
|
||||
<Box bg={WARNA.biruTua} py={30} px={50}
|
||||
style={{
|
||||
borderRadius: 10,
|
||||
}}>
|
||||
<HiUser size={100} color={WARNA.bgWhite} />
|
||||
</Box>
|
||||
<TextInput
|
||||
size="md" type="number" radius={30} placeholder="NIK" withAsterisk label="NIK" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
size="md" type="text" radius={30} placeholder="Nama" withAsterisk label="Nama" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
size="md" type="email" radius={30} placeholder="Email" withAsterisk label="Email" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
size="md" type="number" radius={30} placeholder="+62...." withAsterisk label="Nomor Telepon" w={"100%"}
|
||||
styles={{
|
||||
input: {
|
||||
color: WARNA.biruTua,
|
||||
borderRadius: WARNA.biruTua,
|
||||
borderColor: WARNA.biruTua,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
<Box mt={30} mx={20}>
|
||||
<Button
|
||||
c={"white"}
|
||||
bg={WARNA.biruTua}
|
||||
size="md"
|
||||
radius={30}
|
||||
fullWidth
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
<EditProfile/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user