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

Bugfixes/update stats urls #103

Merged
merged 5 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions deploy-web/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
62 changes: 23 additions & 39 deletions deploy-web/src/components/layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode, useState } from "react";
import React, { ReactNode } from "react";
import Box from "@mui/material/Box";
import AppBar from "@mui/material/AppBar";
import Toolbar from "@mui/material/Toolbar";
Expand All @@ -12,11 +12,9 @@ import { WalletStatus } from "./WalletStatus";
import Link from "next/link";
import { UrlService } from "@src/utils/urlUtils";
import { useRouter } from "next/router";
import SearchBar from "./SearchBar";
import { AccountMenu } from "./AccountMenu";
import MenuIcon from "@mui/icons-material/Menu";
import CloseIcon from "@mui/icons-material/Close";
import SearchIcon from "@mui/icons-material/Search";

type Props = {
isMobileOpen: boolean;
Expand Down Expand Up @@ -71,49 +69,36 @@ export const Header: React.FunctionComponent<Props> = ({ children, isMobileOpen,
const { classes } = useStyles();
const router = useRouter();
const smallScreen = useMediaQuery(theme.breakpoints.down("md"));
const [isMobileSearch, setIsMobileSearch] = useState(false);

return (
<AppBar position="fixed" color="default" elevation={0} component="header">
<Toolbar variant="dense" className={classes.accountBar}>
<ErrorBoundary FallbackComponent={ErrorFallback}>
{!isMobileSearch && (
<Box sx={{ display: "flex", alignItems: "center" }}>
<Box href={UrlService.home()} component={Link} sx={{ height: "35px", width: "140px" }}>
<Image
alt="Cloudmos Logo"
src={theme.palette.mode === "dark" ? "/images/cloudmos-logo.png" : "/images/cloudmos-logo-light.png"}
layout="responsive"
quality={100}
width={140}
height={35}
loading="eager"
priority
/>
</Box>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Box href={UrlService.home()} component={Link} sx={{ height: "35px", width: "140px" }}>
<Image
alt="Cloudmos Logo"
src={theme.palette.mode === "dark" ? "/images/cloudmos-logo.png" : "/images/cloudmos-logo-light.png"}
layout="responsive"
quality={100}
width={140}
height={35}
loading="eager"
priority
/>
</Box>
)}

{(isMobileSearch || !smallScreen) && <SearchBar isMobileSearch={isMobileSearch} onSearchClose={() => setIsMobileSearch(false)} />}
</Box>

<Box>
{smallScreen && !isMobileSearch && (
<IconButton color="inherit" aria-label="open drawer" edge="start" onClick={() => setIsMobileSearch(true)} sx={{ display: { md: "none" } }}>
<SearchIcon />
</IconButton>
)}

{!isMobileSearch && (
<IconButton
color="inherit"
aria-label="open drawer"
edge="start"
onClick={handleDrawerToggle}
sx={{ display: { md: "none" }, marginLeft: ".5rem" }}
>
{isMobileOpen ? <CloseIcon /> : <MenuIcon />}
</IconButton>
)}
<IconButton
color="inherit"
aria-label="open drawer"
edge="start"
onClick={handleDrawerToggle}
sx={{ display: { md: "none" }, marginLeft: ".5rem" }}
>
{isMobileOpen ? <CloseIcon /> : <MenuIcon />}
</IconButton>
</Box>

<Box sx={{ maxHeight: `${accountBarHeight}px`, alignItems: "center", display: { xs: "none", sm: "none", md: "flex" } }}>
Expand Down Expand Up @@ -148,4 +133,3 @@ export const Header: React.FunctionComponent<Props> = ({ children, isMobileOpen,
</AppBar>
);
};

191 changes: 0 additions & 191 deletions deploy-web/src/components/layout/SearchBar.tsx

This file was deleted.

7 changes: 6 additions & 1 deletion deploy-web/src/components/layout/WalletStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ export const WalletStatus: React.FunctionComponent<Props> = ({}) => {
<Box sx={{ textAlign: "left", display: "flex", alignItems: "center" }}>
<Box sx={{ fontWeight: "bold", fontSize: ".9rem", display: "flex", alignItems: "center" }}>
<AccountBalanceWalletIcon fontSize="small" sx={{ fontSize: "1rem" }} color="disabled" />
<Box sx={{ marginLeft: ".5rem", lineHeight: ".9rem", cursor: "pointer" }} component={Link} href={UrlService.address(address)}>
<Box
sx={{ marginLeft: ".5rem", lineHeight: ".9rem", cursor: "pointer" }}
component={Link}
target="_blank"
href={`https://stats.akash.network/addresses/${address}`}
>
<CustomTooltip arrow title={<Address address={address} isCopyable />}>
<span>{walletName}</span>
</CustomTooltip>
Expand Down
10 changes: 6 additions & 4 deletions deploy-web/src/components/shared/AddressLink.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { ReactNode } from "react";
import Link from "next/link";
import { UrlService } from "@src/utils/urlUtils";
import { Address } from "./Address";

type Props = {
Expand All @@ -11,15 +10,18 @@ type Props = {

export const AddressLink: React.FunctionComponent<Props> = ({ address, addressBookMode, ...rest }) => {
let href = null;
let target = "_self";
if (address.startsWith("akashvaloper")) {
href = UrlService.validator(address);
href = `https://stats.akash.network/validators/${address}`;
target = "_blank";
} else if (address.startsWith("akash")) {
href = UrlService.address(address);
href = `https://stats.akash.network/addresses/${address}`;
target = "_blank";
}

if (href) {
return (
<Link href={href}>
<Link href={href} target={target}>
<Address address={address} addressBookMode={addressBookMode} disableTruncate />
</Link>
);
Expand Down
3 changes: 1 addition & 2 deletions deploy-web/src/context/WalletProvider/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export function useWallet() {

const TransactionSnackbarContent = ({ snackMessage, transactionHash }) => {
const theme = useTheme();
const txUrl = transactionHash && UrlService.transaction(transactionHash);
const txUrl = transactionHash && `https://stats.akash.network/transactions/${transactionHash}`;

return (
<>
Expand All @@ -355,4 +355,3 @@ const TransactionSnackbarContent = ({ snackMessage, transactionHash }) => {
</>
);
};

9 changes: 4 additions & 5 deletions deploy-web/src/pages/terms-of-service/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ export function TermsOfService() {
These Terms of Use constitute a legally binding agreement made between you, whether personally or on behalf of an entity (&ldquo;you&rdquo;) and
MaxMax Labs Inc. (&quot;Company&quot;, &ldquo;we&rdquo;, &ldquo;us&rdquo;, or &ldquo;our&rdquo;), concerning your access to and use of the
https://cloudmos.io/ website as well as any other media form, media channel, mobile website or mobile application related, linked, or otherwise
connected thereto (collectively, the &ldquo;Site&rdquo;). We are registered in Canada and have our registered office at CP 82027 Terrebonne RPO chemin
gascon, Terrebonne, Quebec J6X 0J8. Our VAT number is 1229169005. You agree that by accessing the Site, you have read, understood, and agree to be
bound by all of these Terms of Use. IF YOU DO NOT AGREE WITH ALL OF THESE TERMS OF USE, THEN YOU ARE EXPRESSLY PROHIBITED FROM USING THE SITE AND YOU
MUST DISCONTINUE USE IMMEDIATELY.
connected thereto (collectively, the &ldquo;Site&rdquo;). P.O. Box 144, 3119 9 Forum Lane, Camana Bay, George Town, Grand Cayman KY1-9006, Cayman
Islands. You agree that by accessing the Site, you have read, understood, and agree to be bound by all of these Terms of Use. IF YOU DO NOT AGREE WITH
ALL OF THESE TERMS OF USE, THEN YOU ARE EXPRESSLY PROHIBITED FROM USING THE SITE AND YOU MUST DISCONTINUE USE IMMEDIATELY.
</p>

<p>
Expand Down Expand Up @@ -574,7 +573,7 @@ export function TermsOfService() {

<p>In order to resolve a complaint regarding the Site or to receive further information regarding use of the Site, please contact us at:</p>

<p>MaxMax Labs Inc. CP 82027 Terrebonne RPO chemin gascon Terrebonne, Quebec J6X 0J8 Canada Phone: (888) 546-3184 [email protected]</p>
<p>P.O. Box 144, 3119 9 Forum Lane, Camana Bay, George Town, Grand Cayman KY1-9006, Cayman Islands. [email protected]</p>
</PageContainer>
</Layout>
);
Expand Down
13 changes: 2 additions & 11 deletions deploy-web/src/utils/urlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,8 @@ export class UrlService {
static faq = (q?: FaqAnchorType) => `/faq${q ? "#" + q : ""}`;
static privacyPolicy = () => "/privacy-policy";
static termsOfService = () => "/terms-of-service";
static blocks = () => `/blocks`;
static block = (height: number) => `/blocks/${height}${appendSearchParams({ network: getSelectedNetworkQueryParam() })}`;
static transactions = () => `/transactions`;
static transaction = (hash: string) => `/transactions/${hash}${appendSearchParams({ network: getSelectedNetworkQueryParam() })}`;
static address = (address: string) => `/addresses/${address}${appendSearchParams({ network: getSelectedNetworkQueryParam() })}`;
static addressTransactions = (address: string) => `/addresses/${address}/transactions`;
static addressDeployments = (address: string) => `/addresses/${address}/deployments`;
static validators = () => "/validators";
static validator = (address: string) => `/validators/${address}${appendSearchParams({ network: getSelectedNetworkQueryParam() })}`;
static proposals = () => "/proposals";
static proposal = (id: number) => `/proposals/${id}`;

// User
static userSettings = () => "/user/settings";
static userAddressBook = () => `/user/settings/address-book`;
static userFavorites = () => `/user/settings/favorites`;
Expand Down
Loading
Loading