upd: user

Deskripsi:
- tambah input select jabatan pada edit profile
- tambah loading pada input select jabatan halaman edit profile
- tambah loading pada input select jabatan halaman edit member

No Issues
This commit is contained in:
amel
2024-12-26 15:15:45 +08:00
parent 87c90c94c4
commit 96084b22c0
5 changed files with 214 additions and 161 deletions

View File

@@ -30,6 +30,7 @@ export default function EditMember({ id }: { id: string }) {
const [loading, setLoading] = useState(true)
const roleLogin = useHookstate(globalRole)
const tema = useHookstate(TEMA)
const [loadingPosition, setLoadingPosition] = useState(true)
const [touched, setTouched] = useState({
nik: false,
name: false,
@@ -83,6 +84,7 @@ export default function EditMember({ id }: { id: string }) {
async function getAllPosition(val: any) {
try {
setLoadingPosition(true)
const res = await funGetAllPosition(
"?active=true" + "&group=" + `${val}`
);
@@ -90,6 +92,8 @@ export default function EditMember({ id }: { id: string }) {
} catch (error) {
console.error(error)
} finally {
setLoadingPosition(false)
}
}
@@ -233,19 +237,14 @@ export default function EditMember({ id }: { id: string }) {
</Indicator>
}
{loading ?
<>
<Skeleton height={40} mt={20} radius={30} />
<Skeleton height={40} mt={10} radius={30} />
<Skeleton height={40} mt={10} radius={30} />
<Skeleton height={40} mt={10} radius={30} />
<Skeleton height={40} mt={10} radius={30} />
<Skeleton height={40} mt={10} radius={30} />
<Skeleton height={40} mt={10} radius={30} />
</>
[...Array(6)].map((_, index) => (
<Skeleton key={index} height={40} mt={20} radius={30} />
))
:
<>
<Select
placeholder="Pilih Jabatan" label="Jabatan" w={"100%"} size="md" required withAsterisk radius={30}
placeholder={loadingPosition ? "Loading.. " : "Pilih Jabatan"}
label="Jabatan" w={"100%"} size="md" required withAsterisk radius={30}
styles={{
input: {
color: tema.get().utama,