Fix tooltips style

pull/198/head
artemkolodko 2 years ago
parent 45b7f4537c
commit 960e0c2012
  1. 1
      src/components/block/BlockDetails.tsx
  2. 1
      src/components/block/helpers.tsx
  3. 1
      src/components/metrics/index.tsx
  4. 7
      src/components/transaction/TransactionDetails.tsx
  5. 10
      src/components/ui/ONEValue.tsx
  6. 18
      src/components/ui/Tooltip.tsx
  7. 18
      src/pages/AddressPage/AddressDetails.tsx
  8. 1
      src/pages/AddressPage/TokenInfo.tsx
  9. 1
      src/pages/AddressPage/tabs/transactions/columns/transactions.tsx
  10. 3
      src/pages/ERC1155List/ERC1155Table.tsx
  11. 9
      src/pages/ERC20List/ERC20Table.tsx
  12. 3
      src/pages/ERC721List/ERC721Table.tsx

@ -20,7 +20,6 @@ const columns = [
<Tip
dropProps={{ align: { left: "right" } }}
content={<TipContent message={blockPropertyDescriptions[e.key]} />}
plain
>
<span>
<CircleQuestion size="small" />

@ -58,6 +58,7 @@ export const blockPropertyDisplayNames: Record<string, string> = {
};
export const blockPropertyDescriptions: Record<string, string> = {
shard: 'Shard Number',
number:
"Also known as Block Number. The block height, which indicates the length of the blockchain, increases after the addition of the new block.",
hash: "The hash of the block header of the current block.",

@ -311,7 +311,6 @@ function BlockLatency(params: { latency: number; latencyPerBlock: number[] }) {
}
/>
}
plain
>
<Text size="small" weight="bold">
{params.latency.toFixed(2)}s

@ -33,12 +33,13 @@ const getColumns = ({ type = "" }) => [
content={
<TipContent
message={
transactionPropertyDescriptions[e.key + type] ||
transactionPropertyDescriptions[e.key]
<Text size={'small'}>
{transactionPropertyDescriptions[e.key + type] ||
transactionPropertyDescriptions[e.key]}
</Text>
}
/>
}
// plain
>
<span>
<CircleQuestion size="small" />

@ -56,25 +56,25 @@ export const ONEValue = (props: ONEValueProps) => {
</Text>
{USDValue && +price > 0 && !isTodayTransaction && !hideTip && (
<Tip
dropProps={{ align: { left: "right" }, margin: { left: "small" } }}
dropProps={{ align: { bottom: "top" }}}
content={
<TipContent
showArrow={true}
message={
<span>
<Text size={'small'}>
{`Displaying value on ${dayjs(timestamp).format(
"YYYY-MM-DD"
)}. Current value`}{" "}
)}. Current value:`}{" "}
<b>
$
{formatNumber(v * +lastPrice, {
maximumFractionDigits: 2,
})}
</b>
</span>
</Text>
}
/>
}
plain
>
<Text size="small">(${USDValue})</Text>
</Tip>

@ -1,5 +1,5 @@
import React from 'react'
import { Box } from 'grommet'
import { Box, Text } from 'grommet'
import styled from "styled-components";
const ArrowDown = styled(Box)`
@ -12,8 +12,12 @@ const ArrowDown = styled(Box)`
border-top: 8px solid ${(props) => props.theme.global.colors.backgroundTip};
`
export const TipContent = (props: { message: string | JSX.Element }) => (
<Box
export const TipContent = (props: { message: string | JSX.Element, showArrow?: boolean }) => {
let message = props.message
if (typeof message === 'string') {
message = <Text size={'small'}>{message}</Text>
}
return <Box
direction="column"
align="center"
background="backgroundTip"
@ -21,7 +25,9 @@ export const TipContent = (props: { message: string | JSX.Element }) => (
round={{ size: 'xsmall' }}
style={{ position: 'relative', color: 'white', width: 'fit-content' }}
>
<Box>{props.message}</Box>
<ArrowDown border={{ color: '#EFF8FF' }} />
<Box>{message}</Box>
{props.showArrow &&
<ArrowDown border={{ color: '#EFF8FF' }} />
}
</Box>
)
}

@ -262,15 +262,15 @@ const addressPropertyDisplayValues: Record<
formatNumber
/>
<Tip
dropProps={{ align: { left: "right" } }}
dropProps={{ align: { bottom: "top" }}}
content={
<TipContent
message={`last update block height ${formatNumber(
showArrow={true}
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />
@ -283,15 +283,15 @@ const addressPropertyDisplayValues: Record<
<Box direction={"row"}>
<>{formatNumber(+value)}</>
<Tip
dropProps={{ align: { left: "right" } }}
dropProps={{ align: { bottom: "top" }}}
content={
<TipContent
message={`last update block height ${formatNumber(
showArrow={true}
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />
@ -312,15 +312,15 @@ const addressPropertyDisplayValues: Record<
formatNumber
/>
<Tip
dropProps={{ align: { left: "right" } }}
dropProps={{ align: { bottom: "top" }}}
content={
<TipContent
message={`last update block height ${formatNumber(
showArrow={true}
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />

@ -179,7 +179,6 @@ export function TokensInfo(props: { value: Token[] }) {
<Tip
dropProps={{ align: { left: "right" } }}
content={<TipContent message={"Outdated"} />}
plain
>
<span>
<Alert size="small" />

@ -74,6 +74,7 @@ export function getColumns(id: string): ColumnConfig<any>[] {
}
const tipContent = <TipContent
showArrow={true}
message={<Text size={'small'} textAlign={'center'}>{signature}</Text>}
/>

@ -204,12 +204,11 @@ function getColumns(props: any) {
dropProps={{ align: { right: "left" } }}
content={
<TipContent
message={`last update block height ${formatNumber(
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />

@ -180,12 +180,11 @@ function getColumns(props: any) {
dropProps={{ align: { left: "right" } }}
content={
<TipContent
message={`last update block height ${formatNumber(
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />
@ -217,12 +216,11 @@ function getColumns(props: any) {
dropProps={{ align: { right: "left" } }}
content={
<TipContent
message={`last update block height ${formatNumber(
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />
@ -250,12 +248,11 @@ function getColumns(props: any) {
dropProps={{ align: { right: "left" } }}
content={
<TipContent
message={`last update block height ${formatNumber(
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />

@ -191,12 +191,11 @@ function getColumns(props: any) {
dropProps={{ align: { right: "left" } }}
content={
<TipContent
message={`last update block height ${formatNumber(
message={`Last update block height: ${formatNumber(
+data.lastUpdateBlockNumber
)}`}
/>
}
plain
>
<span style={{ marginLeft: "5px" }}>
<CircleQuestion size="small" />

Loading…
Cancel
Save