From 2feb7b6feb48df5d485b4ede28606245a5c7cbec Mon Sep 17 00:00:00 2001 From: RetricSu Date: Sun, 9 Oct 2022 09:28:42 +0800 Subject: [PATCH] chore: add wallect icon for connector --- .../src/assets/wallets/imtoken.svg | 9 ++ .../src/assets/wallets/metamask.svg | 19 ++++ .../src/assets/wallets/safepal.svg | 4 + .../src/assets/wallets/wallet-connect.svg | 1 + .../components/WalletConnect/connector.tsx | 94 +++++++++++++------ .../src/components/WalletConnect/index.tsx | 6 +- 6 files changed, 99 insertions(+), 34 deletions(-) create mode 100644 apps/godwoken-bridge/src/assets/wallets/imtoken.svg create mode 100644 apps/godwoken-bridge/src/assets/wallets/metamask.svg create mode 100644 apps/godwoken-bridge/src/assets/wallets/safepal.svg create mode 100644 apps/godwoken-bridge/src/assets/wallets/wallet-connect.svg diff --git a/apps/godwoken-bridge/src/assets/wallets/imtoken.svg b/apps/godwoken-bridge/src/assets/wallets/imtoken.svg new file mode 100644 index 00000000..d6561000 --- /dev/null +++ b/apps/godwoken-bridge/src/assets/wallets/imtoken.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/apps/godwoken-bridge/src/assets/wallets/metamask.svg b/apps/godwoken-bridge/src/assets/wallets/metamask.svg new file mode 100644 index 00000000..162f8a2f --- /dev/null +++ b/apps/godwoken-bridge/src/assets/wallets/metamask.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/apps/godwoken-bridge/src/assets/wallets/safepal.svg b/apps/godwoken-bridge/src/assets/wallets/safepal.svg new file mode 100644 index 00000000..9840ad15 --- /dev/null +++ b/apps/godwoken-bridge/src/assets/wallets/safepal.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/godwoken-bridge/src/assets/wallets/wallet-connect.svg b/apps/godwoken-bridge/src/assets/wallets/wallet-connect.svg new file mode 100644 index 00000000..2c5d4949 --- /dev/null +++ b/apps/godwoken-bridge/src/assets/wallets/wallet-connect.svg @@ -0,0 +1 @@ + diff --git a/apps/godwoken-bridge/src/components/WalletConnect/connector.tsx b/apps/godwoken-bridge/src/components/WalletConnect/connector.tsx index 479e8940..b6ce8cee 100644 --- a/apps/godwoken-bridge/src/components/WalletConnect/connector.tsx +++ b/apps/godwoken-bridge/src/components/WalletConnect/connector.tsx @@ -1,31 +1,45 @@ import React, { useEffect } from "react"; import styled from "styled-components"; import { COLOR } from "../../style/variables"; -import { SecondeButton } from "../../style/common"; -import { URI_AVAILABLE } from "@web3-react/walletconnect"; -import { Popover } from "antd"; +import { ConfirmModal } from "../../style/common"; import { connectors } from "./connectors"; +import { ReactComponent as MetaMaskIcon } from "../../assets/wallets/metamask.svg"; +import { ReactComponent as WalletConnectIcon } from "../../assets/wallets/wallet-connect.svg"; +import { ReactComponent as ImTokenIcon } from "../../assets/wallets/imtoken.svg"; +import { ReactComponent as SafePalIcon } from "../../assets/wallets/safepal.svg"; const StyleWrapper = styled.div` + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; +`; + +const WalletBoxWrapper = styled.div` display: flex; flex-direction: column; - > a, - > button { + width: 150px; + height: 100px; + color: ${COLOR.primary}; + text-decoration: none; + cursor: pointer; + padding: 0 10px; + border-radius: 8px; + margin: 10px 10px; + text-align: center; + line-height: 33px; + font-size: 14px; + font-weight: bold; + &:hover { + background: rgba(0, 0, 0, 0.1); + color: ${COLOR.primary}; + } + > svg { + width: 120px; + height: 80px; + } + .title { color: ${COLOR.primary}; - text-decoration: none; - cursor: pointer; - height: 33px; - padding: 0 10px; - border-radius: 8px; - margin: 4px 0px; - text-align: center; - line-height: 33px; - font-size: 14px; - font-weight: bold; - &:hover { - background: rgba(0, 0, 0, 0.1); - color: ${COLOR.primary}; - } } `; @@ -59,20 +73,35 @@ export const SelectMenu: React.FC = ({ handleClick }) => { return ( - Metamask - ImToken - SafePal - WalletConnect + + +
Metamask
+
+ + + +
ImToken
+
+ + + +
SafePal
+
+ + + +
WalletConnect
+
); }; -type ConnectorPopoverProps = { +type ConnectorModalProps = { connectBtnQuerySelector: string; popoverVisible: boolean; setPopoverVisible: (v: boolean) => void; }; -export const ConnectorPopover: React.FC = ({ +export const ConnectorModal: React.FC = ({ connectBtnQuerySelector, popoverVisible, setPopoverVisible, @@ -91,12 +120,15 @@ export const ConnectorPopover: React.FC = ({ }); return ( - } - trigger="click" - overlayClassName="popover-menu" + + onOk={closeSelectMenu} + onCancel={closeSelectMenu} + footer={null} + width={400} + > + + ); }; diff --git a/apps/godwoken-bridge/src/components/WalletConnect/index.tsx b/apps/godwoken-bridge/src/components/WalletConnect/index.tsx index 41bda2b1..9e300cbc 100644 --- a/apps/godwoken-bridge/src/components/WalletConnect/index.tsx +++ b/apps/godwoken-bridge/src/components/WalletConnect/index.tsx @@ -5,7 +5,7 @@ import { useLightGodwoken } from "../../hooks/useLightGodwoken"; import React, { useEffect, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; import { availableVersions } from "../../utils/environment"; -import { ConnectorPopover } from "./connector"; +import { ConnectorModal } from "./connector"; import { connectors } from "./connectors"; import { URI_AVAILABLE } from "@web3-react/walletconnect"; @@ -79,11 +79,11 @@ export const WalletConnect: React.FC = () => { Connect - + > ); };