mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-23 14:07:20 +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,
|
viewer,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEventListener({ type: "open-upload-jumper", handler: showUploadJumper });
|
||||||
|
|
||||||
const providerValue = React.useMemo(
|
const providerValue = React.useMemo(
|
||||||
() => [
|
() => [
|
||||||
{ ...uploadState, isUploadJumperVisible },
|
{ ...uploadState, isUploadJumperVisible },
|
||||||
|
@ -32,13 +32,12 @@ const Root = ({ children, data }) => {
|
|||||||
* -----------------------------------------------------------------------------------------------*/
|
* -----------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
const Trigger = ({ viewer, css, children, ...props }) => {
|
const Trigger = ({ viewer, css, children, ...props }) => {
|
||||||
const [, { showUploadJumper }] = useUploadContext();
|
|
||||||
const showUploadModal = () => {
|
const showUploadModal = () => {
|
||||||
if (!viewer) {
|
if (!viewer) {
|
||||||
Events.dispatchCustomEvent({ name: "slate-global-open-cta", detail: {} });
|
Events.dispatchCustomEvent({ name: "slate-global-open-cta", detail: {} });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showUploadJumper();
|
Events.dispatchCustomEvent({ name: "open-upload-jumper" });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user