ghost-portal/packages/app-123code/src/index.tsx
Jaco Greeff b9d6ceb6b1
Some func hooks in 123-code (#1569)
* Some func hooks in 123-code

* Minor cleanups
2019-09-02 21:39:29 +02:00

39 lines
1.3 KiB
TypeScript

// Copyright 2017-2019 @polkadot/app-123code authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
// some types, AppProps for the app and I18nProps to indicate
// translatable strings. Generally the latter is quite "light",
// `t` is inject into props (see the HOC export) and `t('any text')
// does the translation
import { AppProps, I18nProps } from '@polkadot/react-components/types';
// external imports (including those found in the packages/*
// of this repo)
import React, { useState } from 'react';
// local imports and components
import AccountSelector from './AccountSelector';
import SummaryBar from './SummaryBar';
import Transfer from './Transfer';
import translate from './translate';
// define our internal types
interface Props extends AppProps, I18nProps {}
function App ({ className }: Props): React.ReactElement<Props> {
const [accountId, setAccountId] = useState<string | undefined>();
return (
// in all apps, the main wrapper is setup to allow the padding
// and margins inside the application. (Just from a consistent pov)
<main className={className}>
<SummaryBar />
<AccountSelector onChange={setAccountId} />
<Transfer accountId={accountId} />
</main>
);
}
export default translate(App);