Merge pull request #16 from bipproduction/amalia/4-jul-24
Amalia/4 jul 24
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
"embla-carousel-autoplay": "^7.1.0",
|
"embla-carousel-autoplay": "^7.1.0",
|
||||||
"embla-carousel-react": "^7.1.0",
|
"embla-carousel-react": "^7.1.0",
|
||||||
"jotai": "^2.8.4",
|
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"next": "14.2.4",
|
"next": "14.2.4",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import LayoutIconBack from "./layout/layout_icon_back";
|
|||||||
import LoadingPage from "./layout/layout_loading_page";
|
import LoadingPage from "./layout/layout_loading_page";
|
||||||
import LayoutLogin from "./layout/layout_login";
|
import LayoutLogin from "./layout/layout_login";
|
||||||
import LayoutNavbarHome from "./layout/layout_navbar_home";
|
import LayoutNavbarHome from "./layout/layout_navbar_home";
|
||||||
import { isDrawer } from "./val/idDrawer";
|
import { isDrawer } from "./val/isDrawer";
|
||||||
|
|
||||||
export { WARNA }
|
export { WARNA }
|
||||||
export { LayoutLogin }
|
export { LayoutLogin }
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import { atom } from "jotai"
|
|
||||||
|
|
||||||
export const isDrawer = atom(false)
|
|
||||||
4
src/module/_global/val/isDrawer.ts
Normal file
4
src/module/_global/val/isDrawer.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
'use client'
|
||||||
|
import { hookstate } from '@hookstate/core';
|
||||||
|
|
||||||
|
export const isDrawer = hookstate(false)
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
import { isDrawer, LayoutDrawer, WARNA } from '@/module/_global';
|
import { isDrawer, LayoutDrawer, WARNA } from '@/module/_global';
|
||||||
|
import { useHookstate } from '@hookstate/core';
|
||||||
import { Box, Button, Center, Flex, Group, SimpleGrid, Stack, Text, TextInput } from '@mantine/core';
|
import { Box, Button, Center, Flex, Group, SimpleGrid, Stack, Text, TextInput } from '@mantine/core';
|
||||||
import { useAtom } from 'jotai';
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { IoAddCircle } from "react-icons/io5";
|
import { IoAddCircle } from "react-icons/io5";
|
||||||
|
|
||||||
export default function DrawerGroup() {
|
export default function DrawerGroup() {
|
||||||
const [openDrawerGroup, setOpenDrawerGroup] = useState(false)
|
const [openDrawerGroup, setOpenDrawerGroup] = useState(false)
|
||||||
const [openDrawer, setOpenDrawer] = useAtom(isDrawer)
|
const openDrawer = useHookstate(isDrawer)
|
||||||
|
|
||||||
function onCLose() {
|
function onCLose() {
|
||||||
setOpenDrawerGroup(false)
|
setOpenDrawerGroup(false)
|
||||||
setOpenDrawer(false)
|
openDrawer.set(false)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
@@ -55,7 +55,7 @@ export default function DrawerGroup() {
|
|||||||
MASUK
|
MASUK
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</LayoutDrawer>
|
</LayoutDrawer>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { isDrawer, LayoutDrawer, LayoutIconBack, LayoutNavbarHome, WARNA } from '@/module/_global';
|
import { isDrawer, LayoutDrawer, LayoutIconBack, LayoutNavbarHome, WARNA } from '@/module/_global';
|
||||||
import { ActionIcon, Box, Drawer, Grid, Group, Text } from '@mantine/core';
|
import { ActionIcon, Box, Drawer, Grid, Group, Text } from '@mantine/core';
|
||||||
import { useAtom } from 'jotai';
|
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import React, { useState } from 'react';
|
import React from 'react';
|
||||||
import { HiMenu } from "react-icons/hi";
|
import { HiMenu } from "react-icons/hi";
|
||||||
import DrawerGroup from './drawer_group';
|
import DrawerGroup from './drawer_group';
|
||||||
|
import { useHookstate } from '@hookstate/core';
|
||||||
|
|
||||||
export default function NavbarGroup() {
|
export default function NavbarGroup() {
|
||||||
const [openDrawer, setOpenDrawer] = useAtom(isDrawer)
|
const openDrawer = useHookstate(isDrawer)
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -22,14 +22,14 @@ export default function NavbarGroup() {
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span="auto">
|
<Grid.Col span="auto">
|
||||||
<Group justify='flex-end'>
|
<Group justify='flex-end'>
|
||||||
<ActionIcon onClick={() => setOpenDrawer(true)} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
<ActionIcon onClick={() => openDrawer.set(true)} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||||
<HiMenu size={20} color='white' />
|
<HiMenu size={20} color='white' />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Group>
|
</Group>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</LayoutNavbarHome>
|
</LayoutNavbarHome>
|
||||||
<LayoutDrawer opened={openDrawer} title={'MENU'} onClose={() => setOpenDrawer(false)}>
|
<LayoutDrawer opened={openDrawer.get()} title={'MENU'} onClose={() => openDrawer.set(false)}>
|
||||||
<DrawerGroup />
|
<DrawerGroup />
|
||||||
</LayoutDrawer>
|
</LayoutDrawer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -2270,11 +2270,6 @@ jiti@^1.21.0:
|
|||||||
resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz"
|
resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz"
|
||||||
integrity sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==
|
integrity sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==
|
||||||
|
|
||||||
jotai@^2.8.4:
|
|
||||||
version "2.8.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/jotai/-/jotai-2.8.4.tgz#ea82b013d640016100e360d19d565862816c96d0"
|
|
||||||
integrity sha512-f6jwjhBJcDtpeauT2xH01gnqadKEySwwt1qNBLvAXcnojkmb76EdqRt05Ym8IamfHGAQz2qMKAwftnyjeSoHAA==
|
|
||||||
|
|
||||||
"js-tokens@^3.0.0 || ^4.0.0":
|
"js-tokens@^3.0.0 || ^4.0.0":
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
|
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user