From 3aab36cb3d1bcbfdf3a4cce2cc08f0b59b1c63ee Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 19 Jan 2025 12:26:32 +0000 Subject: [PATCH] VotingPowerPanel layout fixes [#181] --- .../lp-vaults/LPVotingPowerPage.tsx | 30 +- .../lp-vaults/components/VotingPowerPanel.tsx | 272 +++++++++--------- 2 files changed, 153 insertions(+), 149 deletions(-) diff --git a/src/app/governance/lp-vaults/LPVotingPowerPage.tsx b/src/app/governance/lp-vaults/LPVotingPowerPage.tsx index 6cb88f3..fa6c311 100644 --- a/src/app/governance/lp-vaults/LPVotingPowerPage.tsx +++ b/src/app/governance/lp-vaults/LPVotingPowerPage.tsx @@ -6,6 +6,7 @@ import { VotingPowerPanel } from "./components/VotingPowerPanel"; import { Accordion } from "@radix-ui/react-accordion"; import { getConfig } from "@/chainConfig"; import useLocalStorage from "@/app/core/hooks/useLocalStorage"; +import { PageGrid } from "@/app/governance/components/PageGrid"; export function LPVotingPowerPage() { const { user } = useConnectedUser(); @@ -24,16 +25,15 @@ export function LPVotingPowerPage() { }, [accordionState]); return ( -
-
-
+
+ +
-
- -
-
-
+ + + +

Manage your BREAD LP vaults

Lock LP tokens for voting power within the Breadchain cooperative @@ -48,25 +48,27 @@ export function LPVotingPowerPage() {

-
+ ); } function TitleSection() { return (
-

+

Voting Power LP Vaults

-
-

+

+

This page lets you provide liquidity for BREAD while maintaining your voting power for governing the monthly BREAD crowdstaking yield distribution. By staking your LP tokens into a vault, you still get your voting power as if you are holding BREAD normally.

-

Get Started:

-
    +

    + Get Started: +

    +
    1. Provide Liquidity: Add liquidity for BREAD on the listed liquidity pool of the vault to receive LP tokens. diff --git a/src/app/governance/lp-vaults/components/VotingPowerPanel.tsx b/src/app/governance/lp-vaults/components/VotingPowerPanel.tsx index 4a98f5d..6883c0f 100644 --- a/src/app/governance/lp-vaults/components/VotingPowerPanel.tsx +++ b/src/app/governance/lp-vaults/components/VotingPowerPanel.tsx @@ -46,147 +46,149 @@ export function VotingPowerPanel() { }; return ( -
      - -
      -

      - MY VOTING POWER -

      -
      -
      -
      - {votingPower && - votingPower.bread.status === "success" && - votingPower.butteredBread.status === "success" ? ( - renderFormattedDecimalNumber( - formatBalance( - Number( - votingPower.bread.value + - votingPower.butteredBread.value - ) / - 10 ** 18, - 1 - ), - - ) - ) : ( -
      - - - -
      - )} +
      +
      + +
      +

      + MY VOTING POWER +

      +
      +
      +
      + {votingPower && + votingPower.bread.status === "success" && + votingPower.butteredBread.status === "success" ? ( + renderFormattedDecimalNumber( + formatBalance( + Number( + votingPower.bread.value + + votingPower.butteredBread.value + ) / + 10 ** 18, + 1 + ), + + ) + ) : ( +
      + + - +
      + )} +
      -
      -
      - Accessible voting power - - Your total available voting power for the current voting cycle # - {distributions ? distributions.length + 1 + "." : "-"} - +
      + Accessible voting power + + Your total available voting power for the current voting cycle + #{distributions ? distributions.length + 1 + "." : "-"} + +
      -
      - {/* voting power grid */} -
      - - -

      - Voting power from locked LP -

      - - - {votingPower && votingPower.butteredBread.status === "success" - ? formatBalance( - Number(votingPower.butteredBread.value) / 10 ** 18, - 1 - ) - : "-"} - - -

      - Voting power from $BREAD -

      - - {votingPower && votingPower.bread.status === "success" - ? formatBalance(Number(votingPower.bread.value) / 10 ** 18, 1) - : "-"} - - - -

      - Total locked LP tokens -

      - - - {vaultTokenBalance && - vaultTokenBalance.butter.status === "success" - ? formatBalance( - Number(vaultTokenBalance.butter.value) / 10 ** 18, - 0 - ) - : "-"} - - - {user.status === "CONNECTED" && ( - <> -

      - Total $BREAD baked -

      - - - {BREAD && BREAD.status === "SUCCESS" - ? formatBalance(parseFloat(BREAD.value), 2) - : "-"} - - - )} - - {user.status === "CONNECTED" ? ( - <> - - -

      -

      - Pending voting power - - The voting power you will receive in the next voting - cycle. - -
      -

      - - - - - - ) : ( - <> - )} - - {user.status === "CONNECTED" ? ( - <> - ) : ( -
      - - Connect - + {/* voting power grid */} +
      + + +

      + Voting power from locked LP +

      + + + {votingPower && votingPower.butteredBread.status === "success" + ? formatBalance( + Number(votingPower.butteredBread.value) / 10 ** 18, + 1 + ) + : "-"} + + +

      + Voting power from $BREAD +

      + + {votingPower && votingPower.bread.status === "success" + ? formatBalance(Number(votingPower.bread.value) / 10 ** 18, 1) + : "-"} + + + +

      + Total locked LP tokens +

      + + + {vaultTokenBalance && + vaultTokenBalance.butter.status === "success" + ? formatBalance( + Number(vaultTokenBalance.butter.value) / 10 ** 18, + 0 + ) + : "-"} + + + {user.status === "CONNECTED" && ( + <> +

      + Total $BREAD baked +

      + + + {BREAD && BREAD.status === "SUCCESS" + ? formatBalance(parseFloat(BREAD.value), 2) + : "-"} + + + )} + + {user.status === "CONNECTED" ? ( + <> + + +

      +

      + Pending voting power + + The voting power you will receive in the next voting + cycle. + +
      +

      + + + + + + ) : ( + <> + )} + + {user.status === "CONNECTED" ? ( + <> + ) : ( +
      + + Connect + +
      + )} +
      + + How does this work? +
      +
      - )} +
      - - How does this work? -
      - -
      -
      -
      -
      + +
      ); }