From 2fb968c90c552e958298b361f8a2516328853b11 Mon Sep 17 00:00:00 2001 From: Doron Zavelevsky Date: Sun, 5 Nov 2023 10:57:11 +0000 Subject: [PATCH] better mobile support --- src/components/button/Button.stories.tsx | 2 +- src/components/button/Button.tsx | 4 +- .../confirm/V3WithdrawConfirmInfo.tsx | 2 +- .../walletConnect/WalletConnectRequest.tsx | 2 +- src/pages/UnsupportedNetwork.tsx | 4 +- src/pages/vote/LegacyVoteCard.tsx | 32 ++++++++++ src/pages/vote/StakedCard.tsx | 10 +-- src/pages/vote/UnstakedCard.tsx | 6 +- src/pages/vote/Vote.tsx | 64 +++---------------- src/pages/vote/VoteBalances.tsx | 2 +- src/pages/vote/VoteCard.tsx | 41 ++++++++++++ src/pages/vote/VoteCardDivided.tsx | 10 ++- tailwind.config.js | 1 + 13 files changed, 108 insertions(+), 72 deletions(-) create mode 100644 src/pages/vote/LegacyVoteCard.tsx create mode 100644 src/pages/vote/VoteCard.tsx diff --git a/src/components/button/Button.stories.tsx b/src/components/button/Button.stories.tsx index a564ee88f..f878bfd56 100644 --- a/src/components/button/Button.stories.tsx +++ b/src/components/button/Button.stories.tsx @@ -71,7 +71,7 @@ export const Playground: ComponentStory = (args) => ( Playground.args = { children: 'Primary Button', variant: ButtonVariant.Primary, - size: ButtonSize.Meduim, + size: ButtonSize.Medium, disabled: false, className: '', }; diff --git a/src/components/button/Button.tsx b/src/components/button/Button.tsx index 55b0b526f..e0588f1af 100644 --- a/src/components/button/Button.tsx +++ b/src/components/button/Button.tsx @@ -12,7 +12,7 @@ export enum ButtonSize { Full, ExtraLarge, Large, - Meduim, + Medium, Small, ExtraSmall, } @@ -45,7 +45,7 @@ const getSizeStyle = (size: ButtonSize) => { return 'w-[428px] h-[53px]'; case ButtonSize.Large: return 'w-[335px] h-[53px]'; - case ButtonSize.Meduim: + case ButtonSize.Medium: return 'w-[266px] h-[47px]'; case ButtonSize.Small: return 'w-[142px] h-[39px]'; diff --git a/src/elements/earn/portfolio/v3/pendingWithdraw/confirm/V3WithdrawConfirmInfo.tsx b/src/elements/earn/portfolio/v3/pendingWithdraw/confirm/V3WithdrawConfirmInfo.tsx index 9c91a774f..d867b92b3 100644 --- a/src/elements/earn/portfolio/v3/pendingWithdraw/confirm/V3WithdrawConfirmInfo.tsx +++ b/src/elements/earn/portfolio/v3/pendingWithdraw/confirm/V3WithdrawConfirmInfo.tsx @@ -22,7 +22,7 @@ export const V3WithdrawConfirmInfo = ({ handleCancelClick }: Props) => { - - How to Vote - - - -
-
- Legacy onchain contract -
- -
- View previous votes and decisions made onchain. -
- - - View Legacy Gov - -
+ + {vbntToken && ( { )} {bntToken && ( = ({ stakeAmount, }) => { return ( -
+
Available Balance
{!account || (govToken && govToken.balance) ? ( diff --git a/src/pages/vote/VoteCard.tsx b/src/pages/vote/VoteCard.tsx new file mode 100644 index 000000000..0819a2026 --- /dev/null +++ b/src/pages/vote/VoteCard.tsx @@ -0,0 +1,41 @@ +import { Button, ButtonSize, ButtonVariant } from 'components/button/Button'; +import { Navigate } from 'components/navigate/Navigate'; +import { openNewTab } from 'utils/pureFunctions'; +import { ReactComponent as IconLink } from 'assets/icons/link.svg'; + +export interface VoteCardProps { + stakedAny: boolean; + className?: string; +} + +export const VoteCard: React.FC = ({ stakedAny, className }) => { + return ( +
+
+ Voting on Bancor DAO +
+ +
+ Voting on Bancor DAO is free as it is using the Snapshot off-chain + infrastructure. Every user can vote on every available proposal and help + shape the future of the Bancor Protocol. +
+
+ + + How to Vote + +
+
+ ); +}; diff --git a/src/pages/vote/VoteCardDivided.tsx b/src/pages/vote/VoteCardDivided.tsx index ec381aa40..905f2998a 100644 --- a/src/pages/vote/VoteCardDivided.tsx +++ b/src/pages/vote/VoteCardDivided.tsx @@ -18,17 +18,21 @@ export const VoteCardDivided: React.FC = ({ // Append TailwindCSS classes to the first child's existing classes const firstChildClasses = childrenArray[0].props.className || ''; const firstChildWithClasses = cloneElement(childrenArray[0], { - className: `flex-1 h-full p-24 ${firstChildClasses}`.trim(), + className: `flex-1 md:h-full lt-md:w-full p-24 ${firstChildClasses}`.trim(), }); // Append TailwindCSS classes to the second child's existing classes const secondChildClasses = childrenArray[1].props.className || ''; const secondChildWithClasses = cloneElement(childrenArray[1], { - className: `flex-none h-full w-[350px] p-24 ${secondChildClasses}`.trim(), + className: + `flex-none md:h-full md:w-[350px] lt-md:w-full p-24 ${secondChildClasses}`.trim(), }); return ( -
+
{firstChildWithClasses} {secondChildWithClasses}
diff --git a/tailwind.config.js b/tailwind.config.js index 4be21cae5..4d26d8e06 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -9,6 +9,7 @@ module.exports = { screens: { sm: '640px', md: '768px', + 'lt-md': { max: '767px' }, // lt-md for "less than md" lg: '1024px', xl: '1280px', '2xl': '1536px',