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/ThemeSwitch.jsx b/components/ThemeSwitch.jsx index 84703bf5..e90d8125 100644 --- a/components/ThemeSwitch.jsx +++ b/components/ThemeSwitch.jsx @@ -26,7 +26,7 @@ const ThemeSwitch = () => { {THEMES.find((t) => t.name === theme).icon} } - buttonClassName="w-10 h-10 flex items-center justify-center hover:text-th-primary rounded-md" + buttonClassName="w-10 h-10 flex items-center justify-center hover:text-th-primary rounded-md focus:outline-none" value={theme} onChange={(theme) => setTheme(theme)} options={THEMES} diff --git a/components/TopBar.tsx b/components/TopBar.tsx index 3a774469..63dc8149 100644 --- a/components/TopBar.tsx +++ b/components/TopBar.tsx @@ -1,6 +1,9 @@ import { useEffect, useState } from 'react' +import { Menu } from '@headlessui/react' import styled from '@emotion/styled' import { + ChevronUpIcon, + ChevronDownIcon, DuplicateIcon, LogoutIcon, MenuIcon, @@ -14,11 +17,14 @@ import DropMenu from './DropMenu' import { useRouter } from 'next/router' import WalletSelect from './WalletSelect' import useMangoStore from '../stores/useMangoStore' +import { WALLET_PROVIDERS, DEFAULT_PROVIDER } from '../hooks/useWallet' +import useLocalStorageState from '../hooks/useLocalStorageState' const Code = styled.code` border: 1px solid hsla(0, 0%, 39.2%, 0.2); border-radius: 3px; background: hsla(0, 0%, 58.8%, 0.1); + font-size: 13px; ` const TopBar = () => { @@ -27,6 +33,10 @@ const TopBar = () => { const wallet = useMangoStore((s) => s.wallet.current) const [showMenu, setShowMenu] = useState(false) const [isCopied, setIsCopied] = useState(false) + const [savedProviderUrl] = useLocalStorageState( + 'walletProvider', + DEFAULT_PROVIDER.url + ) useEffect(() => { if (isCopied) { @@ -84,39 +94,66 @@ const TopBar = () => {
{connected && wallet?.publicKey ? ( - handleWalletMenu(option)} - value={''} - button={ -
- - - {isCopied - ? 'Copied!' - : wallet.publicKey.toString().substr(0, 5) + - '...' + - wallet.publicKey.toString().substr(-5)} - + + {({ open }) => ( +
+ +
+
+ + + {isCopied + ? 'Copied!' + : wallet.publicKey.toString().substr(0, 5) + + '...' + + wallet.publicKey.toString().substr(-5)} + +
+ {open ? ( + + ) : ( + + )} +
+
+ + {WALLET_OPTIONS.map(({ name, icon }) => ( + + + + ))} +
- } - 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/UiLock.tsx b/components/UiLock.tsx index 3afb74ef..d356192a 100644 --- a/components/UiLock.tsx +++ b/components/UiLock.tsx @@ -15,7 +15,7 @@ const UiLock = ({ className = '' }) => {
- - ))} - - +
+ {savedProviderUrl === url ? ( + + ) : null}{' '} + + + ))} + )} diff --git a/styles/index.css b/styles/index.css index aa896f60..48833167 100644 --- a/styles/index.css +++ b/styles/index.css @@ -45,10 +45,6 @@ button { transition: all 0.25s ease; } -button:focus { - outline: none; -} - .TVChartContainer { height: 100%; width: 100%; 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: {