Merge pull request #181 from bipproduction/amalia/11-des-24
Amalia/11 des 24
This commit is contained in:
@@ -77,12 +77,21 @@ export default function UIGlobal_LayoutHeaderTamplate({
|
||||
: router.push(routerLeft, { scroll: false });
|
||||
}}
|
||||
>
|
||||
{isLoading ? (
|
||||
{/* PAKE LOADING SAAT KLIK BACK */}
|
||||
{/* {isLoading ? (
|
||||
<Loader color={AccentColor.yellow} size={20} />
|
||||
) : iconLeft ? (
|
||||
iconLeft
|
||||
) : (
|
||||
<IconChevronLeft />
|
||||
)} */}
|
||||
|
||||
|
||||
{/* GA PAKE LOADING SAAT KLIK BACK */}
|
||||
{iconLeft ? (
|
||||
iconLeft
|
||||
) : (
|
||||
<IconChevronLeft />
|
||||
)}
|
||||
</ActionIcon>
|
||||
)}
|
||||
|
||||
@@ -108,14 +108,12 @@ export default function DrawerKatalogNew({
|
||||
</Group>
|
||||
<SimpleGrid cols={4}>
|
||||
{listPage.map((e, i) => (
|
||||
<Stack key={i} align="center" spacing={"xs"}>
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
c="white"
|
||||
onClick={() => {
|
||||
router.push(e.path, { scroll: false });
|
||||
}}
|
||||
>
|
||||
<Stack key={i} align="center" spacing={"xs"}
|
||||
onClick={() => {
|
||||
router.push(e.path, { scroll: false });
|
||||
}}
|
||||
>
|
||||
<ActionIcon variant="transparent" c="white" >
|
||||
{e.icon}
|
||||
</ActionIcon>
|
||||
<Text align="center" color="white">
|
||||
|
||||
@@ -30,6 +30,7 @@ export function Portofolio_ComponentButtonSelanjutnya({
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
async function onSubmit() {
|
||||
setLoading(true);
|
||||
const porto = {
|
||||
namaBisnis: dataPortofolio.namaBisnis,
|
||||
masterBidangBisnisId: dataPortofolio.masterBidangBisnisId,
|
||||
@@ -56,7 +57,6 @@ export function Portofolio_ComponentButtonSelanjutnya({
|
||||
fileId: uploadFileToStorage.data.id,
|
||||
});
|
||||
if (res.status === 201) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil disimpan");
|
||||
router.replace(RouterMap.create + res.id, { scroll: false });
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { useRouter } from "next/navigation";
|
||||
import { map_funCreatePin } from "../../fun/create/fun_create_pin";
|
||||
import { DIRECTORY_ID } from "@/app/lib";
|
||||
import { funGlobal_UploadToStorage } from "@/app_modules/_global/fun";
|
||||
import { useState } from "react";
|
||||
|
||||
export function ComponentMap_ButtonSavePin({
|
||||
namePin,
|
||||
@@ -26,7 +27,10 @@ export function ComponentMap_ButtonSavePin({
|
||||
file: File;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
async function onSavePin() {
|
||||
setLoading(true)
|
||||
const uploadFileToStorage = await funGlobal_UploadToStorage({
|
||||
file: file,
|
||||
dirId: DIRECTORY_ID.map_image,
|
||||
@@ -49,15 +53,19 @@ export function ComponentMap_ButtonSavePin({
|
||||
res.status === 200
|
||||
? (ComponentGlobal_NotifikasiBerhasil(res.message), router.back())
|
||||
: ComponentGlobal_NotifikasiGagal(res.message);
|
||||
|
||||
setLoading(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
loading={loading}
|
||||
my={"xl"}
|
||||
style={{ transition: "0.5s" }}
|
||||
disabled={namePin === "" || file === null ? true : false}
|
||||
radius={"xl"}
|
||||
loaderPosition="center"
|
||||
bg={MainColor.yellow}
|
||||
color="yellow"
|
||||
c={"black"}
|
||||
|
||||
Reference in New Issue
Block a user