-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49b9534
commit ab54eaa
Showing
18 changed files
with
1,056 additions
and
468 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/client/src/admin/data/FullScreenLoadingSpinner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createPortal } from "react-dom"; | ||
import Spinner from "../../components/Spinner"; | ||
|
||
export default function FullScreenLoadingSpinner() { | ||
return createPortal( | ||
<div | ||
style={{ height: "100vh", backdropFilter: "blur(2px)" }} | ||
className="w-full flex min-h-full h-96 justify-center text-center align-middle items-center content-center justify-items-center place-items-center place-content-center z-50 absolute top-0 left-0 bg-black bg-opacity-50" | ||
> | ||
<Spinner large color="white" /> | ||
</div>, | ||
document.body | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { | ||
Dispatch, | ||
ReactNode, | ||
SetStateAction, | ||
createContext, | ||
useState, | ||
} from "react"; | ||
|
||
export const LayerEditingContext = createContext<{ | ||
openEditor?: number; | ||
setOpenEditor: (id: number | undefined) => void; | ||
/** | ||
* These are an optimization to immediately remove items from the legend or | ||
* table of contents after deletion, without waiting to refetch the entire | ||
* table of contents. | ||
*/ | ||
recentlyDeletedStableIds: string[]; | ||
setRecentlyDeletedStableIds: Dispatch<SetStateAction<string[]>>; | ||
}>({ | ||
setOpenEditor: (id: number | undefined) => {}, | ||
recentlyDeletedStableIds: [], | ||
// set state action | ||
setRecentlyDeletedStableIds: () => {}, | ||
}); | ||
|
||
export const LayerEditingContextProvider = ({ | ||
children, | ||
}: { | ||
children: ReactNode; | ||
}) => { | ||
const [openEditor, setOpenEditor] = useState<number | undefined>(undefined); | ||
const [recentlyDeletedItems, setRecentlyDeletedItems] = useState<string[]>( | ||
[] | ||
); | ||
return ( | ||
<LayerEditingContext.Provider | ||
value={{ | ||
openEditor, | ||
setOpenEditor, | ||
recentlyDeletedStableIds: recentlyDeletedItems, | ||
setRecentlyDeletedStableIds: setRecentlyDeletedItems, | ||
}} | ||
> | ||
{children} | ||
</LayerEditingContext.Provider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.