ghost-keychain/packages/extension-ui/src/createView.tsx
Thibaut Sardan 9b33cc579c
Use nunito fonts (#530)
* use nunito

* set to 400 (or remove since 400 is default)

* style.

Co-authored-by: Github Actions <action@github.com>
2020-10-30 09:55:09 +01:00

30 lines
711 B
TypeScript

// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React, { Suspense } from 'react';
import ReactDOM from 'react-dom';
import { HashRouter } from 'react-router-dom';
import { View } from './components';
import './i18n/i18n';
export default function createView (Entry: React.ComponentType, rootId = 'root'): void {
const rootElement = document.getElementById(rootId);
if (!rootElement) {
throw new Error(`Unable to find element with id '${rootId}'`);
}
ReactDOM.render(
<Suspense fallback='...'>
<View>
<HashRouter>
<Entry />
</HashRouter>
</View>
</Suspense>,
rootElement
);
}