rev : tampilkan user role

Deskripsi:
- menampilkan user role pada profile dan detail anggota

No Issues
This commit is contained in:
amel
2025-02-04 12:15:00 +08:00
parent 7bdca4de5d
commit bcd9e98518
6 changed files with 68 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ import { ActionIcon, Avatar, Box, Center, Grid, Group, Skeleton, Stack, Text } f
import { useShallowEffect } from "@mantine/hooks";
import { useState } from "react";
import toast from "react-hot-toast";
import { FaSquarePhone } from "react-icons/fa6";
import { FaBuildingUser, FaSquarePhone } from "react-icons/fa6";
import { HiMenu } from "react-icons/hi";
import { IoMaleFemale } from "react-icons/io5";
import { MdEmail } from "react-icons/md";
@@ -14,6 +14,8 @@ import { valueRoleUser } from "../../lib/val_user";
import { funGetOneMember } from "../lib/api_member";
import { IListMember, IMember } from "../lib/type_member";
import DrawerDetailMember from "./drawer_detail_member";
import { BiSolidUserBadge } from "react-icons/bi";
import { PiGenderIntersexFill } from "react-icons/pi";
export default function NavbarDetailMember({ id }: IMember) {
@@ -47,7 +49,7 @@ export default function NavbarDetailMember({ id }: IMember) {
setLoading(false)
} catch (error) {
console.error(error)
toast.error("Gagal mendapatkan detail user, coba lagi nanti");
toast.error("Gagal mendapatkan detail anggota, coba lagi nanti");
} finally {
setLoading(false)
}
@@ -89,7 +91,7 @@ export default function NavbarDetailMember({ id }: IMember) {
:
<>
<Text c={'white'} fw={'bold'} fz={25} ta={"center"}>{dataOne?.name}</Text>
<Text c={'white'} fw={'lighter'} fz={15}>{dataOne?.group} - {dataOne?.position}</Text>
<Text c={'white'} fw={'lighter'} fz={15}>{dataOne?.role}</Text>
</>
}
</Stack>
@@ -113,6 +115,28 @@ export default function NavbarDetailMember({ id }: IMember) {
<Text fz={15} fw={'bold'} ta={"right"}>{dataOne?.nik}</Text>
</Grid.Col>
</Grid>
<Grid>
<Grid.Col span={5}>
<Group>
<FaBuildingUser size={25} />
<Text fz={15}>Lembaga Desa</Text>
</Group>
</Grid.Col>
<Grid.Col span={7}>
<Text fz={15} fw={'bold'} ta={"right"}>{dataOne?.group}</Text>
</Grid.Col>
</Grid>
<Grid>
<Grid.Col span={4}>
<Group>
<BiSolidUserBadge size={25} />
<Text fz={15}>Jabatan</Text>
</Group>
</Grid.Col>
<Grid.Col span={8}>
<Text fz={15} fw={'bold'} ta={"right"}>{dataOne?.position}</Text>
</Grid.Col>
</Grid>
<Grid>
<Grid.Col span={5}>
<Group>
@@ -138,7 +162,7 @@ export default function NavbarDetailMember({ id }: IMember) {
<Grid>
<Grid.Col span={6}>
<Group>
<IoMaleFemale size={25} />
<PiGenderIntersexFill size={25} />
<Text fz={15}>Jenis Kelamin</Text>
</Group>
</Grid.Col>