Skip to content

Commit

Permalink
Cleanup pr
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating committed Nov 28, 2023
1 parent b036405 commit 114a25e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion components/ErrorBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function ErrorBox({ heading, children }: { heading: string; child
<div className="flex-shrink-0">
<XCircleIcon className="h-5 w-5 text-red-400" aria-hidden="true" />
</div>
<div className="ml-3 w-full">
<div className="ml-3 w-full overflow-auto">
<h3 className="text-sm font-medium text-red-800">{heading}</h3>
<div className="mt-2 text-sm text-red-700">{children}</div>
</div>
Expand Down
7 changes: 0 additions & 7 deletions hooks/useEasyWrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ export const useEasyWrite = (
data: writeData,
error: writeError,
isLoading: writeIsLoading,
isSuccess: writeIsSuccess,
write: contractWrite,
status,
} = useContractWrite(config);
console.log('In hook');
console.log(contractWrite);
const {
error: waitError,
data: transactionData,
Expand All @@ -40,7 +36,6 @@ export const useEasyWrite = (
isTransactionDataLoading,
waitError,
});
console.log('Waitint ended');

useEffect(() => {
// The different statuses that we intend to show are:
Expand Down Expand Up @@ -117,7 +112,5 @@ export const useEasyWrite = (
isTransactionDataLoading,
error,
write: contractWrite,
isSuccess: writeIsSuccess,
status,
};
};
11 changes: 1 addition & 10 deletions pages/[id]/bridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ const Bridge = () => {
const {
write: bridgeToL2,
isLoading: bridgeToL2IsLoading,
isSuccess,
error: bridgeToL2Error,
} = useEasyWrite({
enabled:
Expand All @@ -138,12 +137,6 @@ const Bridge = () => {
value: fees?.l1 || BigInt(0),
isCrossChain: true,
});
console.log('Nrp');
console.log(bridgeToL2);
console.log(bridgeToL2IsLoading);
console.log(isSuccess);
console.log(amount);
console.log(isValid);

// 2️⃣ l2 bridge to l1
const {
Expand Down Expand Up @@ -172,8 +165,6 @@ const Bridge = () => {

const handleBridge = () => {
if (bridgeTarget === BridgeTarget.L2) {
console.log('Handle');
console.log(bridgeToL2);
if (!bridgeToL2) throw new Error('bridgeToL2 is not defined');
bridgeToL2();
} else {
Expand Down Expand Up @@ -387,7 +378,7 @@ const Bridge = () => {
disabled={
bridgeTarget === BridgeTarget.L2
? !bridgeToL2 || bridgeToL2IsLoading || !isNonZeroInput || !isValid
: bridgeToL1IsLoading || !isValid
: !bridgeToL1 || bridgeToL1IsLoading || !isNonZeroInput || !isValid
}
>
Bridge to {target.chain.name}
Expand Down

0 comments on commit 114a25e

Please sign in to comment.