* Use @babel 7 * Use @babel 7 * Use custom webpack config * Minify input css * Remove @flow header form webpack.config * Webpack config re-usable * Split with vendor/main bundles * Use hash for main entry, specify chunkHash * Import base postcss config * Hashing uses blake2 * Align number formats * Use contenthash fro extracted css * Format number directly * Split runtime (better caching)
39 lines
941 B
JavaScript
39 lines
941 B
JavaScript
// Copyright 2017-2018 Jaco Greeff
|
|
// This software may be modified and distributed under the terms
|
|
// of the ISC license. See the LICENSE file for details.
|
|
// @flow
|
|
|
|
import type { Location } from 'react-router-dom';
|
|
import type { I18nProps } from '@polkadot/ui-app/types';
|
|
|
|
import './Content.css';
|
|
|
|
import React from 'react';
|
|
import { withRouter } from 'react-router';
|
|
|
|
import classes from '@polkadot/ui-app/util/classes';
|
|
|
|
import routing from '../routing';
|
|
|
|
type Props = I18nProps & {
|
|
location: Location
|
|
};
|
|
|
|
function Content ({ children, className, location, style }: Props): React$Node {
|
|
const app = location.pathname.slice(1) || routing.default;
|
|
const { Component } = routing.routes.find((route) =>
|
|
route && route.name === app
|
|
) || routing.unknown;
|
|
|
|
return (
|
|
<div
|
|
className={classes('apps--Content', className)}
|
|
style={style}
|
|
>
|
|
<Component />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default withRouter(Content);
|