Skip to content

Commit

Permalink
tsx fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed May 18, 2023
1 parent 7187d16 commit 9923b43
Show file tree
Hide file tree
Showing 172 changed files with 2,264 additions and 1,042 deletions.
1 change: 1 addition & 0 deletions packages/explorer-ui/apollo-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const link = new HttpLink({
const client = new ApolloClient({
link,
cache: new InMemoryCache(),
// @ts-expect-error TS(2345): Argument of type '{ link: HttpLink; cache: InMemor... Remove this comment to see the full error message
fetchPolicy: 'network-only',
fetchOptions: {
mode: 'no-cors',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import _ from 'lodash'

import { Table } from '@components/TransactionTable/Table'
import { StyleAddress } from "@components/misc/StyleAddress";
import { IconAndAmount } from "@components/misc/IconAndAmount";
import { ChainInfo } from "@components/misc/ChainInfo";
import { timeAgo } from "@utils/timeAgo";
import { getBridgeTransactionUrl } from "@urls";
import { ellipsizeString } from "@utils/ellipsizeString";

export function BridgeTransactionTable({ queryResult }) {
const handlePending = (date) => {
let now = new Date().getTime()
let timeDiff = now - date *1000
if (timeDiff > 86400000) {
// @ts-expect-error TS(2304): Cannot find name 'p'.
return <p>Indexing</p>
} else {
// @ts-expect-error TS(2304): Cannot find name 'p'.
return <p>Pending</p>
}

}
let headers = [
'Initial',
'Final',
'Origin',
'Destination',
'From',
'To',
'Age',
'TXID'
]


let tableRows = []
queryResult?.map((txn) => {
const { kappa, pending, fromInfo, toInfo } = txn

let items = [

// @ts-expect-error TS(2749): 'IconAndAmount' refers to a value, but is being us... Remove this comment to see the full error message
<IconAndAmount
// @ts-expect-error TS(2304): Cannot find name 'formattedValue'.
formattedValue={fromInfo.formattedValue}
// @ts-expect-error TS(2304): Cannot find name 'tokenAddress'.
tokenAddress={fromInfo.tokenAddress}
// @ts-expect-error TS(2304): Cannot find name 'chainId'.
chainId={fromInfo.chainID}
// @ts-expect-error TS(2304): Cannot find name 'tokenSymbol'.
tokenSymbol={fromInfo.tokenSymbol}
// @ts-expect-error TS(2304): Cannot find name 'iconSize'.
iconSize="w-4 h-4"
// @ts-expect-error TS(2304): Cannot find name 'textSize'.
textSize="text-sm"
// @ts-expect-error TS(2304): Cannot find name 'styledCoin'.
styledCoin={true}
/>,
pending ? handlePending(fromInfo.time) :
// @ts-expect-error TS(2749): 'IconAndAmount' refers to a value, but is being us... Remove this comment to see the full error message
<IconAndAmount
// @ts-expect-error TS(2304): Cannot find name 'formattedValue'.
formattedValue={toInfo.formattedValue}
// @ts-expect-error TS(2304): Cannot find name 'tokenAddress'.
tokenAddress={toInfo.tokenAddress}
// @ts-expect-error TS(2304): Cannot find name 'chainId'.
chainId={toInfo.chainID}
// @ts-expect-error TS(2304): Cannot find name 'tokenSymbol'.
tokenSymbol={toInfo.tokenSymbol}
// @ts-expect-error TS(2304): Cannot find name 'iconSize'.
iconSize="w-4 h-4"
// @ts-expect-error TS(2304): Cannot find name 'textSize'.
textSize="text-sm"
// @ts-expect-error TS(2304): Cannot find name 'styledCoin'.
styledCoin={true}
/>,
// @ts-expect-error TS(2749): 'ChainInfo' refers to a value, but is being used a... Remove this comment to see the full error message
<ChainInfo
// @ts-expect-error TS(2304): Cannot find name 'chainId'.
chainId={fromInfo.chainID}
// @ts-expect-error TS(2304): Cannot find name 'imgClassName'.
imgClassName="w-6 h-6 rounded-full"
// @ts-expect-error TS(2304): Cannot find name 'txHash'.
txHash={fromInfo.hash}
// @ts-expect-error TS(2304): Cannot find name 'useExplorerLink'.
useExplorerLink={false}

/>,
// @ts-expect-error TS(2749): 'ChainInfo' refers to a value, but is being used a... Remove this comment to see the full error message
pending ? <ChainInfo
// @ts-expect-error TS(2304): Cannot find name 'chainId'.
chainId={fromInfo.destinationChainID}
// @ts-expect-error TS(2304): Cannot find name 'imgClassName'.
imgClassName="w-6 h-6 rounded-full"
// @ts-expect-error TS(2304): Cannot find name 'txHash'.
txHash={""}
// @ts-expect-error TS(2304): Cannot find name 'useExplorerLink'.
useExplorerLink={false}

/> :
// @ts-expect-error TS(2749): 'ChainInfo' refers to a value, but is being used a... Remove this comment to see the full error message
<ChainInfo
// @ts-expect-error TS(2304): Cannot find name 'chainId'.
chainId={toInfo.chainID}
// @ts-expect-error TS(2304): Cannot find name 'imgClassName'.
imgClassName="w-6 h-6 rounded-full"
// @ts-expect-error TS(2304): Cannot find name 'txHash'.
txHash={toInfo.hash}
// @ts-expect-error TS(2304): Cannot find name 'useExplorerLink'.
useExplorerLink={false}

/>,
// @ts-expect-error TS(2749): 'StyleAddress' refers to a value, but is being use... Remove this comment to see the full error message
<StyleAddress sourceInfo={fromInfo} />,
pending ? handlePending(fromInfo.time) :
// @ts-expect-error TS(2749): 'StyleAddress' refers to a value, but is being use... Remove this comment to see the full error message
<StyleAddress sourceInfo={toInfo} />,
fromInfo.time
? timeAgo({ timestamp: fromInfo.time })
: timeAgo({ timestamp: toInfo?.time }),
// @ts-expect-error TS(2304): Cannot find name 'a'.
<a
// @ts-expect-error TS(2304): Cannot find name 'className'.
className="underline transition ease-out hover:text-[#8FEBFF]"
// @ts-expect-error TS(2304): Cannot find name 'href'.
href={getBridgeTransactionUrl({
hash: txn.kappa,
chainIdFrom: txn.fromInfo.chainID,
chainIdTo: txn.toInfo?.chainID,
})}
>
{ellipsizeString({ string: txn.kappa, limiter: 4 })}
</a>
]

let row = {
// @ts-expect-error TS(18004): No value exists in scope for the shorthand propert... Remove this comment to see the full error message
items,
// @ts-expect-error TS(2304): Cannot find name 'kappa'.
key: kappa
}
// @ts-expect-error TS(2304): Cannot find name 'tableRows'.
tableRows.push(row);
})
return (
// @ts-expect-error TS(2304): Cannot find name 'body'.
<Table header={headers} body={tableRows} />
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ export function Chart({ data }) {
if (data) {
const numbers = normalize(data)
return (
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div className="flex flex-col items-center w-full pb-6 rounded-lg shadow-xl sm:p-8">
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div className="flex items-end flex-grow w-full mt-2 content-between">
{numbers.map(({ value, normalizedValue, date }, i) => (
// @ts-expect-error TS(2749): 'BarMaker' refers to a value, but is being used as... Remove this comment to see the full error message
<BarMaker value={value} height={normalizedValue} date={date} key={i} />
))}
</div>
Expand All @@ -19,13 +22,18 @@ function BarMaker({ value, height, date }) {
let showValue = numeral(value).format('0,0')

return (
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div className="relative flex flex-col items-center flex-grow pb-5 ml-1 mr-1 group">
// @ts-expect-error TS(2304): Cannot find name 'span'.
<span className="absolute top-0 z-10 hidden -mt-6 text-xs text-white group-hover:block">
{showValue}
</span>
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div
// @ts-expect-error TS(2304): Cannot find name 'className'.
className={`relative flex justify-center w-full ${h} bg-gradient-to-b from-[#FF00FF] to-[#AC8FFF] hover:opacity-50`}
></div>
// @ts-expect-error TS(2304): Cannot find name 'span'.
<span className='-rotate-45 text-white text-[5px] mt-3 l-0 pr-0'>{date}</span>
</div>
Expand All @@ -34,9 +42,12 @@ function BarMaker({ value, height, date }) {

export function ChartLoading() {
return (
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div className="flex flex-col items-center w-full pb-6 rounded-lg shadow-xl sm:p-8">
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div className="flex items-end flex-grow w-full mt-2 content-between">
{[...Array(30).keys()].map((i) => (
// @ts-expect-error TS(2749): 'BarMakerLoading' refers to a value, but is being ... Remove this comment to see the full error message
<BarMakerLoading key={i} />
))}
</div>
Expand All @@ -46,9 +57,13 @@ export function ChartLoading() {

function BarMakerLoading() {
return (
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div className="relative flex flex-col items-center flex-grow pb-5 ml-1 mr-1 group">
// @ts-expect-error TS(2304): Cannot find name 'div'.
<div
// @ts-expect-error TS(2304): Cannot find name 'className'.
className={`relative flex justify-center w-full h-[200px] animate-pulse bg-gradient-to-b from-slate-700 to-slate-500 hover:opacity-50`}
// @ts-expect-error TS(2365): Operator '<' cannot be applied to types 'boolean' ... Remove this comment to see the full error message
></div>
</div>
)
Expand Down
50 changes: 0 additions & 50 deletions packages/explorer-ui/components/ContainerCard.js

This file was deleted.

Loading

0 comments on commit 9923b43

Please sign in to comment.