Merge pull request #65 from bipproduction/lukman/22-juli-2024
Lukman/22 juli 2024
This commit is contained in:
8
api.http
Normal file
8
api.http
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
###
|
||||||
|
POST http://localhost:3000/api/auth/login/ HTTP/1.1
|
||||||
|
Content-Type: application/json
|
||||||
|
{
|
||||||
|
"id": "devLukman",
|
||||||
|
"phone": "6287701790942",
|
||||||
|
"email": "lukman@bip.com"
|
||||||
|
}
|
||||||
25
src/app/api/auth/login/route.ts
Normal file
25
src/app/api/auth/login/route.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import prisma from "@/module/_global/bin/prisma";
|
||||||
|
import { Login } from "@/types/auth/login";
|
||||||
|
import { NextRequest } from "next/server";
|
||||||
|
|
||||||
|
export async function POST(req: NextRequest) {
|
||||||
|
const { email }: Login = await req.json();
|
||||||
|
const user = await prisma.user.findUnique({
|
||||||
|
where: { email, isActive: true },
|
||||||
|
select: { id: true, phone: true },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
return Response.json({
|
||||||
|
success: false,
|
||||||
|
message: "Email atau Password salah",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Response.json({
|
||||||
|
success: true,
|
||||||
|
message: "Login Berhasil",
|
||||||
|
phone: user.phone,
|
||||||
|
id: user.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
17
src/module/_global/bin/prisma.ts
Normal file
17
src/module/_global/bin/prisma.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client'
|
||||||
|
|
||||||
|
const prismaClientSingleton = () => {
|
||||||
|
return new PrismaClient()
|
||||||
|
}
|
||||||
|
|
||||||
|
type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>
|
||||||
|
|
||||||
|
const globalForPrisma = globalThis as unknown as {
|
||||||
|
prisma: PrismaClientSingleton | undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
const prisma = globalForPrisma.prisma ?? prismaClientSingleton()
|
||||||
|
|
||||||
|
export default prisma
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
|
||||||
@@ -7,7 +7,7 @@ export default function DrawerListDiscussion() {
|
|||||||
<Box>
|
<Box>
|
||||||
<Stack pt={10}>
|
<Stack pt={10}>
|
||||||
<SimpleGrid
|
<SimpleGrid
|
||||||
cols={{ base: 3, sm: 3, lg: 3 }}
|
cols={{ base: 2, sm: 2, lg: 3 }}
|
||||||
>
|
>
|
||||||
<Flex onClick={() => window.location.href = "/discussion/create"} justify={'center'} align={'center'} direction={'column'} >
|
<Flex onClick={() => window.location.href = "/discussion/create"} justify={'center'} align={'center'} direction={'column'} >
|
||||||
<Box>
|
<Box>
|
||||||
|
|||||||
@@ -18,27 +18,21 @@ export default function FormCreateDiscussion() {
|
|||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Grid gutter={2}>
|
<Group>
|
||||||
<Grid.Col span={"auto"}>
|
<Avatar src={'https://i.pravatar.cc/1000?img=32'} alt="it's me" size="lg" />
|
||||||
<Center>
|
<Box>
|
||||||
<Avatar src={'https://i.pravatar.cc/1000?img=32'} alt="it's me" size="lg" />
|
<Textarea
|
||||||
</Center>
|
placeholder="Tuliskan apa yang ingin anda diskusikan"
|
||||||
</Grid.Col>
|
w={"100%"}
|
||||||
<Grid.Col span={10}>
|
styles={{
|
||||||
<Box>
|
input: {
|
||||||
<Textarea
|
border: 'none',
|
||||||
placeholder="Tuliskan apa yang ingin anda diskusikan"
|
backgroundColor: 'transparent',
|
||||||
w={"100%"}
|
}
|
||||||
styles={{
|
}}
|
||||||
input: {
|
/>
|
||||||
border: 'none',
|
</Box>
|
||||||
backgroundColor: 'transparent',
|
</Group>
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Box mt="xl">
|
<Box mt="xl">
|
||||||
<Button
|
<Button
|
||||||
color="white"
|
color="white"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default function TabsDivisionTask() {
|
|||||||
return (
|
return (
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Tabs variant="pills" color='#FF9861' radius="xl" defaultValue="segera">
|
<Tabs variant="pills" color='#FF9861' radius="xl" defaultValue="segera">
|
||||||
<Tabs.List bg={"white"} style={{
|
<Tabs.List grow bg={"white"} style={{
|
||||||
border: `1px solid ${"#EDEDED"}`,
|
border: `1px solid ${"#EDEDED"}`,
|
||||||
padding: 5,
|
padding: 5,
|
||||||
borderRadius: 100
|
borderRadius: 100
|
||||||
|
|||||||
157
src/module/project/components/project_cencel.tsx
Normal file
157
src/module/project/components/project_cencel.tsx
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
"use client"
|
||||||
|
import { WARNA } from '@/module/_global';
|
||||||
|
import { ActionIcon, Avatar, Badge, Box, Card, Center, Divider, Flex, Grid, Group, Text, TextInput, Title } from '@mantine/core';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { HiMagnifyingGlass, HiMiniPresentationChartBar, HiOutlineListBullet, HiSquares2X2 } from 'react-icons/hi2';
|
||||||
|
import { MdAccountCircle } from 'react-icons/md';
|
||||||
|
import { RiCircleFill } from 'react-icons/ri';
|
||||||
|
|
||||||
|
const dataProject = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: 'Project 1',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT BATAL',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
title: 'Project 2',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT BATAL',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
title: 'Project 3',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT BATAL',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
title: 'Project 4',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT BATAL',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
title: 'Project 5',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT BATAL',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
title: 'Project 6',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT BATAL',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
export default function ProjectCencel() {
|
||||||
|
const [isList, setIsList] = useState(false)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const handleList = () => {
|
||||||
|
setIsList(!isList)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Box mt={20}>
|
||||||
|
<Grid justify='center' align='center'>
|
||||||
|
<Grid.Col span={10}>
|
||||||
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: WARNA.biruTua,
|
||||||
|
borderRadius: '#A3A3A3',
|
||||||
|
borderColor: '#A3A3A3',
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
size="md"
|
||||||
|
radius={30}
|
||||||
|
leftSection={<HiMagnifyingGlass size={20} />}
|
||||||
|
placeholder="Pencarian"
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={'auto'}>
|
||||||
|
<Flex justify={'center'}>
|
||||||
|
{isList ? (
|
||||||
|
<HiOutlineListBullet size={35} color={WARNA.biruTua} onClick={handleList} />
|
||||||
|
) : (
|
||||||
|
<HiSquares2X2 size={35} color={WARNA.biruTua} onClick={handleList} />
|
||||||
|
)}
|
||||||
|
</Flex>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Box pt={20}>
|
||||||
|
<Box bg={"#DCEED8"} p={10} style={{ borderRadius: 10 }}>
|
||||||
|
<Text fw={'bold'} c={WARNA.biruTua}>Total Proyek</Text>
|
||||||
|
<Flex justify={'center'} align={'center'} h={'100%'}>
|
||||||
|
<Text fz={40} fw={'bold'} c={WARNA.biruTua}>35</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
{isList ? (
|
||||||
|
<Box pt={20}>
|
||||||
|
{dataProject.map((v, i) => {
|
||||||
|
return (
|
||||||
|
<Box key={i}>
|
||||||
|
<Group justify="space-between" mb={10} onClick={() => router.push(`/project/${v.id}`)}>
|
||||||
|
<Group>
|
||||||
|
<Center>
|
||||||
|
<ActionIcon
|
||||||
|
variant="gradient"
|
||||||
|
size={50}
|
||||||
|
aria-label="Gradient action icon"
|
||||||
|
radius={100}
|
||||||
|
gradient={{
|
||||||
|
from: '#DFDA7C',
|
||||||
|
to: '#F2AF46',
|
||||||
|
deg: 174
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<HiMiniPresentationChartBar size={25} color={WARNA.biruTua} />
|
||||||
|
</ActionIcon>
|
||||||
|
</Center>
|
||||||
|
<Text>{v.title}</Text>
|
||||||
|
</Group>
|
||||||
|
<Box>
|
||||||
|
<RiCircleFill size={12} color={'#B80C29'} />
|
||||||
|
</Box>
|
||||||
|
</Group>
|
||||||
|
<Divider my="sm" />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
) : (
|
||||||
|
<Box pt={20}>
|
||||||
|
{dataProject.map((v, i) => {
|
||||||
|
return (
|
||||||
|
<Box key={i} mb={20}>
|
||||||
|
<Card shadow="sm" padding="md" component="a" radius={10} onClick={() => router.push(`/project/${v.id}`)}>
|
||||||
|
<Card.Section>
|
||||||
|
<Box h={120} bg={WARNA.biruTua}>
|
||||||
|
<Flex justify={'center'} align={'center'} h={"100%"}>
|
||||||
|
<Title order={3} c={"white"}>{v.title}</Title>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
</Card.Section>
|
||||||
|
<Box pt={10}>
|
||||||
|
<Text>{v.description}</Text>
|
||||||
|
<Group align='center' pt={10} justify='space-between'>
|
||||||
|
<Badge color={'#B80C29'}>{v.status}</Badge>
|
||||||
|
<Avatar.Group>
|
||||||
|
<Avatar>
|
||||||
|
<MdAccountCircle size={32} color={WARNA.biruTua} />
|
||||||
|
</Avatar>
|
||||||
|
<Avatar>+5</Avatar>
|
||||||
|
</Avatar.Group>
|
||||||
|
</Group>
|
||||||
|
</Box>
|
||||||
|
</Card>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Box >
|
||||||
|
);
|
||||||
|
}
|
||||||
157
src/module/project/components/project_done.tsx
Normal file
157
src/module/project/components/project_done.tsx
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
"use client"
|
||||||
|
import { WARNA } from '@/module/_global';
|
||||||
|
import { ActionIcon, Avatar, Badge, Box, Card, Center, Divider, Flex, Grid, Group, Text, TextInput, Title } from '@mantine/core';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { HiMagnifyingGlass, HiMiniPresentationChartBar, HiOutlineListBullet, HiSquares2X2 } from 'react-icons/hi2';
|
||||||
|
import { MdAccountCircle } from 'react-icons/md';
|
||||||
|
import { RiCircleFill } from 'react-icons/ri';
|
||||||
|
|
||||||
|
const dataProject = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: 'Project 1',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT SELESAI',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
title: 'Project 2',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT SELESAI',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
title: 'Project 3',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT SELESAI',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
title: 'Project 4',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT SELESAI',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
title: 'Project 5',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT SELESAI',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
title: 'Project 6',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT SELESAI',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
export default function ProjectDone() {
|
||||||
|
const [isList, setIsList] = useState(false)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const handleList = () => {
|
||||||
|
setIsList(!isList)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Box mt={20}>
|
||||||
|
<Grid justify='center' align='center'>
|
||||||
|
<Grid.Col span={10}>
|
||||||
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: WARNA.biruTua,
|
||||||
|
borderRadius: '#A3A3A3',
|
||||||
|
borderColor: '#A3A3A3',
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
size="md"
|
||||||
|
radius={30}
|
||||||
|
leftSection={<HiMagnifyingGlass size={20} />}
|
||||||
|
placeholder="Pencarian"
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={'auto'}>
|
||||||
|
<Flex justify={'center'}>
|
||||||
|
{isList ? (
|
||||||
|
<HiOutlineListBullet size={35} color={WARNA.biruTua} onClick={handleList} />
|
||||||
|
) : (
|
||||||
|
<HiSquares2X2 size={35} color={WARNA.biruTua} onClick={handleList} />
|
||||||
|
)}
|
||||||
|
</Flex>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Box pt={20}>
|
||||||
|
<Box bg={"#DCEED8"} p={10} style={{ borderRadius: 10 }}>
|
||||||
|
<Text fw={'bold'} c={WARNA.biruTua}>Total Proyek</Text>
|
||||||
|
<Flex justify={'center'} align={'center'} h={'100%'}>
|
||||||
|
<Text fz={40} fw={'bold'} c={WARNA.biruTua}>35</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
{isList ? (
|
||||||
|
<Box pt={20}>
|
||||||
|
{dataProject.map((v, i) => {
|
||||||
|
return (
|
||||||
|
<Box key={i}>
|
||||||
|
<Group justify="space-between" mb={10} onClick={() => router.push(`/project/${v.id}`)}>
|
||||||
|
<Group>
|
||||||
|
<Center>
|
||||||
|
<ActionIcon
|
||||||
|
variant="gradient"
|
||||||
|
size={50}
|
||||||
|
aria-label="Gradient action icon"
|
||||||
|
radius={100}
|
||||||
|
gradient={{
|
||||||
|
from: '#DFDA7C',
|
||||||
|
to: '#F2AF46',
|
||||||
|
deg: 174
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<HiMiniPresentationChartBar size={25} color={WARNA.biruTua} />
|
||||||
|
</ActionIcon>
|
||||||
|
</Center>
|
||||||
|
<Text>{v.title}</Text>
|
||||||
|
</Group>
|
||||||
|
<Box>
|
||||||
|
<RiCircleFill size={12} color={'#387529'} />
|
||||||
|
</Box>
|
||||||
|
</Group>
|
||||||
|
<Divider my="sm" />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
) : (
|
||||||
|
<Box pt={20}>
|
||||||
|
{dataProject.map((v, i) => {
|
||||||
|
return (
|
||||||
|
<Box key={i} mb={20}>
|
||||||
|
<Card shadow="sm" padding="md" component="a" radius={10} onClick={() => router.push(`/project/${v.id}`)}>
|
||||||
|
<Card.Section>
|
||||||
|
<Box h={120} bg={WARNA.biruTua}>
|
||||||
|
<Flex justify={'center'} align={'center'} h={"100%"}>
|
||||||
|
<Title order={3} c={"white"}>{v.title}</Title>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
</Card.Section>
|
||||||
|
<Box pt={10}>
|
||||||
|
<Text>{v.description}</Text>
|
||||||
|
<Group align='center' pt={10} justify='space-between'>
|
||||||
|
<Badge color={'#387529'}>{v.status}</Badge>
|
||||||
|
<Avatar.Group>
|
||||||
|
<Avatar>
|
||||||
|
<MdAccountCircle size={32} color={WARNA.biruTua} />
|
||||||
|
</Avatar>
|
||||||
|
<Avatar>+5</Avatar>
|
||||||
|
</Avatar.Group>
|
||||||
|
</Group>
|
||||||
|
</Box>
|
||||||
|
</Card>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Box >
|
||||||
|
);
|
||||||
|
}
|
||||||
158
src/module/project/components/project_process.tsx
Normal file
158
src/module/project/components/project_process.tsx
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
"use client"
|
||||||
|
import { WARNA } from '@/module/_global';
|
||||||
|
import { ActionIcon, Avatar, Badge, Box, Card, Center, Divider, Flex, Grid, Group, Text, TextInput, Title } from '@mantine/core';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { HiMagnifyingGlass, HiMiniPresentationChartBar, HiOutlineListBullet, HiSquares2X2 } from 'react-icons/hi2';
|
||||||
|
import { MdAccountCircle } from 'react-icons/md';
|
||||||
|
import { RiCircleFill } from 'react-icons/ri';
|
||||||
|
|
||||||
|
const dataProject = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: 'Project 1',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT PROSES',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
title: 'Project 2',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT PROSES',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
title: 'Project 3',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT PROSES',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
title: 'Project 4',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT PROSES',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
title: 'Project 5',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT PROSES',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
title: 'Project 6',
|
||||||
|
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
||||||
|
status: 'PROJECT PROSES',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
export default function ProjectProcess() {
|
||||||
|
const [isList, setIsList] = useState(false)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
const handleList = () => {
|
||||||
|
setIsList(!isList)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Box mt={20}>
|
||||||
|
<Grid justify='center' align='center'>
|
||||||
|
<Grid.Col span={10}>
|
||||||
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: WARNA.biruTua,
|
||||||
|
borderRadius: '#A3A3A3',
|
||||||
|
borderColor: '#A3A3A3',
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
size="md"
|
||||||
|
radius={30}
|
||||||
|
leftSection={<HiMagnifyingGlass size={20} />}
|
||||||
|
placeholder="Pencarian"
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={'auto'}>
|
||||||
|
<Flex justify={'center'}>
|
||||||
|
{isList ? (
|
||||||
|
<HiOutlineListBullet size={35} color={WARNA.biruTua} onClick={handleList} />
|
||||||
|
) : (
|
||||||
|
<HiSquares2X2 size={35} color={WARNA.biruTua} onClick={handleList} />
|
||||||
|
)}
|
||||||
|
</Flex>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Box pt={20}>
|
||||||
|
<Box bg={"#DCEED8"} p={10} style={{ borderRadius: 10 }}>
|
||||||
|
<Text fw={'bold'} c={WARNA.biruTua}>Total Proyek</Text>
|
||||||
|
<Flex justify={'center'} align={'center'} h={'100%'}>
|
||||||
|
<Text fz={40} fw={'bold'} c={WARNA.biruTua}>35</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
{isList ? (
|
||||||
|
<Box pt={20}>
|
||||||
|
{dataProject.map((v, i) => {
|
||||||
|
return (
|
||||||
|
<Box key={i}>
|
||||||
|
<Group justify="space-between" mb={10} onClick={() => router.push(`/project/${v.id}`)}>
|
||||||
|
<Group>
|
||||||
|
<Center>
|
||||||
|
<ActionIcon
|
||||||
|
variant="gradient"
|
||||||
|
size={50}
|
||||||
|
aria-label="Gradient action icon"
|
||||||
|
radius={100}
|
||||||
|
gradient={{
|
||||||
|
from: '#DFDA7C',
|
||||||
|
to: '#F2AF46',
|
||||||
|
deg: 174
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<HiMiniPresentationChartBar size={25} color={WARNA.biruTua} />
|
||||||
|
</ActionIcon>
|
||||||
|
</Center>
|
||||||
|
<Text>{v.title}</Text>
|
||||||
|
</Group>
|
||||||
|
<Box>
|
||||||
|
<RiCircleFill size={12} color={'#C5771A'} />
|
||||||
|
</Box>
|
||||||
|
</Group>
|
||||||
|
<Divider my="sm" />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
) : (
|
||||||
|
<Box pt={20}>
|
||||||
|
{dataProject.map((v, i) => {
|
||||||
|
return (
|
||||||
|
<Box key={i} mb={20}>
|
||||||
|
<Card shadow="sm" padding="md" component="a" radius={10} onClick={() => router.push(`/project/${v.id}`)}>
|
||||||
|
<Card.Section>
|
||||||
|
<Box h={120} bg={WARNA.biruTua}>
|
||||||
|
<Flex justify={'center'} align={'center'} h={"100%"}>
|
||||||
|
<Title order={3} c={"white"}>{v.title}</Title>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
</Card.Section>
|
||||||
|
<Box pt={10}>
|
||||||
|
<Text>{v.description}</Text>
|
||||||
|
<Group align='center' pt={10} justify='space-between'>
|
||||||
|
<Badge color={'#C5771A'}>{v.status}</Badge>
|
||||||
|
<Avatar.Group>
|
||||||
|
<Avatar>
|
||||||
|
<MdAccountCircle size={32} color={WARNA.biruTua} />
|
||||||
|
</Avatar>
|
||||||
|
<Avatar>+5</Avatar>
|
||||||
|
</Avatar.Group>
|
||||||
|
</Group>
|
||||||
|
</Box>
|
||||||
|
</Card>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Box >
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ export default function DrawerProject() {
|
|||||||
<Box>
|
<Box>
|
||||||
<Stack pt={10}>
|
<Stack pt={10}>
|
||||||
<SimpleGrid
|
<SimpleGrid
|
||||||
cols={{ base: 3, sm: 3, lg: 3 }}
|
cols={{ base: 2, sm: 2, lg: 3 }}
|
||||||
>
|
>
|
||||||
<Flex onClick={() => window.location.href = "/project/create"} justify={'center'} align={'center'} direction={'column'} >
|
<Flex onClick={() => window.location.href = "/project/create"} justify={'center'} align={'center'} direction={'column'} >
|
||||||
<Box>
|
<Box>
|
||||||
|
|||||||
@@ -1,191 +1,98 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { LayoutDrawer, LayoutNavbarNew, WARNA } from '@/module/_global';
|
import { LayoutDrawer, LayoutNavbarNew, WARNA } from '@/module/_global';
|
||||||
import { ActionIcon, Avatar, Badge, Box, Card, Center, Divider, Flex, Grid, Group, Text, TextInput, Title } from '@mantine/core';
|
import { ActionIcon, Avatar, Badge, Box, Card, Center, Divider, Flex, Grid, Group, rem, Tabs, Text, TextInput, Title } from '@mantine/core';
|
||||||
import React, { useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { HiMenu } from 'react-icons/hi';
|
import { HiMenu } from 'react-icons/hi';
|
||||||
import { HiMagnifyingGlass, HiMiniPresentationChartBar, HiOutlineListBullet, HiSquares2X2 } from 'react-icons/hi2';
|
import { HiMagnifyingGlass, HiMiniPresentationChartBar, HiOutlineListBullet, HiSquares2X2 } from 'react-icons/hi2';
|
||||||
import { MdAccountCircle } from 'react-icons/md';
|
import { MdAccountCircle } from 'react-icons/md';
|
||||||
import { RiCircleFill } from "react-icons/ri";
|
import { RiCircleFill } from "react-icons/ri";
|
||||||
import DrawerProject from './drawer_project';
|
import DrawerProject from './drawer_project';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
import { TbClockPause } from 'react-icons/tb';
|
||||||
const dataProject = [
|
import { IoIosCheckmarkCircleOutline } from 'react-icons/io';
|
||||||
{
|
import { IoCloseCircleOutline } from 'react-icons/io5';
|
||||||
id: 1,
|
import ProjectProcess from '../project_process';
|
||||||
title: 'Project 1',
|
import ProjectDone from '../project_done';
|
||||||
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
import ProjectCencel from '../project_cencel';
|
||||||
status: 'PROJECT SELESAI',
|
|
||||||
color: '#387529'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
title: 'Project 2',
|
|
||||||
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
|
||||||
status: 'PROJECT SELESAI',
|
|
||||||
color: '#387529'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
title: 'Project 3',
|
|
||||||
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
|
||||||
status: 'PROJECT SELESAI',
|
|
||||||
color: '#387529'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
title: 'Project 4',
|
|
||||||
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
|
||||||
status: 'PROSES',
|
|
||||||
color: '#C5771A'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
title: 'Project5',
|
|
||||||
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
|
||||||
status: 'PROSES',
|
|
||||||
color: '#C5771A'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
title: 'Project 6',
|
|
||||||
description: 'Tempat berkumpul semua anggota / staff perbekal darmasaba',
|
|
||||||
status: 'PROSES',
|
|
||||||
color: '#C5771A'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
export default function NavbarProject() {
|
export default function NavbarProject() {
|
||||||
const [isList, setIsList] = useState(false)
|
|
||||||
const [openDrawer, setOpenDrawer] = useState(false)
|
const [openDrawer, setOpenDrawer] = useState(false)
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const handleList = () => {
|
const iconStyle = { width: rem(20), height: rem(20) };
|
||||||
setIsList(!isList)
|
|
||||||
}
|
const tabsData = [
|
||||||
|
{
|
||||||
|
value: 'segera',
|
||||||
|
label: 'Proyek Proses',
|
||||||
|
mobileLabel: 'Proses',
|
||||||
|
icon: <TbClockPause style={iconStyle} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'selesai',
|
||||||
|
label: 'Proyek Selesai',
|
||||||
|
mobileLabel: 'Selesai',
|
||||||
|
icon: <IoIosCheckmarkCircleOutline style={iconStyle} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'batal',
|
||||||
|
label: 'Proyek Batal',
|
||||||
|
mobileLabel: ' Batal',
|
||||||
|
icon: <IoCloseCircleOutline style={iconStyle} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const [isMobile, setIsMobile] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleResize = () => {
|
||||||
|
if (window.innerWidth < 495) {
|
||||||
|
setIsMobile(true);
|
||||||
|
} else {
|
||||||
|
setIsMobile(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener('resize', handleResize);
|
||||||
|
handleResize();
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('resize', handleResize);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<LayoutNavbarNew back='/home' title='proyek'
|
<LayoutNavbarNew back='/home' title='proyek'
|
||||||
menu={<ActionIcon variant="light" onClick={() => setOpenDrawer(true)} bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
menu={<ActionIcon variant="light" onClick={() => setOpenDrawer(true)} bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||||
<HiMenu size={20} color='white' />
|
<HiMenu size={20} color='white' />
|
||||||
</ActionIcon>} />
|
</ActionIcon>} />
|
||||||
|
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Grid justify='center' align='center'>
|
<Tabs variant="pills" radius="xl" defaultValue="segera">
|
||||||
<Grid.Col span={10}>
|
<Tabs.List grow justify='center'>
|
||||||
<TextInput
|
{tabsData.map((tab) => (
|
||||||
styles={{
|
<Tabs.Tab
|
||||||
input: {
|
key={tab.value}
|
||||||
color: WARNA.biruTua,
|
value={tab.value}
|
||||||
borderRadius: '#A3A3A3',
|
color={WARNA.biruTua}
|
||||||
borderColor: '#A3A3A3',
|
leftSection={tab.icon}
|
||||||
},
|
>
|
||||||
}}
|
{isMobile ? tab.mobileLabel : tab.label}
|
||||||
size="md"
|
</Tabs.Tab>
|
||||||
radius={30}
|
))}
|
||||||
leftSection={<HiMagnifyingGlass size={20} />}
|
</Tabs.List>
|
||||||
placeholder="Pencarian"
|
|
||||||
/>
|
<Tabs.Panel value="segera">
|
||||||
</Grid.Col>
|
<ProjectProcess />
|
||||||
<Grid.Col span={'auto'}>
|
</Tabs.Panel>
|
||||||
<Flex justify={'center'}>
|
|
||||||
{isList ? (
|
<Tabs.Panel value="selesai">
|
||||||
<HiOutlineListBullet size={35} color={WARNA.biruTua} onClick={handleList} />
|
<ProjectDone />
|
||||||
) : (
|
</Tabs.Panel>
|
||||||
<HiSquares2X2 size={35} color={WARNA.biruTua} onClick={handleList} />
|
|
||||||
)}
|
<Tabs.Panel value="batal">
|
||||||
</Flex>
|
<ProjectCencel />
|
||||||
</Grid.Col>
|
</Tabs.Panel>
|
||||||
</Grid>
|
</Tabs>
|
||||||
<Box pt={20}>
|
</Box>
|
||||||
<Box bg={"#DCEED8"} p={10} style={{ borderRadius: 10 }}>
|
|
||||||
<Text fw={'bold'} c={WARNA.biruTua}>Total Proyek</Text>
|
|
||||||
<Flex justify={'center'} align={'center'} h={'100%'}>
|
|
||||||
<Text fz={40} fw={'bold'} c={WARNA.biruTua}>35</Text>
|
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
<Grid pt={15}>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<Box bg={"#DCEED8"} p={10} style={{ borderRadius: 10 }}>
|
|
||||||
<Text ta={'center'} fw={'bold'} c={'#387529'}>Proyek Selesai</Text>
|
|
||||||
<Flex justify={'center'} align={'center'} h={'100%'}>
|
|
||||||
<Text fz={40} fw={'bold'} c={'#387529'}>35</Text>
|
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<Box bg={"#DCEED8"} p={10} style={{ borderRadius: 10 }}>
|
|
||||||
<Text ta={'center'} fw={'bold'} c={'#C5771A'}>Proyek Proses</Text>
|
|
||||||
<Flex justify={'center'} align={'center'} h={'100%'}>
|
|
||||||
<Text fz={40} fw={'bold'} c={'#C5771A'}>35</Text>
|
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
{isList ? (
|
|
||||||
<Box pt={20}>
|
|
||||||
{dataProject.map((v, i) => {
|
|
||||||
return (
|
|
||||||
<Box key={i}>
|
|
||||||
<Group justify="space-between" mb={10} onClick={() => router.push(`/project/${v.id}`)}>
|
|
||||||
<Group>
|
|
||||||
<Center>
|
|
||||||
<ActionIcon
|
|
||||||
variant="gradient"
|
|
||||||
size={50}
|
|
||||||
aria-label="Gradient action icon"
|
|
||||||
radius={100}
|
|
||||||
gradient={{
|
|
||||||
from: '#DFDA7C',
|
|
||||||
to: '#F2AF46',
|
|
||||||
deg: 174
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<HiMiniPresentationChartBar size={25} color={WARNA.biruTua} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Center>
|
|
||||||
<Text>{v.title}</Text>
|
|
||||||
</Group>
|
|
||||||
<Box>
|
|
||||||
<RiCircleFill size={12} color={v.color} />
|
|
||||||
</Box>
|
|
||||||
</Group>
|
|
||||||
<Divider my="sm" />
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Box>
|
|
||||||
) : (
|
|
||||||
<Box pt={20}>
|
|
||||||
{dataProject.map((v, i) => {
|
|
||||||
return (
|
|
||||||
<Box key={i} mb={20}>
|
|
||||||
<Card shadow="sm" padding="md" component="a" radius={10} onClick={() => router.push(`/project/${v.id}`)}>
|
|
||||||
<Card.Section>
|
|
||||||
<Box h={120} bg={WARNA.biruTua}>
|
|
||||||
<Flex justify={'center'} align={'center'} h={"100%"}>
|
|
||||||
<Title order={3} c={"white"}>{v.title}</Title>
|
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
</Card.Section>
|
|
||||||
<Box pt={10}>
|
|
||||||
<Text>{v.description}</Text>
|
|
||||||
<Group align='center' pt={10} justify='space-between'>
|
|
||||||
<Badge color={v.color}>{v.status}</Badge>
|
|
||||||
<Avatar.Group>
|
|
||||||
<Avatar>
|
|
||||||
<MdAccountCircle size={32} color={WARNA.biruTua} />
|
|
||||||
</Avatar>
|
|
||||||
<Avatar>+5</Avatar>
|
|
||||||
</Avatar.Group>
|
|
||||||
</Group>
|
|
||||||
</Box>
|
|
||||||
</Card>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
</Box >
|
|
||||||
<LayoutDrawer opened={openDrawer} title={'Menu'} onClose={() => setOpenDrawer(false)}>
|
<LayoutDrawer opened={openDrawer} title={'Menu'} onClose={() => setOpenDrawer(false)}>
|
||||||
<DrawerProject />
|
<DrawerProject />
|
||||||
</LayoutDrawer>
|
</LayoutDrawer>
|
||||||
|
|||||||
0
src/types/.gitkeep
Normal file
0
src/types/.gitkeep
Normal file
5
src/types/auth/login.ts
Normal file
5
src/types/auth/login.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export interface Login {
|
||||||
|
id: string
|
||||||
|
email: string
|
||||||
|
phone: string
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user