Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (
<div>
<div>
<h1>Sample Portal ({layout})</h1>
<menu>
</menu></div>
<div>{children}</div>
<div>For more information or the source code check out our GitHub repository.</div>
</div>
);
};
const Portal = createInstance({
availableModules: modules,
requestModules() {
// return fetch('http://localhost:9000/api/pilet')
// .then(res => res.json())
// .then(res => res.items);
return new Promise(resolve => setTimeout(() => resolve([]), 1000));
},
Loader,
routes: {
'/sitemap': Sitemap,
},
});
const App: React.SFC = () => {content => {content}};
render(, document.querySelector('#app'));
return (
<div>
<div>
<h1>Sample Portal ({layout})</h1>
<menu>
</menu></div>
<div>{children}</div>
<div>For more information or the source code check out our GitHub repository.</div>
</div>
);
};
const instance = createInstance({
availablePilets,
extendApi: [
createMenuApi(),
createNotificationsApi(),
createContainersApi(),
createDashboardApi(),
createFeedsApi(),
createFormsApi(),
createSearchApi(),
],
requestPilets() {
// return fetch('http://localhost:9000/api/pilet')
// .then(res => res.json())
// .then(res => res.items);
return new Promise(resolve => setTimeout(() => resolve([]), 1000));
},
export function createPiral(config: PiralConfiguration = {}, settings?: PiralExtSettings) {
return createInstance({
...config,
extendApi: extendPiralApi(settings, config.extendApi),
});
}
export function renderInstance(options: PiralOptions = {}) {
const { routes = {}, selector = '#app', gateway, translations, components } = options;
const origin = getGateway(gateway);
const client = setupGqlClient({
url: origin,
});
const Piral = createInstance({
availableModules: getAvailableModules(),
requestModules() {
return fetch(`${origin}/api/v1/pilet`)
.then(res => res.json())
.then(res => res.items);
},
components,
Loader,
Dashboard,
ErrorInfo,
extendApi(api: PiralCoreApi): PiletApi {
return {
...api,
...createFetchApi({
base: origin,
}),
);
};
const DashboardContainer: React.FC = ({ children }) => <div>{children}</div>;
const Layout: React.FC = ({ children }) => (
<div>
<div>
<h1>Cross Framework Sample</h1>
</div>
<div>{children}</div>
<div>For more information or the source code check out our GitHub repository.</div>
</div>
);
const instance = createInstance({
availablePilets,
extendApi: [
createVueApi(),
createNgApi(),
createNgjsApi(),
createHyperappApi(),
createInfernoApi(),
createPreactApi(),
createLitElApi(),
createMithrilApi(),
createAureliaApi(),
createRiotApi(),
createDashboardApi(),
],
requestPilets() {
return Promise.resolve([]);