Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vidvidvid committed Oct 28, 2024
1 parent f3c55d0 commit b95d15f
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 53 deletions.
5 changes: 5 additions & 0 deletions packages/ui/app/_components/veion/ExtendVeion.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
'use client';

import { useState, useEffect, useMemo } from 'react';

import { format, addDays } from 'date-fns';
import { Calendar as CalendarIcon } from 'lucide-react';

import { Button } from '@ui/components/ui/button';
import { Calendar } from '@ui/components/ui/calendar';
import {
Expand All @@ -18,6 +20,7 @@ import {
} from '@ui/components/ui/popover';
import { Separator } from '@ui/components/ui/separator';
import { Slider } from '@ui/components/ui/slider';

import AutoLock from './AutoLock';
import CustomTooltip from '../CustomTooltip';

Expand All @@ -38,6 +41,8 @@ const ExtendVeion = ({
}: ExtendVeionProps) => {
const [autoLock, setAutoLock] = useState(false);
const [lockDuration, setLockDuration] = useState<string>('180');
// eslint-disable-next-line no-console
console.log('lockDuration', lockDuration);
const [lockDate, setLockDate] = useState<Date>(() =>
addDays(new Date(), 180)
);
Expand Down
13 changes: 8 additions & 5 deletions packages/ui/app/_components/veion/GovernanceHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
'use client';

import Image from 'next/image';
import Link from 'next/link';

import { ExternalLink, HelpCircle } from 'lucide-react';

import { Button } from '@ui/components/ui/button';
import {
Card,
CardHeader,
CardTitle,
CardContent
} from '@ui/components/ui/card';
import { ExternalLink, HelpCircle } from 'lucide-react';
import Image from 'next/image';
import CustomTooltip from '../CustomTooltip';
import { Button } from '@ui/components/ui/button';
import Link from 'next/link';
import { Progress } from '@ui/components/ui/progress';

import CustomTooltip from '../CustomTooltip';

const InfoBlock = ({
label,
value,
Expand Down
26 changes: 15 additions & 11 deletions packages/ui/app/_components/veion/UniversalClaim.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
'use client';

import React, { createContext, useContext, useState } from 'react';
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow
} from '@ui/components/ui/table';
import { Checkbox } from '@ui/components/ui/checkbox';

import Image from 'next/image';

import { Button } from '@ui/components/ui/button';
import { Checkbox } from '@ui/components/ui/checkbox';
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogTrigger
} from '@ui/components/ui/dialog';
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow
} from '@ui/components/ui/table';
import { claimRewards } from '@ui/constants/mock';

import { TableActionButton } from '../TableActionButton';

// Types
Expand Down Expand Up @@ -86,8 +89,8 @@ interface RewardItem {
token: string;
tokenSymbol: string;
amount: number;
network: 'Mode' | 'Base';
section: 'Market Emissions' | 'Protocol Bribes' | 'Locked LP Emissions';
network: 'Base' | 'Mode';
section: 'Locked LP Emissions' | 'Market Emissions' | 'Protocol Bribes';
}

const RewardsTable = ({
Expand Down Expand Up @@ -219,6 +222,7 @@ const ClaimFooter = ({ onClose }: { onClose: () => void }) => {

const handleClaim = async () => {
// Handle claim logic
// eslint-disable-next-line no-console
console.log('Claiming rewards...');
clearSelections();
onClose();
Expand Down
27 changes: 3 additions & 24 deletions packages/ui/app/veion/governance/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client';

import { useSearchParams } from 'next/navigation';

import { useChainId } from 'wagmi';
import CustomTooltip from '@ui/app/_components/CustomTooltip';

import NetworkSelector from '@ui/app/_components/markets/NetworkSelector';
import FlatMap from '@ui/app/_components/points_comp/FlatMap';
import ToggleLinks from '@ui/app/_components/ToggleLink';
Expand All @@ -12,12 +13,7 @@ import {
GovernanceHeader,
UniversalClaim
} from '@ui/app/_components/veion';
import {
Card,
CardHeader,
CardTitle,
CardContent
} from '@ui/components/ui/card';
import { Card, CardHeader, CardContent } from '@ui/components/ui/card';
import { lockedData, lockedDataWithDelegate } from '@ui/constants/mock';

export default function Governance() {
Expand All @@ -28,23 +24,6 @@ export default function Governance() {
const chain = querychain ?? String(chainId);
const view = queryview ?? 'MyVeion';

const infoBlocks = [
{
label: 'Ion Wallet Balance',
value: view === 'MyVeion' ? 78942387 : 6376,
token: 'ION',
infoContent: 'This is the amount of ION you have in your wallet.',
icon: '/img/symbols/32/color/ion.png'
},
{
label: 'Total veION',
value: view === 'MyVeion' ? 5674 : 63754,
token: 'veION',
infoContent: 'This is the amount of veION you have in your wallet.',
icon: '/img/symbols/32/color/ion.png'
}
];

return (
<div className="w-full flex flex-col items-start gap-y-4">
{/* First Card - Now with VeIONHeader */}
Expand Down
17 changes: 9 additions & 8 deletions packages/ui/components/ui/progress.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use client"
'use client';

import * as React from "react"
import * as ProgressPrimitive from "@radix-ui/react-progress"
import * as React from 'react';

import { cn } from "@ui/lib/utils"
import * as ProgressPrimitive from '@radix-ui/react-progress';

import { cn } from '@ui/lib/utils';

const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>,
Expand All @@ -12,7 +13,7 @@ const Progress = React.forwardRef<
<ProgressPrimitive.Root
ref={ref}
className={cn(
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
'relative h-4 w-full overflow-hidden rounded-full bg-secondary',
className
)}
{...props}
Expand All @@ -22,7 +23,7 @@ const Progress = React.forwardRef<
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
))
Progress.displayName = ProgressPrimitive.Root.displayName
));
Progress.displayName = ProgressPrimitive.Root.displayName;

export { Progress }
export { Progress };
9 changes: 4 additions & 5 deletions packages/ui/constants/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,12 @@ export const infoBlocks: InfoBlock[] = [
}
];


// Types for our rewards data
type Network = 'Mode' | 'Base';
type Network = 'Base' | 'Mode';
type RewardSection =
| 'Locked LP Emissions'
| 'Market Emissions'
| 'Protocol Bribes'
| 'Locked LP Emissions';
| 'Protocol Bribes';

interface RewardItem {
token: string;
Expand Down Expand Up @@ -352,4 +351,4 @@ export const claimRewards: RewardItem[] = [
selected: false,
section: 'Locked LP Emissions'
}
]
];

0 comments on commit b95d15f

Please sign in to comment.