UNPKG

@cross-nft-marketplace/auction-house-nft-components

Version:
30 lines (29 loc) 1.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MediaConfiguration = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const auction_house_nft_hooks_1 = require("@cross-nft-marketplace/auction-house-nft-hooks"); const merge_anything_1 = require("merge-anything"); const content_components_1 = require("../content-components"); const MediaContext_1 = require("./MediaContext"); const MediaConfiguration = ({ networkId, style = {}, children, strings = {}, renderers, kIndexer //batchScheduleTimeoutMs, }) => { const superContext = (0, react_1.useContext)(MediaContext_1.MediaContext); const newNetworkId = networkId || superContext.networkId; const newkIndexer = kIndexer || superContext.kIndexer; if (!renderers) { renderers = content_components_1.MediaRendererDefaults; } let newContext = { // TODO(iain): Fix typing style: (0, merge_anything_1.merge)(superContext.style, style), strings: (0, merge_anything_1.merge)(superContext.strings, strings), renderers, networkId: newNetworkId, kIndexer: newkIndexer, }; return ((0, jsx_runtime_1.jsx)(MediaContext_1.MediaContext.Provider, { value: newContext, children: (0, jsx_runtime_1.jsx)(auction_house_nft_hooks_1.NFTFetchConfiguration, { kindexer: newkIndexer, networkId: newNetworkId, children: children }) })); }; exports.MediaConfiguration = MediaConfiguration;