Add TipContent props

pull/198/head
artemkolodko 2 years ago
parent 97db9616c2
commit 3e290e1b9f
  1. 15
      src/pages/AddressPage/tabs/events/Events.tsx
  2. 6
      src/pages/ExportData/index.tsx
  3. 16
      src/pages/tools/CheckHRC/index.tsx

@ -10,6 +10,7 @@ import {
} from "../../../../api/client"; } from "../../../../api/client";
import styled from "styled-components"; import styled from "styled-components";
import { DisplaySignature, parseSuggestedEvent } from "../../../../web3/parseByteCode"; import { DisplaySignature, parseSuggestedEvent } from "../../../../web3/parseByteCode";
import { TipContent } from "../../../../components/ui";
const TopicsContainer = styled.div` const TopicsContainer = styled.div`
text-align: left; text-align: left;
@ -66,12 +67,15 @@ const CenteredContainer = styled.div`
function TxsHashColumn (props: { log: LogWithSignature }) { function TxsHashColumn (props: { log: LogWithSignature }) {
const { log } = props const { log } = props
return <div style={{ width: '140px' }}> return <div style={{ width: '140px' }}>
<Tip content={'Txn Hash'}> <Tip
dropProps={{ align: { bottom: "top" }}}
content={<TipContent showArrow={true} message={'Txn Hash'} />}
>
<Link to={`/tx/${log.transactionHash}`}> <Link to={`/tx/${log.transactionHash}`}>
<LinkText>{log.transactionHash}</LinkText> <LinkText>{log.transactionHash}</LinkText>
</Link> </Link>
</Tip> </Tip>
<Tip content={'Block number'}> <Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Block number'} />}>
<div style={{ display: 'flex', marginTop: '4px' }}> <div style={{ display: 'flex', marginTop: '4px' }}>
#&nbsp; #&nbsp;
<Link to={`/block/${log.blockNumber}`} style={{ display: 'inline-block' }}> <Link to={`/block/${log.blockNumber}`} style={{ display: 'inline-block' }}>
@ -80,7 +84,10 @@ function TxsHashColumn (props: { log: LogWithSignature }) {
</div> </div>
</Tip> </Tip>
{log.timestamp && {log.timestamp &&
<Tip content={dayjs(log.timestamp).format('MMM-DD-YYYY hh:mm:ss a') }> <Tip
dropProps={{ align: { bottom: "top" }}}
content={<TipContent showArrow={true} message={dayjs(log.timestamp).format('MMM-DD-YYYY hh:mm:ss a')} />}
>
<div style={{ marginTop: '4px' }}>{dayjs(log.timestamp).fromNow()}</div> <div style={{ marginTop: '4px' }}>{dayjs(log.timestamp).fromNow()}</div>
</Tip> </Tip>
} }
@ -92,7 +99,7 @@ function TxMethod (props: { log: LogWithSignature }) {
return <div style={{ width: '140px' }}> return <div style={{ width: '140px' }}>
<Text size="12px"> <Text size="12px">
<Tip content={'MethodID'}> <Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'MethodID'} />}>
<NeutralMarker background={"backgroundBack"} width={'100px'}> <NeutralMarker background={"backgroundBack"} width={'100px'}>
<TextEllipsis>{props.log.input.slice(0, 10)}</TextEllipsis> <TextEllipsis>{props.log.input.slice(0, 10)}</TextEllipsis>
</NeutralMarker> </NeutralMarker>

@ -1,6 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { StatusCritical } from "grommet-icons"; import { StatusCritical } from "grommet-icons";
import { Address, BaseContainer, BasePage, Button } from "src/components/ui"; import { Address, BaseContainer, BasePage, Button, TipContent } from "src/components/ui";
import { Heading, DateInput, Box, Spinner, Tip, Text } from "grommet"; import { Heading, DateInput, Box, Spinner, Tip, Text } from "grommet";
import styled from "styled-components"; import styled from "styled-components";
import useQuery from "../../hooks/useQuery"; import useQuery from "../../hooks/useQuery";
@ -118,7 +118,7 @@ export const ExportData = () => {
</Box> </Box>
<FlexWrapper> <FlexWrapper>
<InputContainer> <InputContainer>
<Tip content={<span>Select start date</span>}> <Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Select start date'} />}>
<DateInput <DateInput
{...dateInputProps} {...dateInputProps}
value={dayjs(dateFrom).toISOString()} value={dayjs(dateFrom).toISOString()}
@ -128,7 +128,7 @@ export const ExportData = () => {
</InputContainer> </InputContainer>
<div>to</div> <div>to</div>
<InputContainer> <InputContainer>
<Tip content={<span>Select end date</span>}> <Tip dropProps={{ align: { bottom: "top" }}} content={<TipContent showArrow={true} message={'Select end date'} />}>
<DateInput <DateInput
{...dateInputProps} {...dateInputProps}
value={dayjs(dateTo).toISOString()} value={dayjs(dateTo).toISOString()}

@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { Box, Heading, Select, Spinner, Text, TextArea, TextInput, Tip } from "grommet"; import { Box, Heading, Select, Spinner, Text, TextArea, TextInput, Tip } from "grommet";
import { Alert, StatusGood } from "grommet-icons"; import { Alert, StatusGood } from "grommet-icons";
import { BaseContainer, BasePage } from "../../../components/ui"; import { BaseContainer, BasePage, TipContent } from "../../../components/ui";
import useQuery from "../../../hooks/useQuery"; import useQuery from "../../../hooks/useQuery";
import { getContractsByField } from "../../../api/client"; import { getContractsByField } from "../../../api/client";
import styled from "styled-components"; import styled from "styled-components";
@ -230,8 +230,18 @@ export function CheckHRC() {
{(!isContractLoading && contractAddress) && {(!isContractLoading && contractAddress) &&
<Box justify="center" align="center" margin={'24px 0 0 24px'}> <Box justify="center" align="center" margin={'24px 0 0 24px'}>
{isAllEventsMatched {isAllEventsMatched
? <Tip content={'All events found'}><StatusGood size="medium" color={'successText'} /></Tip> ? <Tip
: <Tip content={'Some events missing'}><Alert size="medium" color={'minorText'} /></Tip>} dropProps={{ align: { bottom: "top" }}}
content={<TipContent showArrow={true} message={'All events found'} />}
>
<StatusGood size="medium" color={'successText'} />
</Tip>
: <Tip
dropProps={{ align: { bottom: "top" }}}
content={<TipContent showArrow={true} message={'Some events missing'} />}
>
<Alert size="medium" color={'minorText'} />
</Tip>}
</Box> </Box>
} }
</Box> </Box>

Loading…
Cancel
Save