fitur: developer
Deskripsi: - update struktur db - update seeder user role - home developer - search page developer - profile developer :: tidak bisa edit No Issues
This commit is contained in:
@@ -18,6 +18,7 @@ import { IProfileById } from "../lib/type_profile";
|
||||
|
||||
export default function Profile() {
|
||||
const [openModal, setOpenModal] = useState(false);
|
||||
const [roleUser, setRoleUser] = useState("")
|
||||
const [isData, setData] = useState<IProfileById>()
|
||||
const router = useRouter()
|
||||
const [loading, setLoading] = useState(true)
|
||||
@@ -30,8 +31,8 @@ export default function Profile() {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setData(res.data)
|
||||
setRoleUser(res.data.idUserRole)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
@@ -101,9 +102,12 @@ export default function Profile() {
|
||||
<Stack p={20}>
|
||||
<Group justify="space-between" grow py={5}>
|
||||
<Text fw={'bold'} fz={20}>Informasi</Text>
|
||||
<Group justify="flex-end">
|
||||
<Text style={{ cursor: 'pointer' }} ta={"right"} c={"blue"} onClick={() => router.push(`/profile/edit/`)}>Edit</Text>
|
||||
</Group>
|
||||
{
|
||||
roleUser != "developer" &&
|
||||
<Group justify="flex-end">
|
||||
<Text style={{ cursor: 'pointer' }} ta={"right"} c={"blue"} onClick={() => router.push(`/profile/edit/`)}>Edit</Text>
|
||||
</Group>
|
||||
}
|
||||
</Group>
|
||||
<Grid>
|
||||
<Grid.Col span={4}>
|
||||
@@ -127,17 +131,20 @@ export default function Profile() {
|
||||
<Text fz={15} fw={'bold'} ta={"right"}>{isData?.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"}>{isData?.position}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{
|
||||
roleUser != "developer" &&
|
||||
<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"}>{isData?.position}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
}
|
||||
<Grid>
|
||||
<Grid.Col span={5}>
|
||||
<Group>
|
||||
|
||||
Reference in New Issue
Block a user