Merge pull request #182 from bipproduction/lukman/3-september-2024
style : update ui
This commit is contained in:
@@ -75,7 +75,7 @@ export default function CreateAnnouncement() {
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<LayoutNavbarNew back="" title="Tambah Pengumuman" menu={<></>} />
|
||||
<LayoutNavbarNew back="/announcement/" title="Tambah Pengumuman" menu={<></>} />
|
||||
<Stack
|
||||
p={20}
|
||||
>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
import { LayoutNavbarNew, WARNA } from '@/module/_global';
|
||||
import { funGetGroupDivision } from '@/module/group/lib/api_group';
|
||||
import { Box, Button, Divider, Flex, Group, Stack, Text } from '@mantine/core';
|
||||
import { Box, Button, Divider, Flex, Group, rem, Skeleton, Stack, Text } from '@mantine/core';
|
||||
import { useShallowEffect } from '@mantine/hooks';
|
||||
import React, { useState } from 'react';
|
||||
import { FaCheck } from 'react-icons/fa';
|
||||
@@ -22,6 +22,7 @@ export default function CreateUsersAnnouncement({ onClose }: { onClose: (val: an
|
||||
const [selectAll, setSelectAll] = useState(false);
|
||||
const [isData, setIsData] = useState<GroupData[]>([])
|
||||
const memberGroup = useHookstate(globalMemberAnnouncement)
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
const handleCheck = (groupId: string, divisionId: string) => {
|
||||
const newChecked = { ...checked };
|
||||
@@ -70,6 +71,7 @@ export default function CreateUsersAnnouncement({ onClose }: { onClose: (val: an
|
||||
};
|
||||
|
||||
async function getData() {
|
||||
setLoading(true)
|
||||
const response = await funGetGroupDivision()
|
||||
setIsData(response.data)
|
||||
|
||||
@@ -81,6 +83,8 @@ export default function CreateUsersAnnouncement({ onClose }: { onClose: (val: an
|
||||
|
||||
setChecked(formatArray)
|
||||
}
|
||||
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
const handleSubmit = () => {
|
||||
@@ -121,75 +125,89 @@ export default function CreateUsersAnnouncement({ onClose }: { onClose: (val: an
|
||||
Pilih Semua
|
||||
</Text>
|
||||
</Group>
|
||||
{isData.map((item) => (
|
||||
<Stack mb={30} key={item.id}>
|
||||
<Group onClick={() => handleGroupCheck(item.id)} justify='space-between' align='center'>
|
||||
<Text
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
fw={checked[item.id] && checked[item.id].length === item.Division.length ? 'bold' : 'normal'}
|
||||
>
|
||||
{item.name}
|
||||
</Text>
|
||||
<Text
|
||||
>
|
||||
{checked[item.id] && checked[item.id].length === item.Division.length ? <FaCheck style={{ marginRight: 10 }} />
|
||||
: (checked[item.id] && checked[item.id].length > 0 && checked[item.id].length < item.Division.length) ? <FaMinus style={{ marginRight: 10 }} /> : ""}
|
||||
</Text>
|
||||
</Group>
|
||||
<Divider />
|
||||
{item.Division.map((division) => (
|
||||
<Box key={division.id}>
|
||||
<Group onClick={() => handleCheck(item.id, division.id)} justify='space-between' align='center'>
|
||||
<Text
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
paddingLeft: 20,
|
||||
}}
|
||||
>
|
||||
{division.name}
|
||||
</Text>
|
||||
<Text
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
paddingLeft: 20,
|
||||
}}
|
||||
>
|
||||
{checked[item.id] && checked[item.id].includes(division.id) ? <FaCheck style={{ marginRight: 10 }} /> : ""}
|
||||
</Text>
|
||||
</Group>
|
||||
<Box pt={15}>
|
||||
<Divider />
|
||||
{loading ?
|
||||
Array(6)
|
||||
.fill(null)
|
||||
.map((_, i) => (
|
||||
<Box key={i}>
|
||||
<Skeleton mt={20} h={20}/>
|
||||
<Skeleton mt={20} h={20} ml={20}/>
|
||||
<Skeleton mt={20} h={20} ml={20}/>
|
||||
<Skeleton mt={20} h={20} ml={20}/>
|
||||
</Box>
|
||||
))
|
||||
:
|
||||
isData.map((item) => (
|
||||
<Stack mb={30} key={item.id}>
|
||||
<Group onClick={() => handleGroupCheck(item.id)} justify='space-between' align='center'>
|
||||
<Text
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
fw={checked[item.id] && checked[item.id].length === item.Division.length ? 'bold' : 'normal'}
|
||||
lineClamp={1}
|
||||
>
|
||||
{item.name}
|
||||
</Text>
|
||||
<Text
|
||||
>
|
||||
{checked[item.id] && checked[item.id].length === item.Division.length ? <FaCheck style={{ marginRight: 10 }} />
|
||||
: (checked[item.id] && checked[item.id].length > 0 && checked[item.id].length < item.Division.length) ? <FaMinus style={{ marginRight: 10 }} /> : ""}
|
||||
</Text>
|
||||
</Group>
|
||||
<Divider />
|
||||
{item.Division.map((division) => (
|
||||
<Box key={division.id}>
|
||||
<Group onClick={() => handleCheck(item.id, division.id)} justify='space-between' align='center'>
|
||||
<Box w={{
|
||||
base: 280,
|
||||
xl: 430
|
||||
}}>
|
||||
<Text truncate="end" pl={20}>
|
||||
{division.name}
|
||||
</Text>
|
||||
</Box>
|
||||
<Text
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
paddingLeft: 20,
|
||||
}}
|
||||
>
|
||||
{checked[item.id] && checked[item.id].includes(division.id) ? <FaCheck style={{ marginRight: 10 }} /> : ""}
|
||||
</Text>
|
||||
</Group>
|
||||
<Box pt={15}>
|
||||
<Divider />
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
))}
|
||||
</Stack>
|
||||
))}
|
||||
|
||||
<Box mt="xl">
|
||||
<Button
|
||||
color="white"
|
||||
bg={WARNA.biruTua}
|
||||
|
||||
size="lg"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => {
|
||||
handleSubmit()
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Box>
|
||||
))}
|
||||
</Stack>
|
||||
))
|
||||
}
|
||||
</Box>
|
||||
<Box pos={'fixed'} bottom={0} p={rem(20)} w={"100%"} style={{
|
||||
maxWidth: rem(550),
|
||||
zIndex: 999,
|
||||
backgroundColor: `${WARNA.bgWhite}`,
|
||||
}}>
|
||||
<Button
|
||||
color="white"
|
||||
bg={WARNA.biruTua}
|
||||
|
||||
size="lg"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => {
|
||||
handleSubmit()
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Box>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use client"
|
||||
import { ActionIcon, Box, Flex, Grid, Group, List, Skeleton, Spoiler, Stack, Text } from "@mantine/core";
|
||||
import { ActionIcon, Box, Center, Flex, Grid, Group, List, Skeleton, Spoiler, Stack, Text } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
import { BsCardText } from "react-icons/bs";
|
||||
@@ -78,15 +78,25 @@ export default function DetailAnnouncement({ id }: { id: string }) {
|
||||
</Stack>
|
||||
:
|
||||
<Stack>
|
||||
<Group>
|
||||
<TfiAnnouncement size={25} />
|
||||
<Text fw={'bold'}>{isData?.title}</Text>
|
||||
</Group>
|
||||
<Grid gutter={'md'}>
|
||||
<Grid.Col span={1}>
|
||||
<BsCardText size={25} />
|
||||
<Grid.Col span={2}>
|
||||
<Center>
|
||||
<TfiAnnouncement size={30} />
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={11}>
|
||||
<Grid.Col span={10}>
|
||||
<Spoiler maxHeight={100} showLabel="Lebih banyak" hideLabel="Lebih sedikit">
|
||||
<Text fw={'bold'}>{isData?.title}</Text>
|
||||
</Spoiler>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid gutter={'md'}>
|
||||
<Grid.Col span={2}>
|
||||
<Center>
|
||||
<BsCardText size={30} />
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Spoiler maxHeight={100} showLabel="Lebih banyak" hideLabel="Lebih sedikit">
|
||||
<Text>{isData?.desc}</Text>
|
||||
</Spoiler>
|
||||
@@ -108,10 +118,12 @@ export default function DetailAnnouncement({ id }: { id: string }) {
|
||||
return (
|
||||
<Box key={i} mb={10}>
|
||||
<Text>{isMember[v]?.[0].group}</Text>
|
||||
<List>
|
||||
<List ml={10}>
|
||||
{
|
||||
isMember[v].map((item: any, x: any) => {
|
||||
return <List.Item key={x}>{item.division}</List.Item>
|
||||
return <List.Item key={x}>
|
||||
<Text lineClamp={1}>{item.division}</Text>
|
||||
</List.Item>
|
||||
})
|
||||
}
|
||||
</List>
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
'use client'
|
||||
import { LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||
import { Box, Button, Flex, List, rem, Skeleton, Stack, Text, Textarea, TextInput } from "@mantine/core";
|
||||
import { Box, Button, Flex, Group, List, rem, Skeleton, Stack, Text, Textarea, TextInput } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { HiOutlineChevronRight } from "react-icons/hi2";
|
||||
import { funEditAnnouncement, funGetAnnouncementById } from "../lib/api_announcement";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useParams, useRouter } from "next/navigation";
|
||||
import { useHookstate } from "@hookstate/core";
|
||||
import { globalMemberEditAnnouncement } from "../lib/val_announcement";
|
||||
import { GroupData, GroupDataEditAnnouncement } from "../lib/type_announcement";
|
||||
import EditChooseMember from "./edit_choose_member";
|
||||
import { IoIosArrowForward } from "react-icons/io";
|
||||
|
||||
export default function EditAnnouncement() {
|
||||
const [isOpen, setOpen] = useState(false)
|
||||
const [isChooseDivisi, setChooseDivisi] = useState(false)
|
||||
const param = useParams<{ id: string }>()
|
||||
const [loading, setLoading] = useState(true)
|
||||
const router = useRouter()
|
||||
const [touched, setTouched] = useState({
|
||||
title: false,
|
||||
desc: false
|
||||
@@ -89,6 +91,7 @@ export default function EditAnnouncement() {
|
||||
|
||||
if (response.success) {
|
||||
toast.success(response.message)
|
||||
router.push(`/announcement/${param.id}`)
|
||||
} else {
|
||||
toast.error(response.message)
|
||||
}
|
||||
@@ -121,7 +124,7 @@ export default function EditAnnouncement() {
|
||||
<>
|
||||
<Skeleton height={40} mt={20} radius={30} />
|
||||
<Skeleton height={75} mt={20} radius={10} />
|
||||
<Skeleton height={40} mt={10} radius={30} />
|
||||
<Skeleton height={40} mt={10} radius={10} />
|
||||
</>
|
||||
:
|
||||
<>
|
||||
@@ -173,9 +176,22 @@ export default function EditAnnouncement() {
|
||||
}
|
||||
|
||||
/>
|
||||
<Button onClick={() => { setChooseDivisi(true) }} rightSection={<HiOutlineChevronRight size={14} />} variant="default" fullWidth radius={30} size="md" mt={10}>
|
||||
Pilih Divisi
|
||||
</Button>
|
||||
<Box pt={10} w={"100%"}>
|
||||
<Group justify="space-between" style={{
|
||||
border: `1px solid ${WARNA.biruTua}`,
|
||||
maxWidth: rem(550),
|
||||
padding: 10,
|
||||
borderRadius: 10
|
||||
}}
|
||||
|
||||
onClick={() => { setChooseDivisi(true) }}
|
||||
>
|
||||
<Text size="sm">
|
||||
Tambah divisi penerima pengumuman
|
||||
</Text>
|
||||
<IoIosArrowForward />
|
||||
</Group>
|
||||
</Box>
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -197,11 +213,17 @@ export default function EditAnnouncement() {
|
||||
return (
|
||||
<Box key={i} mt={10}>
|
||||
<Text fw={"bold"}>{v.name}</Text>
|
||||
<Box pl={20}>
|
||||
<Box pl={20} pr={10}>
|
||||
<Flex direction={"column"} gap={"md"}>
|
||||
{v.Division.map((division: any) => (
|
||||
<li key={division.id}>{division.name}</li>
|
||||
))}
|
||||
<List>
|
||||
{
|
||||
v.Division.map((division: any) => {
|
||||
return <List.Item key={division.id}>
|
||||
<Text lineClamp={1}>{division.name}</Text>
|
||||
</List.Item>
|
||||
})
|
||||
}
|
||||
</List>
|
||||
</Flex>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -145,6 +145,7 @@ export default function EditChooseMember({ onClose }: { onClose: (val: any) => v
|
||||
alignItems: 'center',
|
||||
}}
|
||||
fw={checked[item.id] && checked[item.id].length === item.Division.length ? 'bold' : 'normal'}
|
||||
lineClamp={1}
|
||||
>
|
||||
{item.name}
|
||||
</Text>
|
||||
@@ -158,16 +159,14 @@ export default function EditChooseMember({ onClose }: { onClose: (val: any) => v
|
||||
{item.Division.map((division) => (
|
||||
<Box key={division.id}>
|
||||
<Group onClick={() => handleCheck(item.id, division.id)} justify='space-between' align='center'>
|
||||
<Text
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
paddingLeft: 20,
|
||||
}}
|
||||
>
|
||||
{division.name}
|
||||
</Text>
|
||||
<Box w={{
|
||||
base: 280,
|
||||
xl: 430
|
||||
}}>
|
||||
<Text truncate="end" pl={20}>
|
||||
{division.name}
|
||||
</Text>
|
||||
</Box>
|
||||
<Text
|
||||
style={{
|
||||
cursor: 'pointer',
|
||||
|
||||
@@ -83,12 +83,22 @@ export default function ListAnnouncement() {
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Group justify='space-between' mb={5} onClick={() => {
|
||||
<Grid onClick={() => {
|
||||
router.push(`/announcement/${v.id}`)
|
||||
}}>
|
||||
<Text fw={'bold'} c={WARNA.biruTua}>{v.title}</Text>
|
||||
<Text fw={'lighter'} c={WARNA.biruTua} fz={13}>{v.createdAt}</Text>
|
||||
</Group>
|
||||
}} mb={10}>
|
||||
<Grid.Col span={{
|
||||
base: 7,
|
||||
xl: 8
|
||||
}}>
|
||||
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{v.title}</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 5,
|
||||
xl: 4
|
||||
}}>
|
||||
<Text ta={"end"} fw={'lighter'} c={WARNA.biruTua} fz={13}>{v.createdAt}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{/* <Text c={WARNA.biruTua} lineClamp={2}>{v.desc}</Text> */}
|
||||
<Spoiler maxHeight={50} showLabel="Lebih banyak" hideLabel="Lebih sedikit">
|
||||
<Text c={WARNA.biruTua} onClick={() => {
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function NavbarDetailAnnouncement() {
|
||||
const router = useRouter()
|
||||
return (
|
||||
<Box>
|
||||
<LayoutNavbarNew back="" title="Pengumuman"
|
||||
<LayoutNavbarNew back="/announcement/" title="Pengumuman"
|
||||
menu={
|
||||
<ActionIcon onClick={() => setOpenDrawer(true)} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||
<HiMenu size={20} color='white' />
|
||||
|
||||
@@ -3,7 +3,7 @@ import { LayoutNavbarNew, SkeletonSingle, WARNA } from '@/module/_global';
|
||||
import LayoutModal from '@/module/_global/layout/layout_modal';
|
||||
import { funGetUserByCookies } from '@/module/auth';
|
||||
import { funGetAllmember, TypeUser } from '@/module/user';
|
||||
import { Avatar, Box, Button, Divider, Group, rem, Stack, Text, TextInput } from '@mantine/core';
|
||||
import { Avatar, Box, Button, Divider, Flex, Grid, Group, rem, Stack, Text, TextInput } from '@mantine/core';
|
||||
import { useParams, useRouter } from 'next/navigation';
|
||||
import React, { useState } from 'react';
|
||||
import toast from 'react-hot-toast';
|
||||
@@ -103,56 +103,63 @@ export default function CreateAnggotaDivision() {
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
{loading ?
|
||||
Array(8)
|
||||
.fill(null)
|
||||
.map((_, i) => (
|
||||
{loading ?
|
||||
Array(8)
|
||||
.fill(null)
|
||||
.map((_, i) => (
|
||||
<Box key={i}>
|
||||
<SkeletonSingle/>
|
||||
<SkeletonSingle />
|
||||
</Box>
|
||||
))
|
||||
))
|
||||
:
|
||||
<Box mt={20} mb={100}>
|
||||
{dataMember.map((v: any, index: any) => {
|
||||
const isSelected = selectedFiles.some((i: any) => i.idUser == dataMember[index].id)
|
||||
const found = memberDb.some((i: any) => i.idUser == v.id)
|
||||
return (
|
||||
<Box my={10} key={index} onClick={() => (!found) ? handleFileClick(index) : null}>
|
||||
<Group justify='space-between' align='center'>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Stack align="flex-start" justify="flex-start">
|
||||
<Text>{v.name}</Text>
|
||||
<Text c={"dimmed"}>{(found) ? "sudah menjadi anggota divisi" : ""}</Text>
|
||||
</Stack>
|
||||
</Group>
|
||||
{isSelected ? <FaCheck /> : null}
|
||||
</Group>
|
||||
<Box mt={10}>
|
||||
<Divider size={"xs"} />
|
||||
{dataMember.map((v: any, index: any) => {
|
||||
const isSelected = selectedFiles.some((i: any) => i.idUser == dataMember[index].id)
|
||||
const found = memberDb.some((i: any) => i.idUser == v.id)
|
||||
return (
|
||||
<Box my={10} key={index} onClick={() => (!found) ? handleFileClick(index) : null}>
|
||||
<Grid align='center' gutter={{
|
||||
base: 60,
|
||||
xl: "xs"
|
||||
}}>
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10}>
|
||||
<Flex justify='space-between' align={"center"}>
|
||||
<Flex direction={'column'} align="flex-start" justify="flex-start">
|
||||
<Text lineClamp={1}>{v.name}</Text>
|
||||
<Text c={"dimmed"}>{(found) ? "sudah menjadi anggota divisi" : ""}</Text>
|
||||
</Flex>
|
||||
{isSelected ? <FaCheck/> : null}
|
||||
</Flex>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Box mt={10}>
|
||||
<Divider size={"xs"} />
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
)
|
||||
})}
|
||||
</Box>
|
||||
)
|
||||
})}
|
||||
</Box>
|
||||
}
|
||||
</Box>
|
||||
<Box pos={'fixed'} bottom={0} p={rem(20)} w={"100%"} style={{
|
||||
maxWidth: rem(550),
|
||||
zIndex: 999,
|
||||
backgroundColor: `${WARNA.bgWhite}`,
|
||||
}}>
|
||||
<Button
|
||||
color="white"
|
||||
bg={WARNA.biruTua}
|
||||
size="lg"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => { setOpen(true) }}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Box>
|
||||
<Box pos={'fixed'} bottom={0} p={rem(20)} w={"100%"} style={{
|
||||
maxWidth: rem(550),
|
||||
zIndex: 999,
|
||||
backgroundColor: `${WARNA.bgWhite}`,
|
||||
}}>
|
||||
<Button
|
||||
color="white"
|
||||
bg={WARNA.biruTua}
|
||||
size="lg"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => { setOpen(true) }}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
</Box>
|
||||
<LayoutModal opened={isOpen} onClose={() => setOpen(false)}
|
||||
description="Apakah Anda yakin ingin menambahkan anggota divisi?"
|
||||
onYes={(val) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
import { LayoutDrawer, LayoutNavbarNew, SkeletonSingle, WARNA } from '@/module/_global';
|
||||
import { ActionIcon, Avatar, Box, Button, Divider, Flex, Group, Skeleton, Stack, Text } from '@mantine/core';
|
||||
import { ActionIcon, Avatar, Box, Button, Divider, Flex, Grid, Group, Skeleton, Stack, Text } from '@mantine/core';
|
||||
import { useShallowEffect } from '@mantine/hooks';
|
||||
import { useParams, useRouter } from 'next/navigation';
|
||||
import React, { useState } from 'react';
|
||||
@@ -184,24 +184,28 @@ export default function InformationDivision() {
|
||||
: member.map((v, i) => {
|
||||
return (
|
||||
<Box key={i}>
|
||||
<Flex
|
||||
justify={"space-between"}
|
||||
align={"center"}
|
||||
mt={10}
|
||||
<Grid align='center' mt={10}
|
||||
onClick={() => { onClickMember(v.id, (v.isAdmin) ? true : false), setChooseMemberName(v.name) }}
|
||||
>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Box>
|
||||
<Text c={WARNA.biruTua} fw={"bold"}>
|
||||
{v.name}
|
||||
</Text>
|
||||
</Box>
|
||||
</Group>
|
||||
<Text c={WARNA.biruTua} fw={"bold"}>
|
||||
{(v.isAdmin) ? 'Admin' : 'Anggota'}
|
||||
</Text>
|
||||
</Flex>
|
||||
<Grid.Col span={9}>
|
||||
<Group>
|
||||
<Avatar src={`/api/file/img?cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
||||
<Box w={{
|
||||
base: 140,
|
||||
xl: 270
|
||||
}}>
|
||||
<Text c={WARNA.biruTua} fw={"bold"} lineClamp={1}>
|
||||
{v.name}
|
||||
</Text>
|
||||
</Box>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={3}>
|
||||
<Text c={WARNA.biruTua} fw={"bold"} ta={'end'}>
|
||||
{(v.isAdmin) ? 'Admin' : 'Anggota'}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Box mt={10}>
|
||||
<Divider size={"xs"} />
|
||||
</Box>
|
||||
|
||||
@@ -150,26 +150,45 @@ export default function ListDivision() {
|
||||
data?.map((v: any, i: any) => {
|
||||
return (
|
||||
<Box key={i}>
|
||||
<Group justify="space-between" mb={10} onClick={() => router.push(`/division/${v.id}`)}>
|
||||
<Group>
|
||||
<Center>
|
||||
<ActionIcon
|
||||
variant="gradient"
|
||||
size={50}
|
||||
aria-label="Gradient action icon"
|
||||
radius={100}
|
||||
gradient={{
|
||||
from: '#DFDA7C',
|
||||
to: '#F2AF46',
|
||||
deg: 174
|
||||
}}
|
||||
>
|
||||
<HiMiniUserGroup size={25} color={WARNA.biruTua} />
|
||||
</ActionIcon>
|
||||
</Center>
|
||||
<Text>{v.name}</Text>
|
||||
</Group>
|
||||
</Group>
|
||||
<Grid align='center'>
|
||||
<Grid.Col span={{
|
||||
base: 2,
|
||||
xl: 1
|
||||
}}>
|
||||
<Group onClick={() => router.push(`/division/${v.id}`)}>
|
||||
<Center>
|
||||
<ActionIcon
|
||||
variant="gradient"
|
||||
size={50}
|
||||
aria-label="Gradient action icon"
|
||||
radius={100}
|
||||
gradient={{
|
||||
from: '#DFDA7C',
|
||||
to: '#F2AF46',
|
||||
deg: 174
|
||||
}}
|
||||
>
|
||||
<HiMiniUserGroup size={25} color={WARNA.biruTua} />
|
||||
</ActionIcon>
|
||||
</Center>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={{
|
||||
base: 10,
|
||||
xl: 11
|
||||
}}>
|
||||
<Box>
|
||||
<Box w={{
|
||||
base: 280,
|
||||
xl: 430
|
||||
}}>
|
||||
<Text truncate="end" pl={20}>
|
||||
{v.name}
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider my="sm" />
|
||||
</Box>
|
||||
);
|
||||
@@ -193,8 +212,8 @@ export default function ListDivision() {
|
||||
<Card shadow="sm" padding="md" component="a" radius={10} onClick={() => router.push(`/division/${v.id}`)}>
|
||||
<Card.Section>
|
||||
<Box h={120} bg={WARNA.biruTua}>
|
||||
<Flex justify={'center'} align={'center'} h={"100%"}>
|
||||
<Title order={3} c={"white"}>{v.name}</Title>
|
||||
<Flex justify={'center'} align={'center'} h={"100%"} pl={20} pr={20}>
|
||||
<Title order={3} c={"white"} ta={"center"} lineClamp={2}>{v.name}</Title>
|
||||
</Flex>
|
||||
</Box>
|
||||
</Card.Section>
|
||||
|
||||
@@ -63,8 +63,8 @@ export default function ListDivisi() {
|
||||
<Card shadow="sm" padding="md" component="a" radius={10} onClick={() => router.push(`/division/${v.id}`)}>
|
||||
<Card.Section>
|
||||
<Box h={120} bg={`linear-gradient(180deg, rgba(223,218,124,1) 25%, rgba(242,175,70,1) 100%)`}>
|
||||
<Flex justify={'center'} align={'center'} h={"100%"}>
|
||||
<Title order={3} c={WARNA.biruTua}>{v.name}</Title>
|
||||
<Flex justify={'center'} align={'center'} h={"100%"} pl={20} pr={20}>
|
||||
<Title order={3} c={WARNA.biruTua} ta={"center"} lineClamp={2}>{v.name}</Title>
|
||||
</Flex>
|
||||
</Box>
|
||||
</Card.Section>
|
||||
|
||||
@@ -62,8 +62,8 @@ export default function ListProjects() {
|
||||
<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 justify={'center'} align={'center'} h={"100%"} pl={20} pr={20}>
|
||||
<Title order={3} c={"white"} ta={"center"} lineClamp={2}>{v.title}</Title>
|
||||
</Flex>
|
||||
</Box>
|
||||
</Card.Section>
|
||||
|
||||
@@ -121,35 +121,50 @@ export default function ListProject() {
|
||||
{isData.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.status === 0 ? '#1372C4' :
|
||||
v.status === 1 ? '#C5771A' :
|
||||
v.status === 2 ? '#0B6025' :
|
||||
v.status === 3 ? '#BB1F1F' :
|
||||
""
|
||||
} />
|
||||
</Box>
|
||||
</Group>
|
||||
<Grid align='center' gutter={10}>
|
||||
<Grid.Col span={1}>
|
||||
<Group onClick={() => router.push(`/project/${v.id}`)}>
|
||||
<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>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={11}>
|
||||
<Group justify='space-between' align='center'>
|
||||
<Box>
|
||||
<Box w={{
|
||||
base: 280,
|
||||
xl: 430
|
||||
}}>
|
||||
<Text truncate="end" pl={20}>
|
||||
{v.title}
|
||||
</Text>
|
||||
</Box>
|
||||
{/* <Text lineClamp={1}></Text> */}
|
||||
|
||||
</Box>
|
||||
<RiCircleFill size={12} color={
|
||||
v.status === 0 ? '#1372C4' :
|
||||
v.status === 1 ? '#C5771A' :
|
||||
v.status === 2 ? '#0B6025' :
|
||||
v.status === 3 ? '#BB1F1F' :
|
||||
""
|
||||
} />
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider my="sm" />
|
||||
</Box>
|
||||
);
|
||||
@@ -163,8 +178,8 @@ export default function ListProject() {
|
||||
<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 justify={'center'} align={'center'} h={"100%"} pl={20} pr={20}>
|
||||
<Title order={3} c={"white"} ta={"center"} lineClamp={2}>{v.title}</Title>
|
||||
</Flex>
|
||||
</Box>
|
||||
</Card.Section>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { SkeletonSingle, WARNA } from "@/module/_global"
|
||||
import { Box, Group, ActionIcon, Text, TextInput, Divider, Avatar } from "@mantine/core"
|
||||
import { Box, Group, ActionIcon, Text, TextInput, Divider, Avatar, Grid } from "@mantine/core"
|
||||
import { useShallowEffect } from "@mantine/hooks"
|
||||
import { useRouter, useSearchParams } from "next/navigation"
|
||||
import { useEffect, useState } from "react"
|
||||
@@ -104,17 +104,18 @@ export default function TabListMember() {
|
||||
<Box onClick={() => {
|
||||
router.push(`/member/${v.id}`)
|
||||
}}>
|
||||
<Group align='center' style={{
|
||||
padding: 10,
|
||||
}} >
|
||||
<Box>
|
||||
<Grid p={10} gutter={{
|
||||
base: 60,
|
||||
xl: "xs"
|
||||
}} align="center">
|
||||
<Grid.Col span={2}>
|
||||
<Avatar src={`/api/file/img?cat=user&file=${v.img}`} size={50} alt="image" />
|
||||
</Box>
|
||||
<Box>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={9}>
|
||||
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{_.startCase(v.name)}</Text>
|
||||
<Text fw={'lighter'} fz={12}>{v.group + ' - ' + v.position}</Text>
|
||||
</Box>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
<Divider my={10} />
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user