TopBar.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2017-2020 @polkadot/apps authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. // Unused atm, experiment as a replacement for NodeInfo on the SideBar
  5. import React from 'react';
  6. import styled from 'styled-components';
  7. import { BestNumber, Chain, NodeName, NodeVersion } from '@polkadot/react-query';
  8. interface Props {
  9. className?: string;
  10. }
  11. function TopBar ({ className }: Props): React.ReactElement<Props> {
  12. return (
  13. <div className={className}>
  14. <div>
  15. <NodeName />&nbsp;
  16. <NodeVersion label='v' />
  17. </div>
  18. <div>
  19. <Chain />&nbsp;
  20. <BestNumber label='#' />
  21. </div>
  22. </div>
  23. );
  24. }
  25. export default React.memo(styled(TopBar)`
  26. background: #f2f2f2;
  27. font-size: 0.85rem;
  28. line-height: 1rem;
  29. overflow: hidden;
  30. padding: 0.5rem 1rem;
  31. position: fixed;
  32. right: 0;
  33. text-align: right;
  34. text-overflow: ellipsis;
  35. white-space: nowrap;
  36. top: 0;
  37. div {
  38. display: inline-block;
  39. vertical-align: middle;
  40. }
  41. > div {
  42. border-left: 1px solid #ccc;
  43. padding: 0 0.5rem;
  44. &:first-child {
  45. border-width: 0;
  46. }
  47. }
  48. `);