upd: upload foto user
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"use client"
|
||||
import { LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||
import { DIR, LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||
import { Avatar, Box, Button, Flex, Indicator, Modal, rem, Select, Skeleton, Stack, Text, TextInput } from "@mantine/core";
|
||||
import toast from "react-hot-toast";
|
||||
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||
@@ -45,7 +45,7 @@ export default function EditProfile() {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setData(res.data)
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
@@ -258,31 +258,31 @@ export default function EditProfile() {
|
||||
zIndex: 999,
|
||||
backgroundColor: `${WARNA.bgWhite}`,
|
||||
}}>
|
||||
{loading ?
|
||||
<Skeleton height={50} radius={30} />
|
||||
{loading ?
|
||||
<Skeleton height={50} radius={30} />
|
||||
:
|
||||
<Button
|
||||
c={"white"}
|
||||
bg={WARNA.biruTua}
|
||||
size="md"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => {
|
||||
if (
|
||||
data.nik !== "" &&
|
||||
data.name !== "" &&
|
||||
data.email !== "" &&
|
||||
data.phone !== "" &&
|
||||
data.gender !== ""
|
||||
) {
|
||||
setValModal(true)
|
||||
} else {
|
||||
toast.error("Mohon lengkapi semua form");
|
||||
}
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
<Button
|
||||
c={"white"}
|
||||
bg={WARNA.biruTua}
|
||||
size="md"
|
||||
radius={30}
|
||||
fullWidth
|
||||
onClick={() => {
|
||||
if (
|
||||
data.nik !== "" &&
|
||||
data.name !== "" &&
|
||||
data.email !== "" &&
|
||||
data.phone !== "" &&
|
||||
data.gender !== ""
|
||||
) {
|
||||
setValModal(true)
|
||||
} else {
|
||||
toast.error("Mohon lengkapi semua form");
|
||||
}
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
}
|
||||
</Box>
|
||||
<LayoutModal opened={isValModal} onClose={() => setValModal(false)}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"use client"
|
||||
import { LayoutIconBack, LayoutNavbarHome, SkeletonDetailProfile, WARNA } from "@/module/_global";
|
||||
import { ActionIcon, Anchor, Avatar, Box, Button, Flex, Grid, Group, SimpleGrid, Skeleton, Stack, Text } from "@mantine/core";
|
||||
import { HiUser } from "react-icons/hi2";
|
||||
import { DIR, LayoutIconBack, LayoutNavbarHome, SkeletonDetailProfile, WARNA } from "@/module/_global";
|
||||
import { ActionIcon, Avatar, Box, Grid, Group, Skeleton, Stack, Text } from "@mantine/core";
|
||||
import { RiIdCardFill } from "react-icons/ri";
|
||||
import { FaSquarePhone } from "react-icons/fa6";
|
||||
import { MdEmail } from "react-icons/md";
|
||||
@@ -27,8 +26,7 @@ export default function Profile() {
|
||||
setLoading(true)
|
||||
const res = await funGetProfileByCookies()
|
||||
setData(res.data)
|
||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
||||
// setIMG(`https://wibu-storage.wibudev.com/api/files/view/cm0x8dbwn0005bp5tgmfcthzw/${res.data.img}`)
|
||||
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user