Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/web/src/components/DepositModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { CircleX, Check as CheckIcon } from '@tamagui/lucide-icons'

import { formatNumber } from '@/utils/format';
import Loading from '@/components/Loading';

interface IVoteModal {
isOpen: boolean;
Expand Down Expand Up @@ -81,7 +82,8 @@ export default function DepositModal({
opacity={1}
y={0}
>
<div className='withdraw-main-content'>
<div className='withdraw-main-content relative'>
<Loading isLoading={isVoteLoading} />
<div className='flex justify-between items-center'>
<H3 className='text-lumera-label text-[32px]'>Deposit</H3>
<button className='btn-close-modal cursor-pointer' onClick={() => setOpen(false)}><CircleX /></button>
Expand Down
12 changes: 9 additions & 3 deletions packages/ui/src/screens/GovernanceScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Timer,
CheckCircle,
} from '@tamagui/lucide-icons';
import dayjs from 'dayjs';

import Loading from '@/components/Loading';
import DepositModal from '@/components/DepositModal';
Expand Down Expand Up @@ -162,13 +163,18 @@ export const GovernanceScreen = ({
}

const getControls = (item: IProposal) => {
if (['PROPOSAL_STATUS_FAILED', 'PROPOSAL_STATUS_REJECTED'].includes(item?.status)) {
const now = dayjs();
const expiryDate = dayjs(item.deposit_end_time);
const isExpired = expiryDate.isBefore(now);

if (['PROPOSAL_STATUS_FAILED', 'PROPOSAL_STATUS_REJECTED'].includes(item?.status) || (isExpired && item.status !== 'PROPOSAL_STATUS_VOTING_PERIOD')) {
return null;
}

return (
<div className='btn-blue flex justify-end gap-3'>
<Button onPress={() => handleVotePress(item)}>Vote</Button>
{item.status === 'PROPOSAL_STATUS_VOTING_PERIOD' ?
<Button onPress={() => handleVotePress(item)}>Vote</Button> : null
}
<Button onPress={() => handleDepositClick(item.id)}>Deposit</Button>
</div>
);
Expand Down
11 changes: 7 additions & 4 deletions packages/ui/src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import {
Select,
XStack,
} from 'tamagui'
import { LaptopMinimalCheck, Database, BarChart2, Warehouse, Send } from '@tamagui/lucide-icons'
import { Wallet, CircleX, Check as CheckIcon, ChevronDown } from '@tamagui/lucide-icons'
import { LaptopMinimalCheck, BarChart2, Warehouse, Send } from '@tamagui/lucide-icons'
import { CircleX, Check as CheckIcon, ChevronDown } from '@tamagui/lucide-icons'
import relativeTime from 'dayjs/plugin/relativeTime'

import Loading from '@/components/Loading';
import { ConnectWalletButton } from '@/components/ConnectWallet';
import Skeleton from '@/components/Skeleton';
import { AccountInfoData } from '@/hooks/useAccountInfo'
Expand Down Expand Up @@ -243,7 +244,8 @@ export const VoteModal = ({
opacity={1}
y={0}
>
<div className='vote-main-content'>
<div className='vote-main-content relative'>
<Loading isLoading={isVoteLoading} />
<div className='flex justify-between items-center'>
<H3 className='text-lumera-label text-[32px]'>Vote</H3>
<button className='btn-close-modal cursor-pointer' onClick={() => setOpen(false)}><CircleX /></button>
Expand Down Expand Up @@ -438,7 +440,8 @@ const ClaimableRewardsModal = ({
opacity={1}
y={0}
>
<div className='withdraw-main-content'>
<div className='withdraw-main-content relative'>
<Loading isLoading={isVoteLoading} />
<div className='flex justify-between items-center'>
<H3 className='text-lumera-label text-[32px]'>Withdraw</H3>
<button className='btn-close-modal cursor-pointer' onClick={() => setOpen(false)}><CircleX /></button>
Expand Down