How to use the @webiny/app-admin/components.withSnackbar function in @webiny/app-admin

To help you get started, we’ve selected a few @webiny/app-admin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages / app-page-builder / src / editor / components / OEmbed.js View on Github external
const centerAlign = css({
    "*:first-child": {
        marginLeft: "auto !important",
        marginRight: "auto !important"
    }
});

export default compose(
    shouldUpdate((props, nextProps) => {
        return !isEqual(props, nextProps);
    }),
    connect(
        null,
        { updateElement }
    ),
    withSnackbar(),
    graphql(oembedQuery, {
        skip: ({ element }) => {
            const source = get(element, "data.source") || {};
            const oembed = get(element, "data.oembed") || {};

            return !source.url || isEqual(oembed.source, source);
        },
        options: ({ element, updateElement, showSnackbar, onData = d => d }) => {
            const source = get(element, "data.source") || {};
            return {
                variables: source,
                onCompleted: data => {
                    const { data: oembed, error } = get(data, "pageBuilder.oembedData");
                    if (oembed) {
                        // Store loaded oembed data
                        updateElement({
github webiny / webiny-js / packages / app-admin / src / components / FileManager / FileDetails / Tags.js View on Github external
) : (
                <div>No tags assigned.</div>
            )}
            <div>
                <a> setEdit(true)}&gt;
                     Edit
                </a>
            </div>
        
    );
}

export default compose(
    graphql(updateFileBySrc, { name: "gqlUpdateFileBySrc" }),
    withSnackbar()
)(Tags);
github webiny / webiny-js / packages / app-page-builder / src / editor / plugins / defaultBar / components / PublishPageButton.js View on Github external
)}
                
            )}
        
    );
};

export default compose(
    connect(
        state =&gt; ({ page: omit(getPage(state), ["content"]) }),
        null,
        null,
        { areStatePropsEqual: isEqual }
    ),
    withSnackbar(),
    withRouter
)(PublishPageButton);
github webiny / webiny-js / packages / app-page-builder / src / editor / plugins / defaultBar / components / PageSettings.js View on Github external
)}
                    
                
            
        
    );
};

export default compose(
    connect(
        state =&gt; ({ page: omit(getPage(state), ["content"]) }),
        { deactivatePlugin, updateRevision }
    ),
    withSnackbar(),
    withKeyHandler(),
    withState("active", "setActive", "pb-editor-page-settings-general"),
    withHandlers({
        savePage: ({ showSnackbar, updateRevision }) =&gt; (page: Object) =&gt;
            updateRevision(page, {
                onFinish: () =&gt; showSnackbar("Settings saved")
            })
    }),
    lifecycle({
        componentDidMount() {
            this.props.addKeyHandler("escape", e =&gt; {
                e.preventDefault();
                this.props.deactivatePlugin({ name: "pb-editor-page-settings-bar" });
            });
        },
        componentWillUnmount() {
github webiny / webiny-js / packages / app-forms / src / admin / views / Forms / FormDetails.js View on Github external
"forms-form-details-revision-content",
                                    { refreshForms, form, loading },
                                    { wrapper: false }
                                )}
                            
                        )}
                    
                );
            }}
        
    );
};

export default compose(
    withRouter,
    withSnackbar(),
    withProps(({ location }) =&gt; {
        const query = new URLSearchParams(location.search);
        return { formId: query.get("id"), query };
    })
)(FormDetails);
github webiny / webiny-js / packages / app-admin / src / components / FileManager / FileManagerView.js View on Github external
);
                    }}
                
            )}
        
    );
}

FileManagerView.defaultProps = {
    multiple: false,
    maxSize: "10mb",
    multipleMaxSize: "100mb",
    multipleMaxCount: 100
};

export default compose(withSnackbar())(FileManagerView);
github webiny / webiny-js / packages / app-page-builder / src / admin / views / Pages / PageDetails.js View on Github external
)}
                                    
                                
                            
                        )}
                    
                );
            }}
        
    );
};

export default compose(
    withRouter,
    withSnackbar(),
    withProps(({ location }) =&gt; {
        const query = new URLSearchParams(location.search);
        return { pageId: query.get("id"), query };
    })
)(PageDetails);
github webiny / webiny-js / packages / app-forms / src / admin / components / FormEditor / FormEditor.js View on Github external
if (!data) {
        return null;
    }

    return (
        <div>
            
            
            
        </div>
    );
};

export default compose(
    withRouter,
    withSnackbar(),
    DragDropContext(HTML5Backend)
)(FormEditor);
github webiny / webiny-js / packages / app-forms / src / editor / plugins / defaultBar / PublishFormButton.js View on Github external
showSnackbar(t`Your form was published successfully!`);
                                    }, 500);
                                });
                            }}
                        &gt;
                            {data.version &gt; 1 ? t`Publish changes` : t`Publish`}
                        
                    )}
                
            )}
        
    );
};

export default compose(
    withSnackbar(),
    withRouter
)(PublishFormButton);

@webiny/app-admin

A collection of plugins that together form a complete admin interface, customizable and extensible with Webiny apps and plugins.

MIT
Latest version published 2 days ago

Package Health Score

78 / 100
Full package analysis

Similar packages