diff --git a/packages/react-app/src/App.jsx b/packages/react-app/src/App.jsx
index d14cceac..1720d576 100644
--- a/packages/react-app/src/App.jsx
+++ b/packages/react-app/src/App.jsx
@@ -5,7 +5,7 @@ import WalletLink from "walletlink";
import { Alert, Button } from "antd";
import "antd/dist/antd.css";
import React, { useCallback, useEffect, useState } from "react";
-import { BrowserRouter, Route, Switch } from "react-router-dom";
+import { BrowserRouter, Route, Switch, useHistory } from "react-router-dom";
import Web3Modal from "web3modal";
import "./App.css";
import { Account, Contract, Header, Footer } from "./components";
@@ -21,7 +21,7 @@ import Portis from "@portis/web3";
import Fortmatic from "fortmatic";
import Authereum from "authereum";
-import { Box } from "@chakra-ui/react";
+import { Box, HStack, Flex, Spacer } from "@chakra-ui/react";
import NotConnectedCard from "./components/Cards/NotConnectedCard";
import CenteredFrame from "./components/layout/CenteredFrame";
@@ -115,8 +115,7 @@ const web3Modal = new Web3Modal({
// },
"custom-walletlink": {
display: {
- logo:
- "https://play-lh.googleusercontent.com/PjoJoG27miSglVBXoXrxBSLveV6e3EeBPpNY55aiUUBM9Q1RCETKCOqdOkX2ZydqVf0",
+ logo: "https://play-lh.googleusercontent.com/PjoJoG27miSglVBXoXrxBSLveV6e3EeBPpNY55aiUUBM9Q1RCETKCOqdOkX2ZydqVf0",
name: "Coinbase",
description: "Connect to Coinbase Wallet (not Coinbase App)",
},
@@ -409,23 +408,30 @@ function App(props) {
}, [yourLocalBalance]);
return (
-
- {networkDisplay}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{address && address !== "" ? (
diff --git a/packages/react-app/src/components/Account.jsx b/packages/react-app/src/components/Account.jsx
index 5bed00e7..f63e8089 100644
--- a/packages/react-app/src/components/Account.jsx
+++ b/packages/react-app/src/components/Account.jsx
@@ -1,44 +1,7 @@
-import { Button } from "antd";
import React from "react";
import { useThemeSwitcher } from "react-css-theme-switcher";
-import Address from "./Address";
-import Balance from "./Balance";
-import Wallet from "./Wallet";
-import { Text, Heading, VStack, HStack, Divider as ChDivider, Button as ChButton, Avatar } from "@chakra-ui/react";
-
-/*
- ~ What it does? ~
-
- Displays an Address, Balance, and Wallet as one Account component,
- also allows users to log in to existing accounts and log out
-
- ~ How can I use? ~
-
-
-
- ~ Features ~
-
- - Provide address={address} and get balance corresponding to the given address
- - Provide localProvider={localProvider} to access balance on local network
- - Provide userProvider={userProvider} to display a wallet
- - Provide mainnetProvider={mainnetProvider} and your address will be replaced by ENS name
- (ex. "0xa870" => "user.eth")
- - Provide price={price} of ether and get your balance converted to dollars
- - Provide web3Modal={web3Modal}, loadWeb3Modal={loadWeb3Modal}, logoutOfWeb3Modal={logoutOfWeb3Modal}
- to be able to log in/log out to/from existing accounts
- - Provide blockExplorer={blockExplorer}, click on address and get the link
- (ex. by default "https://etherscan.io/" or for xdai "https://blockscout.com/poa/xdai/")
-*/
+import { Box, Button } from "@chakra-ui/react";
+import { useLookupAddress } from "eth-hooks/dapps/ens";
export default function Account({
address,
@@ -52,30 +15,32 @@ export default function Account({
logoutOfWeb3Modal,
blockExplorer,
}) {
+ const lookup = useLookupAddress(mainnetProvider, address);
+ const ensSplit = lookup?.split(".");
+ const validEnsCheck = ensSplit && ensSplit[ensSplit.length - 1] === "eth";
+
+ let displayAddress = "Loading...";
+
+ if (validEnsCheck) {
+ displayAddress = lookup;
+ } else {
+ displayAddress =
+ address !== undefined
+ ? `${address.substr(0, 5)}...${address.substr(address.length - 6, address.length)}`
+ : "Loading...";
+ }
+
const modalButtons = [];
if (web3Modal) {
if (web3Modal.cachedProvider) {
modalButtons.push(
-
+
+ } size="lg" variant="ghost">
+ Create Party
+
- {cards}
-
+ {cards}
+
);
}
diff --git a/packages/react-app/src/routes/party/Party.jsx b/packages/react-app/src/routes/party/Party.jsx
index 419f8d1c..0286e56e 100644
--- a/packages/react-app/src/routes/party/Party.jsx
+++ b/packages/react-app/src/routes/party/Party.jsx
@@ -1,7 +1,6 @@
import React, { useEffect, useState } from "react";
-import {
- Box,
-} from "@chakra-ui/react";
+import { Button, Box } from "@chakra-ui/react";
+import { ArrowBackIcon } from "@chakra-ui/icons";
import { useParams, useHistory } from "react-router-dom";
import MongoDBController from "../../controllers/mongodbController";
import { Vote, Distribute } from "./components";
@@ -32,24 +31,36 @@ export default function Party({
}, []);
return (
-
-