How to use the @wq/react.usePlugin function in @wq/react

To help you get started, we’ve selected a few @wq/react 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 wq / wq.app / packages / material / src / App.js View on Github external
export default function App() {
    const { theme } = usePlugin('material').config;
    return (
        
            
            
        
    );
}
github wq / wq.app / packages / mapbox / src / components / Map.js View on Github external
export default function Map({ bounds, children, mapProps }) {
    const { ready } = usePlugin('map'),
        Root = useMemo(() => ReactMapboxGl(mapProps || {}), [mapProps]),
        fitBounds = useMemo(() => {
            const [[ymin, xmin], [ymax, xmax]] = bounds;
            return [[xmin, ymin], [xmax, ymax]];
        }, [bounds]),
        state = useMapState(),
        basemap = state && state.basemaps.filter(basemap => basemap.active)[0];

    let style;
    if (basemap && basemap.type === 'vector-tile') {
        style = basemap.url;
    } else {
        style = null;
    }

    return (
github wq / wq.app / packages / leaflet / src / components / Map.js View on Github external
function Ready() {
    const { ready } = usePlugin('map') || {},
        { map } = useLeaflet();
    useEffect(() => {
        ready && map && ready(map);
    }, [ready, map]);
    return null;
}
github wq / wq.app / packages / map / src / hooks.js View on Github external
export function useBasemapComponents() {
    return paramCaseMap(usePlugin('map').config.basemaps);
}
github wq / wq.app / packages / map / src / hooks.js View on Github external
export function useMapConfig() {
    const { config } = usePlugin('map'),
        routeInfo = useRouteInfo(),
        context = useRenderContext();

    return routeMapConf(config, routeInfo, context);
}
github wq / wq.app / packages / map / src / hooks.js View on Github external
export function useOverlayComponents() {
    return paramCaseMap(usePlugin('map').config.overlays);
}