mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-12 03:13:24 +01:00
20 lines
No EOL
673 B
JavaScript
20 lines
No EOL
673 B
JavaScript
import React from 'react';
|
|
import {useStream} from "ui/effects";
|
|
import {StreamsContext} from "ui/streamsContext";
|
|
import {SketcherAppContext} from "../../../sketcher/components/SketcherAppContext";
|
|
import {Scope} from "../../../sketcher/components/Scope";
|
|
|
|
export function InplaceSketcher({children}) {
|
|
|
|
const sketcherAppContext = useStream(ctx => ctx.streams.sketcher.sketcherAppContext);
|
|
|
|
if (sketcherAppContext === null) {
|
|
return null;
|
|
}
|
|
|
|
return <SketcherAppContext.Provider value={sketcherAppContext}>
|
|
<StreamsContext.Provider value={sketcherAppContext}>
|
|
<Scope>{children}</Scope>
|
|
</StreamsContext.Provider>
|
|
</SketcherAppContext.Provider>
|
|
} |