* Bump deps * Bumps * Adjust * Adjust * Adjust test imports * Adjust * Re-adjust * Fix frequency package name * Adjust build * Adjust * Fix before import * Adjust * require script * Adjust checks * Linting fixes * Fix json alongside other tests * Move fixup script * Remove main type: "module" * Adjust (some) tests * Adjust chartjs imports * Bump deps * Adjust * Bump deps * Adjust styled imports * Bump deps * Adjust
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
// Copyright 2017-2023 @polkadot/apps authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { BareProps as Props } from '@polkadot/react-components/types';
|
|
|
|
import React from 'react';
|
|
|
|
import { styled } from '@polkadot/react-components';
|
|
import { useApi } from '@polkadot/react-hooks';
|
|
import { NodeName, NodeVersion } from '@polkadot/react-query';
|
|
|
|
import { packageInfo } from '../packageInfo';
|
|
|
|
const uiInfo = `apps v${packageInfo.version.replace('-x', '')}`;
|
|
|
|
function NodeInfo ({ className = '' }: Props): React.ReactElement<Props> {
|
|
const { api, isApiReady } = useApi();
|
|
|
|
return (
|
|
<StyledDiv className={`${className} media--1400 highlight--color-contrast ui--NodeInfo`}>
|
|
{isApiReady && (
|
|
<div className='node'>
|
|
<NodeName />
|
|
<NodeVersion label='v' />
|
|
</div>
|
|
)}
|
|
<div>{api.libraryInfo.replace('@polkadot/', '')}</div>
|
|
<div>{uiInfo}</div>
|
|
</StyledDiv>
|
|
);
|
|
}
|
|
|
|
const StyledDiv = styled.div`
|
|
background: transparent;
|
|
font-size: var(--font-size-tiny);
|
|
line-height: 1.2;
|
|
padding: 0 0 0 1rem;
|
|
text-align: right;
|
|
|
|
> div {
|
|
margin-bottom: -0.125em;
|
|
|
|
> div {
|
|
display: inline-block;
|
|
}
|
|
}
|
|
`;
|
|
|
|
export default React.memo(NodeInfo);
|