Skip to content

Commit 764f2e0

Browse files
committed
fix next js explorer
1 parent 53e1563 commit 764f2e0

File tree

15 files changed

+275
-401
lines changed

15 files changed

+275
-401
lines changed

explorer-nextjs/app/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React from 'react'
2-
import { Navbar } from './components/Nav/Navbar'
3-
import { Providers } from './providers'
1+
import React from "react";
2+
import { Navbar } from "./components/Nav/Navbar";
3+
import { Providers } from "./providers";
44

5-
const App = ({ children }: { children: React.ReactNode }) => (
5+
const App = ({ children }: { children: any }) => (
66
<Providers>
77
<Navbar>{children}</Navbar>
88
</Providers>
9-
)
9+
);
1010

11-
export { App }
11+
export { App };

explorer-nextjs/app/components/ComponentError.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Typography } from '@mui/material';
2-
import * as React from 'react';
1+
import { Typography } from "@mui/material";
2+
import * as React from "react";
33

4-
export const ComponentError: FCWithChildren<{ text: string }> = ({ text }) => (
4+
export const ComponentError = ({ text }: { text: string }) => (
55
<Typography
6-
sx={{ marginTop: 2, color: 'primary.main', fontSize: 10 }}
6+
sx={{ marginTop: 2, color: "primary.main", fontSize: 10 }}
77
variant="body1"
88
data-testid="delegation-total-amount"
99
>
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
1-
import { Card, CardHeader, CardContent, Typography } from '@mui/material'
2-
import React, { ReactEventHandler } from 'react'
1+
import React, { ReactEventHandler } from "react";
2+
import { Card, CardHeader, CardContent, Typography } from "@mui/material";
33

44
type ContentCardProps = {
5-
title?: React.ReactNode
6-
subtitle?: string
7-
Icon?: React.ReactNode
8-
Action?: React.ReactNode
9-
errorMsg?: string
10-
onClick?: ReactEventHandler
11-
}
5+
title?: React.ReactNode;
6+
subtitle?: string;
7+
Icon?: React.ReactNode;
8+
Action?: React.ReactNode;
9+
errorMsg?: string;
10+
children: React.ReactNode;
11+
onClick?: ReactEventHandler;
12+
};
1213

13-
export const ContentCard: FCWithChildren<ContentCardProps> = ({
14+
export const ContentCard = ({
1415
title,
1516
Icon,
1617
Action,
1718
subtitle,
1819
errorMsg,
1920
children,
2021
onClick,
21-
}) => (
22-
<Card onClick={onClick} sx={{ height: '100%' }}>
22+
}: ContentCardProps) => (
23+
<Card onClick={onClick} sx={{ height: "100%" }}>
2324
{title && (
2425
<CardHeader
25-
title={title || ''}
26+
title={title || ""}
2627
avatar={Icon}
2728
action={Action}
2829
subheader={subtitle}
2930
/>
3031
)}
3132
{children && <CardContent>{children}</CardContent>}
3233
{errorMsg && (
33-
<Typography variant="body2" sx={{ color: 'danger', padding: 2 }}>
34+
<Typography variant="body2" sx={{ color: "danger", padding: 2 }}>
3435
{errorMsg}
3536
</Typography>
3637
)}
3738
</Card>
38-
)
39+
);
Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
1-
import React from 'react'
2-
import Box from '@mui/material/Box'
3-
import MuiLink from '@mui/material/Link'
4-
import Typography from '@mui/material/Typography'
5-
import { useIsMobile } from '../hooks/useIsMobile'
6-
import { NymVpnIcon } from '../icons/NymVpn'
7-
import { Socials } from './Socials'
8-
import Link from 'next/link'
1+
import React from "react";
2+
import Box from "@mui/material/Box";
3+
import MuiLink from "@mui/material/Link";
4+
import Typography from "@mui/material/Typography";
5+
import { useIsMobile } from "../hooks/useIsMobile";
6+
import { NymVpnIcon } from "../icons/NymVpn";
7+
import { Socials } from "./Socials";
8+
import Link from "next/link";
99

1010
export const Footer: FCWithChildren = () => {
11-
const isMobile = useIsMobile()
11+
const isMobile = useIsMobile();
1212

1313
return (
1414
<Box
1515
sx={{
16-
display: 'flex',
17-
flexDirection: 'column',
18-
justifyContent: 'center',
19-
width: '100%',
20-
height: 'auto',
16+
display: "flex",
17+
flexDirection: "column",
18+
justifyContent: "center",
19+
width: "100%",
20+
height: "auto",
21+
bgcolor: "background.default",
2122
mt: 3,
2223
pt: 3,
2324
pb: 3,
2425
}}
2526
>
2627
<Box
2728
sx={{
28-
display: 'flex',
29-
flexDirection: 'row',
30-
width: 'auto',
31-
justifyContent: 'center',
32-
alignItems: 'center',
29+
display: "flex",
30+
flexDirection: "row",
31+
width: "auto",
32+
justifyContent: "center",
33+
alignItems: "center",
3334
mb: 2,
3435
}}
3536
>
@@ -45,12 +46,12 @@ export const Footer: FCWithChildren = () => {
4546
<Typography
4647
sx={{
4748
fontSize: 12,
48-
textAlign: isMobile ? 'center' : 'end',
49-
color: 'nym.muted.onDarkBg',
49+
textAlign: isMobile ? "center" : "end",
50+
color: "nym.muted.onDarkBg",
5051
}}
5152
>
5253
© {new Date().getFullYear()} Nym Technologies SA, all rights reserved
5354
</Typography>
5455
</Box>
55-
)
56-
}
56+
);
57+
};

explorer-nextjs/app/components/Nav/DesktopNav.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type ExpandableButtonType = {
8888
fixDrawerClose?: () => void;
8989
};
9090

91-
export const ExpandableButton: FCWithChildren<ExpandableButtonType> = ({
91+
export const ExpandableButton = ({
9292
title,
9393
url,
9494
drawIsTempOpen,
@@ -101,7 +101,7 @@ export const ExpandableButton: FCWithChildren<ExpandableButtonType> = ({
101101
openDrawer,
102102
closeDrawer,
103103
fixDrawerClose,
104-
}) => {
104+
}: ExpandableButtonType) => {
105105
const { palette } = useTheme();
106106
const pathname = usePathname();
107107
const router = useRouter();
@@ -183,7 +183,7 @@ export const ExpandableButton: FCWithChildren<ExpandableButtonType> = ({
183183
);
184184
};
185185

186-
export const Nav: FCWithChildren = ({ children }) => {
186+
export const Nav = ({ children }: { children: React.ReactNode }) => {
187187
const { environment } = useMainContext();
188188
const [drawerIsOpen, setDrawerToOpen] = React.useState(false);
189189
const [fixedOpen, setFixedOpen] = React.useState(false);
@@ -364,7 +364,7 @@ export const Nav: FCWithChildren = ({ children }) => {
364364
</Drawer>
365365
<Box
366366
style={{ width: `calc(100% - ${drawerWidth}px` }}
367-
sx={{ py: 5, px: 6, mt: 7 }}
367+
sx={{ py: 5, px: 6, mt: 7, bgcolor: "background.default" }}
368368
>
369369
{children}
370370
<Footer />

explorer-nextjs/app/components/Nav/MobileNav.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
Toolbar,
1515
} from "@mui/material";
1616
import { Menu } from "@mui/icons-material";
17-
import { MaintenanceBanner } from "@nymproject/react";
1817
import { useIsMobile } from "@/app/hooks/useIsMobile";
1918
import { MobileDrawerClose } from "@/app/icons/MobileDrawerClose";
2019
import { Footer } from "../Footer";
@@ -23,7 +22,9 @@ import { ConnectKeplrWallet } from "../Wallet/ConnectKeplrWallet";
2322
import { NetworkTitle } from "../NetworkTitle";
2423
import { originalNavOptions } from "@/app/context/nav";
2524

26-
export const MobileNav: FCWithChildren = ({ children }) => {
25+
export const MobileNav: FCWithChildren<{ children: React.ReactNode }> = ({
26+
children,
27+
}) => {
2728
const theme = useTheme();
2829
const [drawerOpen, setDrawerOpen] = React.useState(false);
2930
// Set maintenance banner to false by default to don't display it
@@ -46,10 +47,6 @@ export const MobileNav: FCWithChildren = ({ children }) => {
4647
borderRadius: 0,
4748
}}
4849
>
49-
<MaintenanceBanner
50-
open={openMaintenance}
51-
onClick={() => setOpenMaintenance(false)}
52-
/>
5350
<Toolbar
5451
sx={{
5552
display: "flex",
@@ -126,8 +123,7 @@ export const MobileNav: FCWithChildren = ({ children }) => {
126123
</List>
127124
</Box>
128125
</Drawer>
129-
130-
<Box sx={{ width: "100%", p: 4, mt: 7 }}>
126+
<Box sx={{ width: "100%", p: 4, mt: 7, bgcolor: "background.default" }}>
131127
{children}
132128
<Footer />
133129
</Box>

explorer-nextjs/app/components/Title.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import * as React from 'react';
2-
import { Typography } from '@mui/material';
1+
import * as React from "react";
2+
import { Typography } from "@mui/material";
33

44
export const Title: FCWithChildren<{ text: string }> = ({ text }) => (
55
<Typography
66
variant="h5"
77
sx={{
88
fontWeight: 600,
9+
color: "text.primary",
910
}}
1011
data-testid={text}
1112
>

0 commit comments

Comments
 (0)