Skip to content

Commit

Permalink
chore: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
paintoshi committed Sep 16, 2024
1 parent ceeebce commit c03a0f8
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 128 deletions.
16 changes: 10 additions & 6 deletions Components/SpeedDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ export type SpeedList = {
average: number
}

export type chainConfigType = {
label: string
confirmations: number
contractAddress: `0x${string}`
}

interface SpeedDisplayProps {
txSpeedsState: SpeedList[]
labels: { [key: number]: string }
confirmations: { [key: number]: number }
chainConfig: { [key: number]: chainConfigType }
scrollToLatest: boolean
}

const SpeedDisplay: React.FC<SpeedDisplayProps> = ({
txSpeedsState,
labels,
confirmations,
chainConfig,
scrollToLatest
}) => {
const scrollContainerRef = useRef<HTMLDivElement | null>(null)
Expand Down Expand Up @@ -81,9 +85,9 @@ const SpeedDisplay: React.FC<SpeedDisplayProps> = ({
speedElementsRef.current[x.chainId] = el
}}
>
<TextNormal style={{whiteSpace: 'nowrap'}}>{labels[x.chainId]}</TextNormal>
<TextNormal style={{whiteSpace: 'nowrap'}}>{chainConfig[x.chainId].label}</TextNormal>
<TextNormal style={{whiteSpace: 'nowrap'}} fontSize="12px">
{`Conf: ${confirmations[x.chainId] ?? "N/A"}`}
{`Conf: ${chainConfig[x.chainId].confirmations ?? "N/A"}`}
</TextNormal>
<TextNormal style={{whiteSpace: 'nowrap'}} fontSize="12px">
{x.average > 0 ? `Avg: ${Number((x.average || 0) / 1000).toFixed(1)} s` : 'Avg: -'}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fantom Sonic Tester
# Web3 Speed Checker

Try the speed of the new Fantom FVM
Compare the finality of different EVM networks

### Live at https://speedchecker.paintswap.io

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fantom-sonic-frontend",
"name": "speedchecker-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
Loading

0 comments on commit c03a0f8

Please sign in to comment.