index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2017-2018 @polkadot/apps authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the ISC license. See the LICENSE file for details.
  4. // @flow
  5. import type { I18nProps } from '@polkadot/ui-app/types';
  6. import type { ApiProps } from '@polkadot/ui-react-rx/types';
  7. import './Connecting.css';
  8. import React from 'react';
  9. import classes from '@polkadot/ui-app/util/classes';
  10. import withApi from '@polkadot/ui-react-rx/with/api';
  11. import translate from '../translate';
  12. type Props = I18nProps & ApiProps;
  13. function Connecting ({ apiConnected, className, style, t }: Props): React$Node {
  14. if (apiConnected) {
  15. return null;
  16. }
  17. return (
  18. <div
  19. className={classes('apps--Connecting', className)}
  20. style={style}
  21. >
  22. <div className='apps--Connecting-text'>
  23. {t('connecting.disconnected', {
  24. defaultValue: 'You are not connected to a node. Ensure that your node is running and that the Websocket endpoint is reachable.'
  25. })}
  26. </div>
  27. </div>
  28. );
  29. }
  30. export default translate(
  31. withApi(Connecting)
  32. );