From a3e497f410b003861b86e0bf3d2db8b670a1257f Mon Sep 17 00:00:00 2001 From: saml33 Date: Thu, 15 Apr 2021 09:47:13 +1000 Subject: [PATCH] wallet selection --- components/DropMenu.jsx | 2 +- components/TopBar.tsx | 24 ++++++++++++++++++------ components/WalletSelect.tsx | 27 +++++++++++++++++++-------- tailwind.config.js | 14 ++++++++++++++ 4 files changed, 52 insertions(+), 15 deletions(-) diff --git a/components/DropMenu.jsx b/components/DropMenu.jsx index f45771c2..59893bd6 100644 --- a/components/DropMenu.jsx +++ b/components/DropMenu.jsx @@ -13,7 +13,7 @@ const DropMenu = ({ button, buttonClassName, value, onChange, options }) => { {open ? ( {options.map((option) => ( diff --git a/components/TopBar.tsx b/components/TopBar.tsx index d0b24555..9f48d098 100644 --- a/components/TopBar.tsx +++ b/components/TopBar.tsx @@ -14,6 +14,8 @@ import UiLock from './UiLock' import DropMenu from './DropMenu' import { useRouter } from 'next/router' import WalletSelect from './WalletSelect' +import useMangoStore from '../stores/useMangoStore' +import { WALLET_PROVIDERS } from '../hooks/useWallet' const Code = styled.code` border: 1px solid hsla(0, 0%, 39.2%, 0.2); @@ -26,6 +28,9 @@ const TopBar = () => { const { connected, wallet } = useWallet() const [showMenu, setShowMenu] = useState(false) const [isCopied, setIsCopied] = useState(false) + const { providerUrl } = useMangoStore((s) => s.wallet) + + console.log('provider', providerUrl) useEffect(() => { if (isCopied) { @@ -104,18 +109,25 @@ const TopBar = () => { buttonClassName="w-44 h-10 border border-th-primary hover:border-th-fgd-1 rounded-md text-th-primary hover:text-th-fgd-1" /> ) : ( -
+
{!connected && ( -
+
)} diff --git a/components/WalletSelect.tsx b/components/WalletSelect.tsx index 1211f7ce..993a84ee 100644 --- a/components/WalletSelect.tsx +++ b/components/WalletSelect.tsx @@ -1,5 +1,9 @@ import { Menu, Transition } from '@headlessui/react' -import { DotsHorizontalIcon, CheckCircleIcon } from '@heroicons/react/outline' +import { + ChevronDownIcon, + ChevronUpIcon, + CheckCircleIcon, +} from '@heroicons/react/outline' import useMangoStore from '../stores/useMangoStore' import { WALLET_PROVIDERS } from '../hooks/useWallet' @@ -17,8 +21,12 @@ export default function WalletSelect() { {({ open }) => ( <> - - + + {open ? ( + + ) : ( + + )} - {WALLET_PROVIDERS.map(({ name, url }) => ( + {WALLET_PROVIDERS.map(({ name, url, icon }) => ( ))} diff --git a/tailwind.config.js b/tailwind.config.js index cf2ca40a..46116e07 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -94,6 +94,20 @@ module.exports = { 'th-green': 'var(--green)', }, }, + fontSize: { + xxs: '.6rem', + // 'sm': '.875rem', + // 'tiny': '.875rem', + // 'base': '1rem', + // 'lg': '1.125rem', + // 'xl': '1.25rem', + // '2xl': '1.5rem', + // '3xl': '1.875rem', + // '4xl': '2.25rem', + // '5xl': '3rem', + // '6xl': '4rem', + // '7xl': '5rem', + }, }, variants: { extend: {