From 1bfabb24d970ea3c8fa365951e56457ab83f9cd8 Mon Sep 17 00:00:00 2001 From: saml33 Date: Tue, 26 Sep 2023 14:41:37 +1000 Subject: [PATCH] buy token button on mobile --- components/Layout.tsx | 4 ++-- components/Stake.tsx | 32 +++++++++++++++++++++-------- components/TopBar.tsx | 18 ++++++++++------ components/wallet/ConnectedMenu.tsx | 13 +++++++----- styles/globals.css | 4 ++-- 5 files changed, 48 insertions(+), 23 deletions(-) diff --git a/components/Layout.tsx b/components/Layout.tsx index 6bbf216..2a84e92 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -27,10 +27,10 @@ const Layout = ({ children }: { children: ReactNode }) => { >
-
+
-
+
{children}
diff --git a/components/Stake.tsx b/components/Stake.tsx index d89dad0..cc957d6 100644 --- a/components/Stake.tsx +++ b/components/Stake.tsx @@ -6,12 +6,15 @@ import UnstakeForm from '@components/UnstakeForm' import mangoStore from '@store/mangoStore' import { STAKEABLE_TOKENS } from 'utils/constants' import { formatTokenSymbol } from 'utils/tokens' +import { useViewport } from 'hooks/useViewport' +import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid' const set = mangoStore.getState().set const Stake = () => { const [activeFormTab, setActiveFormTab] = useState('Add') const selectedToken = mangoStore((s) => s.selectedToken) + const { isDesktop } = useViewport() const handleTokenSelect = useCallback((token: string) => { set((state) => { @@ -53,15 +56,28 @@ const Stake = () => {
{activeFormTab === 'Add' ? ( -
- + )}
) : null} diff --git a/components/TopBar.tsx b/components/TopBar.tsx index 9f12509..4611b3a 100644 --- a/components/TopBar.tsx +++ b/components/TopBar.tsx @@ -24,8 +24,8 @@ const TopBar = () => { return (
-
- +
+ Boost! @@ -39,7 +39,7 @@ const TopBar = () => { {connected ? : }
{!isOnline ? ( -
+

Your connection appears to be offline @@ -52,9 +52,15 @@ const TopBar = () => { export default TopBar -const NavLink = ( - { active, path, text }: { active: boolean; path: string; text: string }, -) => { +const NavLink = ({ + active, + path, + text, +}: { + active: boolean + path: string + text: string +}) => { return ( { isDesktop ? 'w-44' : 'w-12' } focus:outline-none`} > -

+
{!mangoAccountLoading ? ( ) : ( -
- +
+
)} {!loadProfileDetails && isDesktop ? ( diff --git a/styles/globals.css b/styles/globals.css index 38cc21f..c26197a 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -295,7 +295,7 @@ table p { } #range-slider-gradient .range-slider__thumb[data-upper] { - @apply h-7 w-4 rounded-full border border-th-primary-3 bg-th-primary-1 shadow-[inset_0_-3px_0px_rgba(0,0,0,0.15)]; + @apply border-th-primary-3 bg-th-primary-1 h-7 w-4 rounded-full border shadow-[inset_0_-3px_0px_rgba(0,0,0,0.15)]; } #range-slider-gradient .range-slider__range { @@ -372,7 +372,7 @@ table p { } .raised-button-primary { - @apply relative bg-th-primary-1 transition-none; + @apply bg-th-primary-1 relative transition-none; box-shadow: 0 4px var(--primary-3); }