-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite Explorer in TS/Add Analytics (#933)
Co-authored-by: Trajan0x <[email protected]> Co-authored-by: Simon <[email protected]>
- Loading branch information
1 parent
66f3dc4
commit b95de3c
Showing
173 changed files
with
3,684 additions
and
47,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Submodule test-data
updated
2 files
+4 −1 | test/bridge/wrappers/swap/CantoSwapWrapper.t.sol | |
+4 −1 | test/bridge/wrappers/swap/LegacyCantoSwapWrapper.t.sol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,8 @@ | |
"typescript": "^4.9.3" | ||
}, | ||
"dependencies": { | ||
"@changesets/cli": "2.22.0" | ||
"@changesets/cli": "2.22.0", | ||
"eslint-plugin-jsx": "^0.1.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: '../../.eslintrc.js', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 0 additions & 107 deletions
107
packages/explorer-ui/components/BridgeTransaction/BridgeTransactionTable.js
This file was deleted.
Oops, something went wrong.
107 changes: 107 additions & 0 deletions
107
packages/explorer-ui/components/BridgeTransaction/BridgeTransactionTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
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) => { | ||
const now = new Date().getTime() | ||
const timeDiff = now - date * 1000 | ||
if (timeDiff > 86400000) { | ||
return <p>Indexing</p> | ||
} else { | ||
return <p>Pending</p> | ||
} | ||
} | ||
const headers = [ | ||
'Initial', | ||
'Final', | ||
'Origin', | ||
'Destination', | ||
'From', | ||
'To', | ||
'Age', | ||
'TXID', | ||
] | ||
|
||
const tableRows = [] | ||
queryResult?.map((txn) => { | ||
const { kappa, pending, fromInfo, toInfo } = txn | ||
|
||
const items = [ | ||
<IconAndAmount | ||
formattedValue={fromInfo.formattedValue} | ||
tokenAddress={fromInfo.tokenAddress} | ||
chainId={fromInfo.chainID} | ||
tokenSymbol={fromInfo.tokenSymbol} | ||
iconSize="w-4 h-4" | ||
textSize="text-sm" | ||
styledCoin={true} | ||
/>, | ||
pending ? ( | ||
handlePending(fromInfo.time) | ||
) : ( | ||
<IconAndAmount | ||
formattedValue={toInfo.formattedValue} | ||
tokenAddress={toInfo.tokenAddress} | ||
chainId={toInfo.chainID} | ||
tokenSymbol={toInfo.tokenSymbol} | ||
iconSize="w-4 h-4" | ||
textSize="text-sm" | ||
styledCoin={true} | ||
/> | ||
), | ||
<ChainInfo | ||
chainId={fromInfo.chainID} | ||
imgClassName="w-6 h-6 rounded-full" | ||
txHash={fromInfo.hash} | ||
useExplorerLink={false} | ||
/>, | ||
pending ? ( | ||
<ChainInfo | ||
chainId={fromInfo.destinationChainID} | ||
imgClassName="w-6 h-6 rounded-full" | ||
txHash={''} | ||
useExplorerLink={false} | ||
/> | ||
) : ( | ||
<ChainInfo | ||
chainId={toInfo.chainID} | ||
imgClassName="w-6 h-6 rounded-full" | ||
txHash={toInfo.hash} | ||
useExplorerLink={false} | ||
/> | ||
), | ||
<StyleAddress sourceInfo={fromInfo} />, | ||
pending ? ( | ||
handlePending(fromInfo.time) | ||
) : ( | ||
<StyleAddress sourceInfo={toInfo} /> | ||
), | ||
fromInfo.time | ||
? timeAgo({ timestamp: fromInfo.time }) | ||
: timeAgo({ timestamp: toInfo?.time }), | ||
<a | ||
className="underline transition ease-out hover:text-[#8FEBFF]" | ||
href={getBridgeTransactionUrl({ | ||
hash: txn.kappa, | ||
chainIdFrom: txn.fromInfo.chainID, | ||
chainIdTo: txn.toInfo?.chainID, | ||
})} | ||
> | ||
{ellipsizeString({ string: txn.kappa, limiter: 4 })} | ||
</a>, | ||
] | ||
|
||
const row = { | ||
items, | ||
key: kappa, | ||
} | ||
tableRows.push(row) | ||
}) | ||
return <Table header={headers} body={tableRows} /> | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.