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 <Tip
dropProps={{ align: { left: "right" } }} dropProps={{ align: { left: "right" } }}
content={<TipContent message={blockPropertyDescriptions[e.key]} />} content={<TipContent message={blockPropertyDescriptions[e.key]} />}
plain
> >
<span> <span>
<CircleQuestion size="small" /> <CircleQuestion size="small" />

@ -58,6 +58,7 @@ export const blockPropertyDisplayNames: Record<string, string> = {
}; };
export const blockPropertyDescriptions: Record<string, string> = { export const blockPropertyDescriptions: Record<string, string> = {
shard: 'Shard Number',
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.", "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.", 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"> <Text size="small" weight="bold">
{params.latency.toFixed(2)}s {params.latency.toFixed(2)}s

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save