upd: katalog profile
Deskripsi: - update bug button admin No Issues
This commit is contained in:
@@ -89,7 +89,7 @@ export default function DrawerKatalogNew({ opened, close, userRoleId, userId }:
|
|||||||
))}
|
))}
|
||||||
|
|
||||||
<Component_ButtonLogout userId={userId} />
|
<Component_ButtonLogout userId={userId} />
|
||||||
{userRoleId != "1" && (
|
{userRoleId != "1" && userRoleId != "" && (
|
||||||
<Stack align="center" spacing={"xs"}>
|
<Stack align="center" spacing={"xs"}>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ export default function LayoutKatalogNew({ children }: { children: any }) {
|
|||||||
const [userRoleId, setUserRoleId] = useState("")
|
const [userRoleId, setUserRoleId] = useState("")
|
||||||
const [userLoginId, setUserLoginId] = useState("")
|
const [userLoginId, setUserLoginId] = useState("")
|
||||||
const [opened, { open, close }] = useDisclosure()
|
const [opened, { open, close }] = useDisclosure()
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
async function getProfile() {
|
async function getProfile() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const response = await apiGetUserProfile(`?profile=${param.id}`)
|
const response = await apiGetUserProfile(`?profile=${param.id}`)
|
||||||
const response2 = await funGetUserIdByToken()
|
const response2 = await funGetUserIdByToken()
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -27,6 +29,8 @@ export default function LayoutKatalogNew({ children }: { children: any }) {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,13 +45,15 @@ export default function LayoutKatalogNew({ children }: { children: any }) {
|
|||||||
<UIGlobal_LayoutHeaderTamplate
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
title="KATALOG"
|
title="KATALOG"
|
||||||
customButtonRight={
|
customButtonRight={
|
||||||
authorId !== userLoginId ? (
|
loading ?
|
||||||
<ActionIcon disabled variant="transparent"></ActionIcon>
|
<ActionIcon disabled variant="transparent"></ActionIcon> :
|
||||||
) : (
|
authorId == userLoginId ? (
|
||||||
<ActionIcon c="white" variant="transparent" onClick={() => open()}>
|
<ActionIcon c="white" variant="transparent" onClick={() => open()}>
|
||||||
<IconDotsVertical />
|
<IconDotsVertical />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
)
|
) : (
|
||||||
|
<ActionIcon disabled variant="transparent"></ActionIcon>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user