From 9ccc79b274b7f8d021046cafdedd95049d4a65ae Mon Sep 17 00:00:00 2001 From: Christophe Date: Fri, 13 Oct 2023 15:19:49 +0200 Subject: [PATCH] Cleanup --- package.json | 4 +- src/app/global.css | 4 ++ src/app/tx/[tx]/L2ToL1MsgsDisplay.tsx | 53 ++++++++++++++++----------- src/utils/getL2ToL1Messages.ts | 2 +- src/utils/network.ts | 23 +++++++----- yarn.lock | 4 +- 6 files changed, 54 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index fee9d91..5df559e 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "start": "rm -r .next && next build && next start", "lint": "eslint 'src/**/*.{js,ts,tsx}'", "prettier:format": "yarn prettier './**/*.{js,json,md,ts,tsx,yml}' --write && yarn run lint --fix", - "e2e:open": "env-cmd -f .e2e.env yarn synpress open --configFile synpress.config.ts", - "e2e:run": "env-cmd -f .e2e.env yarn synpress run --configFile synpress.config.ts --browser chrome" + "e2e:open": "NODE_ENV=test env-cmd -f .e2e.env yarn synpress open --configFile synpress.config.ts", + "e2e:run": "NODE_ENV=test env-cmd -f .e2e.env yarn synpress run --configFile synpress.config.ts --browser chrome" }, "browserslist": [ ">0.2%", diff --git a/src/app/global.css b/src/app/global.css index 8e5bff0..fca2166 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -270,3 +270,7 @@ ul { padding-left: 0; margin-top: 0; } + +.redeem-button-container { + text-align: center; +} diff --git a/src/app/tx/[tx]/L2ToL1MsgsDisplay.tsx b/src/app/tx/[tx]/L2ToL1MsgsDisplay.tsx index 1cbf4ad..2190d68 100644 --- a/src/app/tx/[tx]/L2ToL1MsgsDisplay.tsx +++ b/src/app/tx/[tx]/L2ToL1MsgsDisplay.tsx @@ -1,4 +1,5 @@ 'use client'; +import { useState } from 'react'; import { ChainId, supportedL2Networks } from '@/utils/network'; import { L2ToL1MessageData } from '@/types'; import { @@ -47,6 +48,7 @@ type Props = { function L2ToL1MsgsDisplay({ l2ToL1Messages }: Props) { const { chain } = useNetwork(); const { data: signer = null } = useSigner({ chainId: chain?.id }); + const [redeeming, setIsRedeeming] = useState(false); const renderMessage = (l2ToL1Message: L2ToL1MessageDataLike) => { switch (l2ToL1Message.status) { @@ -78,31 +80,40 @@ function L2ToL1MsgsDisplay({ l2ToL1Messages }: Props) { {`To redeem, connect to chain ${l2ToL1Message.l1Network.chainID} (${l2ToL1Message.l1Network.name})`} ) : ( -
+