Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dueka/update header #28

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15,269 changes: 6,699 additions & 8,570 deletions pnpm-lock.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would confirm if the pnpm-lock.yaml is needed, but it would likely be removed from the next commit, the analytics button would be added in the next commit.

Large diffs are not rendered by default.

37 changes: 26 additions & 11 deletions src/components/WalletButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { truncateAddress, useWallet } from "@aptos-labs/wallet-adapter-react";
import { AccountBalanceWalletOutlined as AccountBalanceWalletOutlinedIcon } from "@mui/icons-material";
import { Avatar, Button, Typography } from "@mui/material";
import React, { useState } from "react";
import {truncateAddress, useWallet} from "@aptos-labs/wallet-adapter-react";
// import {AccountBalanceWalletOutlined as AccountBalanceWalletOutlinedIcon} from "@mui/icons-material";
import {Avatar, Button, Typography} from "@mui/material";
import React, {useState} from "react";
import WalletMenu from "./WalletMenu";

type WalletButtonProps = {
Expand All @@ -13,10 +13,10 @@ export default function WalletButton({
handleModalOpen,
handleNavigate,
}: WalletButtonProps): JSX.Element {
const { connected, account, wallet } = useWallet();
const {connected, account, wallet} = useWallet();

const [popoverAnchor, setPopoverAnchor] = useState<HTMLButtonElement | null>(
null
null,
);
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
setPopoverAnchor(event.currentTarget);
Expand All @@ -38,14 +38,24 @@ export default function WalletButton({
variant="contained"
onClick={connected ? handleClick : onConnectWalletClick}
className="wallet-button"
sx={{ borderRadius: "10px" }}
sx={{
borderRadius: "8px 16px 4px 18px",
padding: "8px 24px",
backgroundColor: "#FFD337",
color: "#000",
textTransform: "none",
"&:hover": {
backgroundColor: "#E6BE32",
},
height: "40px",
}}
>
{connected ? (
<>
<Avatar
alt={wallet?.name}
src={wallet?.icon}
sx={{ width: 24, height: 24 }}
sx={{width: 24, height: 24}}
/>
<Typography noWrap ml={2}>
{account?.ansName ||
Expand All @@ -55,8 +65,13 @@ export default function WalletButton({
</>
) : (
<>
<AccountBalanceWalletOutlinedIcon sx={{ marginRight: 1 }} />
<Typography noWrap>Connect Wallet</Typography>
{/* <AccountBalanceWalletOutlinedIcon sx={{marginRight: 1}} /> */}
<Typography
noWrap
sx={{fontWeight: 700, fontSize: "20px", lineHeight: "30.07px"}}
>
Connect Wallet
</Typography>
</>
)}
</Button>
Expand All @@ -67,4 +82,4 @@ export default function WalletButton({
/>
</>
);
}
}
8 changes: 4 additions & 4 deletions src/components/WalletConnector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AnyAptosWallet } from "@aptos-labs/wallet-adapter-react";
import { Breakpoint } from "@mui/material";
import { useState } from "react";
import {AnyAptosWallet} from "@aptos-labs/wallet-adapter-react";
import {Breakpoint} from "@mui/material";
import {useState} from "react";
import WalletButton from "./WalletButton";
import WalletsModal from "./WalletModal";

Expand Down Expand Up @@ -48,4 +48,4 @@ export function WalletConnector({
/>
</>
);
}
}
49 changes: 9 additions & 40 deletions src/pages/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default function Footer() {
return (
<Box
sx={{
background: theme.palette.mode === "dark" ? grey[900] : "white",
color: theme.palette.mode === "dark" ? grey[100] : "rgba(18,22,21,1)",
background: "#FFD337",
color: "#000000",
mt: 8,
}}
>
Expand All @@ -76,11 +76,7 @@ export default function Footer() {
title="Movement Labs"
sx={{mr: {md: 2}}}
>
{theme.palette.mode !== "dark" ? (
<MovementLogoBlack width={50} height={50} />
) : (
<MovementLogoWhite width={50} height={50} />
)}
{/* <MovementLogoBlack width={50} height={50} />{" "} */}
</Link>
<Grid direction="row" padding="0">
<Typography
Expand All @@ -91,45 +87,18 @@ export default function Footer() {
fontFamily:
"space-grotesk-variable, Geneva, Tahoma, Verdana, sans-serif",
},
color: "#000000",
}}
fontSize="0.8rem"
>
© {new Date().getFullYear()}{" "}
{new Date().getFullYear()}{" "}
<Box component="span" sx={{whiteSpace: "nowrap"}}>
Movement Labs
Movement All Rights Reserved
</Box>
</Typography>
{/*<Stack
direction="row"
spacing={1}
justifyContent={{xs: "center", md: "start"}}
>
<Link
color="inherit"
to="https://aptoslabs.com/privacy"
target="_blank"
sx={{
fontSize: "0.8rem",
fontFamily: "space-grotesk-variable, Geneva, Tahoma, Verdana, sans-serif",
}}
>
Privacy
</Link>
<Link
color="inherit"
to="https://aptoslabs.com/terms"
target="_blank"
sx={{
fontSize: "0.8rem",
fontFamily: "space-grotesk-variable, Geneva, Tahoma, Verdana, sans-serif",
}}
>
Terms
</Link>
</Stack>*/}
</Grid>
</Grid>

{/*
<Grid
xs="auto"
sx={{marginLeft: {xs: "0", md: "auto"}}}
Expand All @@ -145,7 +114,7 @@ export default function Footer() {
{socialLinks.map((link) => (
<Grid key={link.title}>
<Link
color="inherit"
color="#000000"
to={link.url}
target="_blank"
rel="noopener noreferrer"
Expand All @@ -158,7 +127,7 @@ export default function Footer() {
</Grid>
))}
</Grid>
</Grid>
</Grid> */}
</Grid>
</Container>
</Box>
Expand Down
28 changes: 13 additions & 15 deletions src/pages/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ export default function Header() {
top: "0",
borderRadius: "0",
backdropFilter: "blur(10px)",
background: "transparent",
...(!inView &&
isDark && {
background: "rgba(18,22,21, 0.85)",
borderBottom: `1px solid ${theme.palette.common}`,
}),
...(!inView &&
!isDark && {
background: "rgba(254,254,254, 0.8)",
borderBottom: `2px solid rgba(18,22,21,0.05)`,
}),
background: "#000000",
// ...(!inView &&
// isDark && {
// background: "rgba(18,22,21, 0.85)",
// borderBottom: `1px solid ${theme.palette.common}`,
// }),
// ...(!inView &&
// !isDark && {
// background: "rgba(254,254,254, 0.8)",
// borderBottom: `2px solid rgba(18,22,21,0.05)`,
// }),
}}
>
<FeatureBar />
Expand Down Expand Up @@ -138,8 +138,7 @@ export default function Header() {
</Link>

<Nav />
<NetworkSelect />
<Button
{/* <Button
onClick={toggleColorMode}
sx={{
width: "30px",
Expand All @@ -155,11 +154,10 @@ export default function Header() {
}}
>
{theme.palette.mode === "light" ? <IconLight /> : <IconDark />}
</Button>
</Button> */}
<NavMobile />
{!isOnMobile && (
<Box sx={{marginLeft: "1rem"}}>

<WalletConnector
networkSupport={state.network_name}
handleNavigate={() =>
Expand Down
14 changes: 9 additions & 5 deletions src/pages/layout/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Box from "@mui/material/Box";
import {useGetInMainnet} from "../../api/hooks/useGetInMainnet";
import {useAugmentToWithGlobalSearchParams} from "../../routing";
import {useGetInTestnet} from "../../api/hooks/useGetInTestnet";
import NetworkSelect from "./NetworkSelect";

function NavButton({
to,
Expand All @@ -28,7 +29,7 @@ function NavButton({
title={title}
style={{
color: "inherit",
fontSize: "1rem",
fontSize: "0.875rem",
fontWeight: isActive ? 700 : undefined,
}}
>
Expand All @@ -48,22 +49,24 @@ export default function Nav() {
sx={{
display: {xs: "none", md: "flex"},
alignItems: "center",
gap: {md: 3, lg: 8},
marginRight: {md: "2rem", lg: "3.5rem"},
gap: {md: 3, lg: 0},
marginRight: {md: "0rem", lg: "0rem"},
}}
>
<NavButton
to="/transactions"
title="View All Transactions"
label="Transactions"
/>
{(inMainnet || inTestnet) && (

{/* {(inMainnet || inTestnet) && (
<NavButton
to="/analytics"
title="View Network Analytics"
label="Analytics"
/>
)}
)} */}

{inMainnet && (
<>
<NavButton
Expand All @@ -75,6 +78,7 @@ export default function Nav() {
)}

<NavButton to="/blocks" title="View Latest Blocks" label="Blocks" />
<NetworkSelect />
</Box>
);
}
7 changes: 5 additions & 2 deletions src/pages/layout/NavMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {useGlobalState} from "../../global-config/GlobalConfig";
import {useWallet} from "@aptos-labs/wallet-adapter-react";
import {sortPetraFirst} from "../../utils";
import {useGetInTestnet} from "../../api/hooks/useGetInTestnet";
import NetworkSelect from "./NetworkSelect";

export default function NavMobile() {
const [menuAnchorEl, setMenuAnchorEl] = useState<null | HTMLElement>(null);
Expand Down Expand Up @@ -85,17 +86,19 @@ export default function NavMobile() {
<MenuItem onClick={() => handleCloseAndNavigate("/transactions")}>
Transactions
</MenuItem>
{(inMainnet || inTestnet) && (
{/* {(inMainnet || inTestnet) && (
<MenuItem onClick={() => handleCloseAndNavigate("/analytics")}>
Analytics
</MenuItem>
)}
)} */}
{/*<MenuItem onClick={() => handleCloseAndNavigate("/validators")}>
Validators
</MenuItem>*/}
<MenuItem onClick={() => handleCloseAndNavigate("/blocks")}>
Blocks
</MenuItem>
<NetworkSelect />

<Divider />
<WalletConnector
networkSupport={state.network_name}
Expand Down
Loading