From 12631b2d40ec93cdb27aef9c0b24b169ddc7092e Mon Sep 17 00:00:00 2001 From: Saad Ahmed Siddiqui Date: Tue, 29 Oct 2024 12:07:22 +0100 Subject: [PATCH] fix: minor design changes --- .../ExplorerTable/ExplorerTable.tsx | 18 ++++------- src/components/ExplorerTable/styles.ts | 1 + src/components/Header/Header.tsx | 32 +++++++------------ src/components/Header/styles.ts | 1 + .../TopBarNetworkConnect.tsx | 6 ++-- src/index.css | 6 ++-- src/pages/ExplorerPage/ExplorerPage.tsx | 8 ++--- 7 files changed, 29 insertions(+), 43 deletions(-) diff --git a/src/components/ExplorerTable/ExplorerTable.tsx b/src/components/ExplorerTable/ExplorerTable.tsx index 738c9d9..836f471 100644 --- a/src/components/ExplorerTable/ExplorerTable.tsx +++ b/src/components/ExplorerTable/ExplorerTable.tsx @@ -2,15 +2,7 @@ import React from "react" import { Table, TableHead, TableCell, TableBody, TableRow, CircularProgress } from "@mui/material" import clsx from "clsx" import { Link } from "react-router-dom" -import { - EnvironmentMetadata, - EvmBridgeConfig, - ExplorerContextState, - ResourceTypes, - SharedConfigDomain, - Transfer, - TransferStatus, -} from "../../types" +import { EnvironmentMetadata, EvmBridgeConfig, ExplorerContextState, ResourceTypes, SharedConfigDomain, Transfer, TransferStatus } from "../../types" import { renderNetworkIcon, renderStatusIcon } from "../../utils/renderUtils" import { filterTransfers, @@ -44,7 +36,7 @@ const ExplorerTable: React.FC = ({ state, domainMetadata }: Explo const { deposit, amount, resource, fromDomainId, toDomainId, id, resourceID, fee, usdValue, timestamp } = transfer let { status } = transfer - if (deposit && deposit.timestamp && status === "pending" && isAfter(Date.now(), add(new Date(deposit.timestamp), {hours: 2}))) { + if (deposit && deposit.timestamp && status === "pending" && isAfter(Date.now(), add(new Date(deposit.timestamp), { hours: 2 }))) { status = "failed" as TransferStatus } @@ -90,7 +82,7 @@ const ExplorerTable: React.FC = ({ state, domainMetadata }: Explo
- + {renderStatusIcon(status, classes)} {displayStatus(status)}
@@ -112,7 +104,9 @@ const ExplorerTable: React.FC = ({ state, domainMetadata }: Explo - {type !== undefined ? formatTransferType(resourceID !== VITE_NATIVE_TOKEN_TRANSFER_RESOURCE_ID ? (type as ResourceTypes) : ResourceTypes.NATIVE) : "-"} + {type !== undefined + ? formatTransferType(resourceID !== VITE_NATIVE_TOKEN_TRANSFER_RESOURCE_ID ? (type as ResourceTypes) : ResourceTypes.NATIVE) + : "-"} diff --git a/src/components/ExplorerTable/styles.ts b/src/components/ExplorerTable/styles.ts index aa6e21c..15b9d3f 100644 --- a/src/components/ExplorerTable/styles.ts +++ b/src/components/ExplorerTable/styles.ts @@ -12,6 +12,7 @@ export const useStyles = makeStyles()(theme => { }, }, row: { + padding: "20px", fontWeight: 400, fontSize: 14, verticalAlign: "middle", diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 52f6015..f0837fe 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -1,33 +1,25 @@ import { AppBar, Box, Container, Toolbar, Typography } from "@mui/material" +import { useStyles } from "./styles" import TopBarNetworkConnect from "../TopBarNetworkComponent" import { useExplorer } from "../../context" -import { useStyles } from "./styles" export default function Header() { const { classes } = useStyles() const explorerContext = useExplorer() const { explorerContextState } = explorerContext + return ( - -
- - logo - - - - Sygma Protocol Explorer - - -
-
-
+ + + logo + + + Sygma Protocol Explorer + + + -
+
) diff --git a/src/components/Header/styles.ts b/src/components/Header/styles.ts index 15b61c6..7209559 100644 --- a/src/components/Header/styles.ts +++ b/src/components/Header/styles.ts @@ -11,6 +11,7 @@ export const useStyles = makeStyles()(theme => { flexDirection: "row", justifyContent: "space-between", marginTop: 25, + marginBottom: 25, }, toolBar: { display: "flex", diff --git a/src/components/TopBarNetworkComponent/TopBarNetworkConnect.tsx b/src/components/TopBarNetworkComponent/TopBarNetworkConnect.tsx index f76626f..388a5c5 100644 --- a/src/components/TopBarNetworkComponent/TopBarNetworkConnect.tsx +++ b/src/components/TopBarNetworkComponent/TopBarNetworkConnect.tsx @@ -68,7 +68,7 @@ export default function TopBarNetworkConnect({ getAccount, getChainId, chainId,
{window.ethereum !== undefined && (!isReady ? ( - ) : ( @@ -82,13 +82,13 @@ export default function TopBarNetworkConnect({ getAccount, getChainId, chainId, borderRadius: 10, }} > - + {currentChainId !== undefined && ( {"native )}
- + {shortenAddress(localAddress!)}
diff --git a/src/index.css b/src/index.css index ec2585e..26c328e 100644 --- a/src/index.css +++ b/src/index.css @@ -1,13 +1,11 @@ body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } diff --git a/src/pages/ExplorerPage/ExplorerPage.tsx b/src/pages/ExplorerPage/ExplorerPage.tsx index c1c94cf..9d59704 100644 --- a/src/pages/ExplorerPage/ExplorerPage.tsx +++ b/src/pages/ExplorerPage/ExplorerPage.tsx @@ -1,5 +1,5 @@ import { useState } from "react" -import { Alert, Button, Container, Paper } from "@mui/material" +import { Alert, Box, Button, Container, Paper } from "@mui/material" import { ethers } from "ethers" import { ExplorerTable } from "../../components" @@ -38,11 +38,11 @@ const ExplorerPage = (): JSX.Element => { return ( -
- -
+