diff --git a/app/allocation/[category]/components/RankingRow.tsx b/app/allocation/[category]/components/RankingRow.tsx index 710a95f..99e8b52 100644 --- a/app/allocation/[category]/components/RankingRow.tsx +++ b/app/allocation/[category]/components/RankingRow.tsx @@ -3,7 +3,6 @@ import Image from 'next/image'; import { NumericFormat } from 'react-number-format'; import { IProjectRanking } from '@/app/comparison/utils/types'; import { Checkbox } from '@/app/utils/Checkbox'; -import { ExpandVertical } from '@/public/assets/icon-components/ExpandVertical'; import { LockIcon } from '@/public/assets/icon-components/Lock'; import { UnlockIcon } from '@/public/assets/icon-components/Unlock'; import styles from '@/app/styles/Project.module.css'; @@ -63,11 +62,11 @@ const RankingRow: FC = ({ {project.project.description}

- + {/*
- + */}
= ({ email, setStep }) => { setStep(Step.SUCCESS); } catch (err) { - setError('An error occurred while connecting to your wallet'); + setError('This email is already connected to another wallet'); setLoading(false); } }; diff --git a/app/allocation/page.tsx b/app/allocation/page.tsx index bdcb320..cfb325d 100644 --- a/app/allocation/page.tsx +++ b/app/allocation/page.tsx @@ -190,6 +190,12 @@ const AllocationPage = () => { const handleSliderChange = (_event: Event, newValue: number | number[]) => { if (typeof newValue === 'number') { setTotalValue(newValue * 1_000_000); + setCategoriesRanking( + categoriesRanking?.map(el => ({ + ...el, + budget: el.budget * (newValue / (totalValue / 1_000_000)), + })) + ); } }; diff --git a/app/comparison/card/Header-RF6.tsx b/app/comparison/card/Header-RF6.tsx index 366b466..831e1cb 100644 --- a/app/comparison/card/Header-RF6.tsx +++ b/app/comparison/card/Header-RF6.tsx @@ -1,5 +1,5 @@ import React, { FC, useState, useEffect, useMemo } from 'react'; -import { useDisconnect } from 'wagmi'; +import { useDisconnect, useAccount } from 'wagmi'; import { usePathname } from 'next/navigation'; import { ConnectButton } from '@/app/utils/wallet/Connect'; import { PwLogo } from '@/public/assets/icon-components/PairwiseLogo'; @@ -15,6 +15,7 @@ import { useGetPublicBadges } from '@/app/utils/getBadges'; import DelegationsModal from './modals/DelegationsModal'; import { useGetDelegationStatus } from '@/app/utils/getConnectionStatus'; import StorageLabel from '@/app/lib/localStorage'; + interface HeaderProps { progress?: number category?: string @@ -36,6 +37,7 @@ const HeaderRF6: FC = ({ const { signOut, loginAddress } = useAuth(); const { data: badges } = useGetPublicBadges(); const { data: delegates } = useGetDelegationStatus(); + const { address, chainId } = useAccount(); const [isBadgesModalOpen, setIsBadgesModalOpen] = useState(false); const [isDelegateModalOpen, setIsDelegateModalOpen] = useState(false); @@ -97,8 +99,16 @@ const HeaderRF6: FC = ({ }; useEffect(() => { - const isAlreadyShown - = localStorage.getItem(StorageLabel.PRE_VOTING_DELEGATION_POPUP) === 'true'; + if (!category || !chainId || !delegates) return; + + const currentUserKey = `${chainId}_${address}`; + + const storedData = JSON.parse( + localStorage.getItem(StorageLabel.PRE_VOTING_DELEGATION_POPUP) || '{}' + ); + + const categories = storedData[currentUserKey] || {}; + const isAlreadyShown = categories[category]; if ( path.includes('comparison') @@ -110,7 +120,27 @@ const HeaderRF6: FC = ({ }, [path]); const markAsShown = () => { - localStorage.setItem(StorageLabel.PRE_VOTING_DELEGATION_POPUP, 'true'); + if (!category || !chainId || !delegates) return; + + const currentUserKey = `${chainId}_${address}`; + + const storedData = JSON.parse( + localStorage.getItem(StorageLabel.PRE_VOTING_DELEGATION_POPUP) || '{}' + ); + + const categories = storedData[currentUserKey] || {}; + + localStorage.setItem( + StorageLabel.PRE_VOTING_DELEGATION_POPUP, + JSON.stringify({ + ...storedData, + [currentUserKey]: { + ...categories, + [category]: true, + }, + }) + ); + setIsDelegateModalOpen(false); };