change toast position
This commit is contained in:
parent
9261600dc0
commit
a489c489c9
|
|
@ -8,6 +8,7 @@ import { formInit } from "./utils/init";
|
||||||
import { formReload } from "./utils/reload";
|
import { formReload } from "./utils/reload";
|
||||||
import { getPathname } from "lib/utils/pathname";
|
import { getPathname } from "lib/utils/pathname";
|
||||||
import { sofDeleteField as softDeleteField } from "lib/utils/soft-del-rel";
|
import { sofDeleteField as softDeleteField } from "lib/utils/soft-del-rel";
|
||||||
|
import { toast } from "../ui/toast";
|
||||||
|
|
||||||
const editorFormWidth = {} as Record<string, { w: number; f: any }>;
|
const editorFormWidth = {} as Record<string, { w: number; f: any }>;
|
||||||
|
|
||||||
|
|
@ -82,7 +83,6 @@ export const Form: FC<FMProps> = (props) => {
|
||||||
fm.soft_delete.field = null;
|
fm.soft_delete.field = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const ref = useRef({
|
const ref = useRef({
|
||||||
|
|
@ -196,7 +196,8 @@ export const Form: FC<FMProps> = (props) => {
|
||||||
"form c-flex-1 c-w-full c-h-full c-relative c-overflow-auto"
|
"form c-flex-1 c-w-full c-h-full c-relative c-overflow-auto"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{toaster_el && createPortal(<Toaster cn={cx} />, toaster_el)}
|
{toaster_el &&
|
||||||
|
createPortal(<Toaster position={toast.position} cn={cx} />, toaster_el)}
|
||||||
<div
|
<div
|
||||||
ref={form_inner_ref}
|
ref={form_inner_ref}
|
||||||
className={cx(
|
className={cx(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import {
|
||||||
MouseEvent,
|
MouseEvent,
|
||||||
ReactElement,
|
ReactElement,
|
||||||
ReactNode,
|
ReactNode,
|
||||||
useCallback,
|
|
||||||
useEffect,
|
useEffect,
|
||||||
} from "react";
|
} from "react";
|
||||||
import DataGrid, {
|
import DataGrid, {
|
||||||
|
|
@ -37,7 +36,6 @@ import { MDLocal } from "../md/utils/typings";
|
||||||
import { Skeleton } from "../ui/skeleton";
|
import { Skeleton } from "../ui/skeleton";
|
||||||
import { toast } from "../ui/toast";
|
import { toast } from "../ui/toast";
|
||||||
import { sortTree } from "./utils/sort-tree";
|
import { sortTree } from "./utils/sort-tree";
|
||||||
import { getPathname } from "lib/exports";
|
|
||||||
|
|
||||||
type OnRowClick = (arg: {
|
type OnRowClick = (arg: {
|
||||||
row: any;
|
row: any;
|
||||||
|
|
@ -781,7 +779,11 @@ export const TableList: FC<TableListProp> = ({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="table-list-inner c-absolute c-inset-0">
|
<div className="table-list-inner c-absolute c-inset-0">
|
||||||
{toaster_el && createPortal(<Toaster cn={cn} />, toaster_el)}
|
{toaster_el &&
|
||||||
|
createPortal(
|
||||||
|
<Toaster position={toast.position} cn={cn} />,
|
||||||
|
toaster_el
|
||||||
|
)}
|
||||||
{local.status === "init" ? (
|
{local.status === "init" ? (
|
||||||
<DataGrid
|
<DataGrid
|
||||||
style={{ opacity: 0 }}
|
style={{ opacity: 0 }}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ const timer = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toast = {
|
export const toast = {
|
||||||
|
position: "top-right" as any,
|
||||||
dismiss: () => {
|
dismiss: () => {
|
||||||
if (!timer.timeout) {
|
if (!timer.timeout) {
|
||||||
sonner.dismiss();
|
sonner.dismiss();
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
import { getPathname } from "lib/utils/pathname";
|
|
||||||
import { FC, ReactNode, useEffect, useLayoutEffect, useState } from "react";
|
|
||||||
import { loadSession } from "../login/utils/load";
|
|
||||||
import { createPortal } from "react-dom";
|
|
||||||
import { Toaster } from "sonner";
|
|
||||||
import { PFTypes } from "./typings";
|
|
||||||
import { useLocal } from "lib/utils/use-local";
|
import { useLocal } from "lib/utils/use-local";
|
||||||
|
import { FC, useEffect } from "react";
|
||||||
|
import { PFTypes } from "./typings";
|
||||||
export { PFTypes } from "./typings";
|
export { PFTypes } from "./typings";
|
||||||
export { generateProfile } from "./utils/generate";
|
export { generateProfile } from "./utils/generate";
|
||||||
export const Profile: FC<PFTypes> = ({
|
export const Profile: FC<PFTypes> = ({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue