Skip to content

Commit

Permalink
chore: lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hemanthghs committed Nov 2, 2023
1 parent 01e3195 commit 89d0056
Show file tree
Hide file tree
Showing 15 changed files with 1,156 additions and 1,117 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/(routes)/authz/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React from 'react';

const page = () => {
return <div className="page">authz</div>;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/(routes)/feegrant/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import React from 'react';

const page = () => {
return <div className="page">Feegrant</div>
}
return <div className="page">Feegrant</div>;
};

export default page
export default page;
12 changes: 4 additions & 8 deletions frontend/src/app/(routes)/governance/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React from 'react'
import React from 'react';

const page = () => {
return (
<div className='page'>
governance
</div>
)
}
return <div className="page">governance</div>;
};

export default page
export default page;
8 changes: 4 additions & 4 deletions frontend/src/app/(routes)/groups/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import React from 'react';

const page = () => {
return <div className="page space-y-10">Groups</div>
}
return <div className="page space-y-10">Groups</div>;
};

export default page
export default page;
8 changes: 4 additions & 4 deletions frontend/src/app/(routes)/multisig/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import React from 'react';

const page = () => {
return <div className="page">Multisig</div>
}
return <div className="page">Multisig</div>;
};

export default page
export default page;
8 changes: 4 additions & 4 deletions frontend/src/app/(routes)/staking/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import React from 'react';
const page = () => {
return <div>Staking</div>
}
return <div>Staking</div>;
};

export default page
export default page;
2 changes: 1 addition & 1 deletion frontend/src/app/(routes)/transfers/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React from 'react';

const page = () => {
return <div className="page">transfers</div>;
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import PermanentSideBar from "../components/PermanentSidebar";
import { ConnectWalletButton } from "../components/ConnectWalletButton";
import { StoreProvider } from "staking/store/StoreProvider";
import './globals.css';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import PermanentSideBar from '../components/PermanentSidebar';
import { ConnectWalletButton } from '../components/ConnectWalletButton';
import { StoreProvider } from 'staking/store/StoreProvider';

const inter = Inter({ subsets: ["latin"] });
const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: "Resolute",
description: "resolute",
title: 'Resolute',
description: 'resolute',
};

export default function RootLayout({
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import React from 'react';
const OverviewPage = () => {
return <div>Overview</div>
}
return <div>Overview</div>;
};

export default OverviewPage
export default OverviewPage;
66 changes: 33 additions & 33 deletions frontend/src/components/ConnectWalletButton.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
'use client'
import React, { useEffect, useState } from 'react'
import { networks } from '../utils/chainsInfo'
import Image from 'next/image'
import Walletpage from './popups/WalletPage'
import { getWalletName, isConnected } from '../utils/localStorage'
import { useDispatch, useSelector } from 'react-redux'
import { connectWalletV1 } from '../store/features/wallet/walletSlice'
import { AppDispatch, RootState } from '../store/store'
'use client';
import React, { useEffect, useState } from 'react';
import { networks } from '../utils/chainsInfo';
import Image from 'next/image';
import Walletpage from './popups/WalletPage';
import { getWalletName, isConnected } from '../utils/localStorage';
import { useDispatch, useSelector } from 'react-redux';
import { connectWalletV1 } from '../store/features/wallet/walletSlice';
import { AppDispatch, RootState } from '../store/store';

export const ConnectWalletButton = ({
children,
}: {
children: React.ReactNode
children: React.ReactNode;
}) => {
const dispatch = useDispatch<AppDispatch>()
const connected = useSelector((state: RootState) => state.wallet.connected)
const dispatch = useDispatch<AppDispatch>();
const connected = useSelector((state: RootState) => state.wallet.connected);
const [connectWalletDialogOpen, setConnectWalletDialogOpen] =
useState<boolean>(false)
useState<boolean>(false);
const handleClose = () => {
setConnectWalletDialogOpen(
(connectWalletDialogOpen) => !connectWalletDialogOpen
)
}
);
};

const selectWallet = (walletName: string) => {
dispatch(
Expand All @@ -30,9 +30,9 @@ export const ConnectWalletButton = ({
mainnets: networks,
testnets: [],
})
)
handleClose()
}
);
handleClose();
};

const tryConnectWallet = (walletName: string) => {
dispatch(
Expand All @@ -41,34 +41,34 @@ export const ConnectWalletButton = ({
mainnets: networks,
testnets: [],
})
)
}
);
};

useEffect(() => {
const walletName = getWalletName()
console.log(walletName)
const walletName = getWalletName();
console.log(walletName);

if (isConnected()) {
tryConnectWallet(walletName)
tryConnectWallet(walletName);
}

const accountChangeListener = () => {
setTimeout(() => tryConnectWallet(walletName), 1000)
window.location.reload()
}
setTimeout(() => tryConnectWallet(walletName), 1000);
window.location.reload();
};

window.addEventListener(
`${walletName}_keystorechange`,
accountChangeListener
)
);

return () => {
window.removeEventListener(
`${walletName}_keystorechange`,
accountChangeListener
)
}
})
);
};
});

return connected ? (
<>{children}</>
Expand Down Expand Up @@ -109,7 +109,7 @@ export const ConnectWalletButton = ({
<button
className="connect-wallet-btn"
onClick={() => {
setConnectWalletDialogOpen(true)
setConnectWalletDialogOpen(true);
}}
>
CONNECT WALLET
Expand All @@ -122,5 +122,5 @@ export const ConnectWalletButton = ({
selectWallet={selectWallet}
/>
</div>
)
}
);
};
14 changes: 7 additions & 7 deletions frontend/src/components/popups/WalletPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import Image from "next/image";
import { Dialog, DialogContent } from "@mui/material";
import React from 'react';
import Image from 'next/image';
import { Dialog, DialogContent } from '@mui/material';

const Walletpage = ({
open,
Expand All @@ -17,7 +17,7 @@ const Walletpage = ({
onClose={handleClose}
maxWidth="lg"
className="blur-effect"
PaperProps={{ sx: { borderRadius: "16px", backgroundColor: "#20172F" } }}
PaperProps={{ sx: { borderRadius: '16px', backgroundColor: '#20172F' } }}
>
<DialogContent sx={{ padding: 0 }}>
<div className="custom-box flex-col">
Expand All @@ -31,7 +31,7 @@ const Walletpage = ({
<div
className="wallet"
onClick={() => {
selectWallet("keplr");
selectWallet('keplr');
}}
>
<Image
Expand All @@ -45,7 +45,7 @@ const Walletpage = ({
<div
className="wallet"
onClick={() => {
selectWallet("leap");
selectWallet('leap');
}}
>
<Image
Expand All @@ -59,7 +59,7 @@ const Walletpage = ({
<div
className="wallet"
onClick={() => {
selectWallet("cosmostation");
selectWallet('cosmostation');
}}
>
<Image
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/store/StoreProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
'use client';

import { Provider } from "react-redux";
import { store } from "./store";
import { ReactNode } from "react";
import { Provider } from 'react-redux';
import { store } from './store';
import { ReactNode } from 'react';

interface StoreProviderProps {
children: ReactNode;
Expand Down
Loading

0 comments on commit 89d0056

Please sign in to comment.