-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
306 additions
and
111 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 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 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 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,42 @@ | ||
import { | ||
OptimismIcon, | ||
BaseIcon | ||
} from "utils/chains/icons"; | ||
import { SimIcon } from "components/icons" | ||
|
||
export function ChainCell({chain, iconSize}: {chain: string, iconSize?: number}) { | ||
const size = iconSize || 32; | ||
const sim: boolean = chain.toLowerCase().includes('sim'); | ||
|
||
let icon; | ||
if (chain.toLowerCase().includes('optimism')) { | ||
icon = OptimismIcon(size); | ||
} else if (chain.toLowerCase().includes('base')) { | ||
icon = BaseIcon(size); | ||
} else { | ||
return <span>{chain}</span> | ||
} | ||
|
||
return ( | ||
<div className="relative"> | ||
<div className="opacity-75" title={chain}> | ||
{icon} | ||
</div> | ||
{sim && | ||
<div className="absolute translate-x-[26px] -translate-y-[22px]"> | ||
<SimIcon /> | ||
</div> | ||
} | ||
</div> | ||
); | ||
} | ||
|
||
export function Arrow() { | ||
return ( | ||
<div className="w-full min-w-6 ml-7 relative grid justify-items-end content-center opacity-70"> | ||
<div className="h-[1px] rounded-full w-full bg-fg-light dark:bg-fg-dark"></div> | ||
<div className="h-[1px] rounded-full absolute w-[10px] mt-[15.6px] origin-right rotate-[40deg] bg-fg-light dark:bg-fg-dark"></div> | ||
<div className="h-[1px] rounded-full absolute w-[10px] mt-[15.6px] origin-right -rotate-[40deg] bg-fg-light dark:bg-fg-dark"></div> | ||
</div> | ||
); | ||
} |
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 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 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,31 @@ | ||
import { PacketStates } from "utils/types/packet"; | ||
import { classNames } from "utils/functions"; | ||
|
||
export function StateCell(state: string) { | ||
return ( | ||
<div className={classNames( | ||
state === 'Delivered' | ||
? "bg-emerald-500/60" | ||
: "bg-sky-500/50" | ||
, "flex flex-row w-32 justify-center rounded-xl py-[2.2px]" | ||
)}> | ||
<span className="text-fg-light dark:text-fg-dark mr-[1.5px] mb-[1.5px] font-primary">{state}</span> | ||
</div> | ||
); | ||
} | ||
|
||
export function stateToString (state: PacketStates): string { | ||
switch (state) { | ||
case PacketStates.SENT: | ||
case PacketStates.POLY_RECV: | ||
return 'Relaying'; | ||
case PacketStates.RECV: | ||
case PacketStates.WRITE_ACK: | ||
case PacketStates.POLY_WRITE_ACK: | ||
return 'Confirming'; | ||
case PacketStates.ACK: | ||
return 'Delivered'; | ||
default: | ||
return 'Relaying'; | ||
} | ||
} |
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,7 @@ | ||
export const SimIcon = () => ( | ||
<div | ||
title="Uses sim client" | ||
className="grid justify-items-center content-center w-6 h-6 border-2 border-sky-600 border-dotted rounded-full bg-bg-light dark:bg-bg-dark-accent cursor-default"> | ||
<span className="text-sky-600 font-primary text-xs font-semibold italic mr-[2.5px] mb-[0.3px]">S</span> | ||
</div> | ||
); |
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
Oops, something went wrong.