* Upgrades * Add & use Output component * Render app in content * Use update @polkadot/dev-react * Add app-toolbox * DRY className concat * Hashing in place * Verify signature operational * Entry updates * Verification operational * Final cleanups before PR * Bump version
39 lines
945 B
JavaScript
39 lines
945 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/src/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);
|