update 5 files
This commit is contained in:
parent
13917ad905
commit
fbfa075c51
|
|
@ -275,7 +275,7 @@ export const TableList: React.FC<any> = ({
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
toast.dismiss();
|
toast.dismiss();
|
||||||
}, 2000);
|
}, 100);
|
||||||
};
|
};
|
||||||
if (typeof onInit === "function") {
|
if (typeof onInit === "function") {
|
||||||
onInit(local);
|
onInit(local);
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,11 @@ export const PinterestLayout: React.FC<{
|
||||||
col: [] as string[],
|
col: [] as string[],
|
||||||
data: [] as string[],
|
data: [] as string[],
|
||||||
},
|
},
|
||||||
|
user: null as any,
|
||||||
|
ready: false as boolean,
|
||||||
});
|
});
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const columns: any[] = Array.from({ length: col }, () => []); // Inisialisasi array kosong sebanyak 'col'
|
const columns: any[] = Array.from({ length: col }, () => []);
|
||||||
|
|
||||||
data.forEach((item, index) => {
|
data.forEach((item, index) => {
|
||||||
const targetColumn = index % col; // Menentukan kolom target berdasarkan indeks
|
const targetColumn = index % col; // Menentukan kolom target berdasarkan indeks
|
||||||
columns[targetColumn].push(item); // Memasukkan elemen ke kolom yang sesuai
|
columns[targetColumn].push(item); // Memasukkan elemen ke kolom yang sesuai
|
||||||
|
|
@ -34,7 +35,6 @@ export const PinterestLayout: React.FC<{
|
||||||
local.data = columns;
|
local.data = columns;
|
||||||
local.render();
|
local.render();
|
||||||
}, [data, col]);
|
}, [data, col]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="flex flex-grow flex-1 flex-col w-full h-full">
|
<div className="flex flex-grow flex-1 flex-col w-full h-full">
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const AlertDialogOverlay = React.forwardRef<
|
||||||
>(({ className, ...props }, ref) => (
|
>(({ className, ...props }, ref) => (
|
||||||
<AlertDialogPrimitive.Overlay
|
<AlertDialogPrimitive.Overlay
|
||||||
className={cn(
|
className={cn(
|
||||||
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {
|
||||||
} from "./alert-dialog";
|
} from "./alert-dialog";
|
||||||
|
|
||||||
export const Alert: FC<{
|
export const Alert: FC<{
|
||||||
|
title?: string;
|
||||||
type: string;
|
type: string;
|
||||||
onClick?: (event?: any) => Promise<any> | any;
|
onClick?: (event?: any) => Promise<any> | any;
|
||||||
children?: any;
|
children?: any;
|
||||||
|
|
@ -21,7 +22,9 @@ export const Alert: FC<{
|
||||||
mode?: "auto" | "manual";
|
mode?: "auto" | "manual";
|
||||||
open?: boolean;
|
open?: boolean;
|
||||||
onOpenChange?: (event: boolean) => void;
|
onOpenChange?: (event: boolean) => void;
|
||||||
|
hiddenFooter?: boolean;
|
||||||
}> = ({
|
}> = ({
|
||||||
|
title = " Are you certain you want to continue?",
|
||||||
type,
|
type,
|
||||||
onClick,
|
onClick,
|
||||||
children,
|
children,
|
||||||
|
|
@ -31,6 +34,7 @@ export const Alert: FC<{
|
||||||
mode,
|
mode,
|
||||||
open,
|
open,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
|
hiddenFooter = false,
|
||||||
}) => {
|
}) => {
|
||||||
const message: any = {
|
const message: any = {
|
||||||
save: "Your data will be saved securely. You can update it at any time if needed.",
|
save: "Your data will be saved securely. You can update it at any time if needed.",
|
||||||
|
|
@ -59,22 +63,26 @@ export const Alert: FC<{
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<AlertDialogHeader>
|
<AlertDialogHeader>
|
||||||
<AlertDialogTitle>
|
<AlertDialogTitle>{title}</AlertDialogTitle>
|
||||||
Are you certain you want to continue?
|
|
||||||
</AlertDialogTitle>
|
|
||||||
<AlertDialogDescription>
|
<AlertDialogDescription>
|
||||||
{msg || message?.[type]}
|
{msg || message?.[type]}
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
<AlertDialogFooter>
|
{!hiddenFooter ? (
|
||||||
<AlertDialogCancel>No</AlertDialogCancel>
|
<>
|
||||||
<AlertDialogAction
|
<AlertDialogFooter>
|
||||||
className={"bg-primary text-white"}
|
<AlertDialogCancel>No</AlertDialogCancel>
|
||||||
onClick={onClick}
|
<AlertDialogAction
|
||||||
>
|
className={"bg-primary text-white"}
|
||||||
Yes
|
onClick={onClick}
|
||||||
</AlertDialogAction>
|
>
|
||||||
</AlertDialogFooter>
|
Yes
|
||||||
|
</AlertDialogAction>
|
||||||
|
</AlertDialogFooter>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</AlertDialogContent>
|
</AlertDialogContent>
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ export const actionToast = async (data: {
|
||||||
);
|
);
|
||||||
if (typeof task === "function") await task();
|
if (typeof task === "function") await task();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
toast.dismiss();
|
||||||
toast.success(
|
toast.success(
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
|
|
@ -57,23 +58,26 @@ export const actionToast = async (data: {
|
||||||
|
|
||||||
if (typeof after === "function") after();
|
if (typeof after === "function") after();
|
||||||
if (typeof success === "function") success();
|
if (typeof success === "function") success();
|
||||||
}, 1000);
|
}, 100);
|
||||||
} catch (ex: any) {
|
} catch (ex: any) {
|
||||||
toast.error(
|
setTimeout(() => {
|
||||||
<div className="flex flex-col w-full">
|
toast.dismiss();
|
||||||
<div className="flex text-red-600 items-center">
|
toast.error(
|
||||||
<AlertTriangle className="h-4 w-4 mr-1" />
|
<div className="flex flex-col w-full">
|
||||||
{msg_error ? msg_error : " Failed"}{" "}
|
<div className="flex text-red-600 items-center">
|
||||||
{get(ex, "response.data.meta.message") || ex.message}.
|
<AlertTriangle className="h-4 w-4 mr-1" />
|
||||||
</div>
|
{msg_error ? msg_error : " Failed"}{" "}
|
||||||
</div>,
|
{get(ex, "response.data.meta.message") || ex.message}.
|
||||||
{
|
</div>
|
||||||
dismissible: true,
|
</div>,
|
||||||
className: css`
|
{
|
||||||
background: #ffecec;
|
dismissible: true,
|
||||||
border: 2px solid red;
|
className: css`
|
||||||
`,
|
background: #ffecec;
|
||||||
}
|
border: 2px solid red;
|
||||||
);
|
`,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue