UNPKG

@finos/legend-application-marketplace

Version:
38 lines 2.14 kB
import { jsx as _jsx } from "react/jsx-runtime"; /** * Copyright (c) 2020-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { createContext, useContext } from 'react'; import { guaranteeNonNullable } from '@finos/legend-shared'; import { useLocalObservable } from 'mobx-react-lite'; import { ApplicationFrameworkProvider, useApplicationStore, } from '@finos/legend-application'; import { LegendMarketplaceBaseStore, } from '../../stores/LegendMarketplaceBaseStore.js'; export const useLegendMarketplaceApplicationStore = () => useApplicationStore(); const LegendMarketplaceBaseStoreContext = createContext(undefined); const LegendMarketplaceBaseStoreProvider = ({ children }) => { const applicationStore = useLegendMarketplaceApplicationStore(); const baseStore = useLocalObservable(() => new LegendMarketplaceBaseStore(applicationStore)); return (_jsx(LegendMarketplaceBaseStoreContext.Provider, { value: baseStore, children: children })); }; export const useLegendMarketplaceBaseStore = () => guaranteeNonNullable(useContext(LegendMarketplaceBaseStoreContext), `Can't find Legend Marketplace base store in context`); export const LegendMarketplaceFrameworkProvider = ({ children }) => (_jsx(ApplicationFrameworkProvider, { enableTransitions: true, disableVirtualAssistant: true, customFonts: [ '"GS Sans"', 'Roboto', '"Helvetica Neue"', 'Helvetica', 'Arial', 'sans-serif', ].join(','), children: _jsx(LegendMarketplaceBaseStoreProvider, { children: children }) })); //# sourceMappingURL=LegendMarketplaceFrameworkProvider.js.map