mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-23 05:54:49 +03:00
feat(Upload): readd opening upload jumper via custom event
This commit is contained in:
parent
108d2293a5
commit
c041514bce
@ -23,6 +23,8 @@ export const Provider = ({ children, page, data, viewer }) => {
|
||||
viewer,
|
||||
});
|
||||
|
||||
useEventListener({ type: "open-upload-jumper", handler: showUploadJumper });
|
||||
|
||||
const providerValue = React.useMemo(
|
||||
() => [
|
||||
{ ...uploadState, isUploadJumperVisible },
|
||||
|
@ -32,13 +32,12 @@ const Root = ({ children, data }) => {
|
||||
* -----------------------------------------------------------------------------------------------*/
|
||||
|
||||
const Trigger = ({ viewer, css, children, ...props }) => {
|
||||
const [, { showUploadJumper }] = useUploadContext();
|
||||
const showUploadModal = () => {
|
||||
if (!viewer) {
|
||||
Events.dispatchCustomEvent({ name: "slate-global-open-cta", detail: {} });
|
||||
return;
|
||||
}
|
||||
showUploadJumper();
|
||||
Events.dispatchCustomEvent({ name: "open-upload-jumper" });
|
||||
};
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user