From 5142f0c11b38f2282922f5a4986b8699bf049c26 Mon Sep 17 00:00:00 2001 From: Maximilian Schneider Date: Tue, 13 Jul 2021 02:59:53 +0200 Subject: [PATCH] finish rough layout of redeem page --- components/Input.tsx | 2 +- components/RedeemModal.tsx | 38 +++++++++++++++++--- pages/{SalePage.tsx => ContributionPage.tsx} | 4 +-- pages/RedeemPage.tsx | 16 +++++++-- pages/index.tsx | 4 +-- 5 files changed, 53 insertions(+), 11 deletions(-) rename pages/{SalePage.tsx => ContributionPage.tsx} (88%) diff --git a/components/Input.tsx b/components/Input.tsx index 486aec3..c49d8e2 100644 --- a/components/Input.tsx +++ b/components/Input.tsx @@ -1,7 +1,7 @@ interface InputProps { type: string value: any - onChange: (e) => void + onChange?: (e) => void className?: string disabled?: boolean [x: string]: any diff --git a/components/RedeemModal.tsx b/components/RedeemModal.tsx index 9f3e41d..e424061 100644 --- a/components/RedeemModal.tsx +++ b/components/RedeemModal.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react' import { LinkIcon } from '@heroicons/react/solid' import useWalletStore from '../stores/useWalletStore' import Button from './Button' +import Input from './Input' import { ConnectWalletButtonSmall } from './ConnectWalletButton' import Loading from './Loading' import useLargestAccounts from '../hooks/useLargestAccounts' @@ -14,13 +15,12 @@ const RedeemModal = () => { const largestAccounts = useLargestAccounts() const vaults = useVaults() + const totalRaised = vaults.usdc?.balance const redeemableBalance = largestAccounts.redeemable?.balance || 0 const mangoAvailable = vaults.usdc ? (redeemableBalance * vaults.mango.balance) / vaults.usdc.balance : 0 - console.log('balance', redeemableBalance, mangoAvailable) - const [submitting, setSubmitting] = useState(false) const [loading, setLoading] = useState(true) @@ -58,12 +58,12 @@ const RedeemModal = () => { return ( <> -
+
{!submitting ? ( <>

Redeem your MNGO

-

Welcome to the DAO, let's build together.

+ {/*

Welcome to the DAO, let's build together.

*/} ) : null} @@ -80,11 +80,41 @@ const RedeemModal = () => {
) : ( <> +
+ Total raised + +
+
+ Your contribution + +
+
+ Redeemable amount + +