API Auth
This commit is contained in:
@@ -12,6 +12,11 @@ import { NavbarSearch } from "./NavBarSearch"
|
||||
import { NavbarSubMenu } from "./NavbarSubMenu"
|
||||
import { useRouter } from "next/navigation"
|
||||
|
||||
// contoh state auth (dummy aja dulu, bisa diganti sesuai sistem auth kamu)
|
||||
const stateAuth = {
|
||||
role: "admin", // coba ubah ke "user" buat test
|
||||
}
|
||||
|
||||
export function NavbarMainMenu({ listNavbar }: { listNavbar: MenuItem[] }) {
|
||||
const { item, isSearch } = useSnapshot(stateNav)
|
||||
const router = useTransitionRouter()
|
||||
@@ -40,9 +45,11 @@ export function NavbarMainMenu({ listNavbar }: { listNavbar: MenuItem[] }) {
|
||||
/>
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
|
||||
{listNavbar.map((item, k) => (
|
||||
<MenuItemCom key={k} item={item} />
|
||||
))}
|
||||
|
||||
<Tooltip label="Search content" position="bottom" withArrow>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
@@ -56,20 +63,25 @@ export function NavbarMainMenu({ listNavbar }: { listNavbar: MenuItem[] }) {
|
||||
<IconSearch size="1.5rem" />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Tooltip label="My Profile" position="bottom" withArrow>
|
||||
<ActionIcon
|
||||
onClick={() => {
|
||||
next.push("/admin/landing-page/profile/program-inovasi")
|
||||
}}
|
||||
color={colors["blue-button"]}
|
||||
radius="xl"
|
||||
variant="light"
|
||||
>
|
||||
<IconUser size={22} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
|
||||
{/* hanya tampil kalau role = admin */}
|
||||
{stateAuth.role === "admin" && (
|
||||
<Tooltip label="My Profile" position="bottom" withArrow>
|
||||
<ActionIcon
|
||||
onClick={() => {
|
||||
next.push("/admin/landing-page/profile/program-inovasi")
|
||||
}}
|
||||
color={colors["blue-button"]}
|
||||
radius="xl"
|
||||
variant="light"
|
||||
>
|
||||
<IconUser size={22} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Flex>
|
||||
</Container>
|
||||
|
||||
{item && <NavbarSubMenu item={item as MenuItem[]} />}
|
||||
{isSearch && <NavbarSearch />}
|
||||
</Stack>
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
import colors from '@/con/colors';
|
||||
import { Box, Button, Center, Flex, Group, Image, Paper, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||
import { IconUserFilled } from '@tabler/icons-react';
|
||||
import Link from 'next/link';
|
||||
import BackButton from '../(pages)/desa/layanan/_com/BackButto';
|
||||
|
||||
|
||||
function Page() {
|
||||
return (
|
||||
<Stack pos={"relative"} bg={colors.Bg} py={"xl"} gap={"22"}>
|
||||
<Box px={{ base: 'md', md: 100 }}>
|
||||
<BackButton />
|
||||
</Box>
|
||||
<Box px={{ base: 'md', md: 100 }} >
|
||||
<Center>
|
||||
<Image src={"/api/img/darmasaba-icon.png"} alt="" w={80} />
|
||||
</Center>
|
||||
<Box>
|
||||
<Title ta={'center'} order={1} fw={'bold'} c={colors['blue-button']}>
|
||||
E-Book Desa Darmasaba
|
||||
</Title>
|
||||
<Text ta={'center'} fz={'h4'} fw={'bold'} c={colors['blue-button']}>
|
||||
Silahkan masukkan akun anda untuk menjelajahi berbagai macam buku di perpustakaan digital
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box px={{ base: 'md', md: 100 }} pb={50}>
|
||||
<Group justify='center'>
|
||||
<Paper p={'xl'} radius={'md'} bg={colors['white-trans-1']}>
|
||||
<Stack align='center'>
|
||||
<Title order={2} fw={'bold'} c={colors['blue-button']}>
|
||||
Login
|
||||
</Title>
|
||||
<IconUserFilled size={80} color={colors['blue-button']} />
|
||||
<Box>
|
||||
<Text c={colors['blue-button']} fw={'bold'}>Masuk Untuk Akses Lebih Banyak Buku</Text>
|
||||
<TextInput placeholder='Email' />
|
||||
<TextInput py={20} placeholder='Password' />
|
||||
<Box pb={20} >
|
||||
<Button component={Link} href={'/darmasaba/pendidikan/perpustakaan-digital'} fullWidth bg={colors['blue-button']} radius={'xl'}>Masuk</Button>
|
||||
</Box>
|
||||
<Flex justify={'center'} align={'center'}>
|
||||
<Text>Belum punya akun? </Text>
|
||||
<Button variant='transparent' component={Link} href={'/darmasaba/pendidikan/perpustakaan-digital/registrasi'}>
|
||||
<Text c={colors['blue-button']} fw={'bold'}>Registrasi</Text>
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Group>
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
@@ -1,67 +0,0 @@
|
||||
import colors from '@/con/colors';
|
||||
import { Box, Button, Center, Checkbox, Group, Image, Paper, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||
import Link from 'next/link';
|
||||
import BackButton from '../(pages)/desa/layanan/_com/BackButto';
|
||||
|
||||
|
||||
function Page() {
|
||||
return (
|
||||
<Stack pos={"relative"} bg={colors.Bg} py={"xl"} gap={"22"}>
|
||||
<Box px={{ base: 'md', md: 100 }}>
|
||||
<BackButton />
|
||||
</Box>
|
||||
<Box px={{ base: 'md', md: 100 }} >
|
||||
<Center>
|
||||
<Image src={"/api/img/darmasaba-icon.png"} alt="" w={80} />
|
||||
</Center>
|
||||
<Box>
|
||||
<Title ta={'center'} order={1} fw={'bold'} c={colors['blue-button']}>
|
||||
E-Book Desa Darmasaba
|
||||
</Title>
|
||||
<Text ta={'center'} fz={'h4'} fw={'bold'} c={colors['blue-button']}>
|
||||
Silahkan lengkapi data diri anda untuk mengakses e-book desa
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box px={{ base: 'md', md: 100 }} pb={50}>
|
||||
<Group justify='center'>
|
||||
<Paper p={'xl'} radius={'md'} bg={colors['white-trans-1']}>
|
||||
<Stack align='center'>
|
||||
<Title order={2} fw={'bold'} c={colors['blue-button']}>
|
||||
Registrasi
|
||||
</Title>
|
||||
<Box>
|
||||
<TextInput placeholder='Nama Lengkap'
|
||||
label='Nama Lengkap'
|
||||
/>
|
||||
<TextInput py={10} placeholder='Email'
|
||||
label='Email'
|
||||
/>
|
||||
<TextInput placeholder='day / month / year'
|
||||
label='Tanggal Lahir'
|
||||
/>
|
||||
<TextInput py={10} placeholder='08xx-xxxx-xxxx'
|
||||
label='Nomor Telepon'
|
||||
/>
|
||||
<TextInput pb={10} placeholder='Password'
|
||||
label='Password'
|
||||
/>
|
||||
<Box pb={10}>
|
||||
<Checkbox
|
||||
|
||||
label="Saya menyetujui syarat dan ketentuan yang berlaku"
|
||||
/>
|
||||
</Box>
|
||||
<Box pb={20} >
|
||||
<Button component={Link} href={'/darmasaba/pendidikan/perpustakaan-digital'} fullWidth bg={colors['blue-button']} radius={'xl'}>Daftar</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Group>
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
Reference in New Issue
Block a user