diff --git a/app/allocation/components/ConnectBox.tsx b/app/allocation/components/ConnectBox.tsx index d14cd96..8a05c85 100644 --- a/app/allocation/components/ConnectBox.tsx +++ b/app/allocation/components/ConnectBox.tsx @@ -7,8 +7,6 @@ import { } from '@worldcoin/idkit'; import { useQueryClient } from '@tanstack/react-query'; import { WorldIdIcon } from '@/public/assets/icon-components/WorldIdIcon'; -import { XIcon } from '@/public/assets/icon-components/XIcon'; -import { WarpcastIcon } from '@/public/assets/icon-components/WarpcastIcon'; import { actionId, appId } from '@/app/lib/constants'; import { useGetConnectionStatus, useWorldSignIn, useGetDelegationStatus } from '@/app/utils/getConnectionStatus'; import { CheckIcon } from '@/public/assets/icon-components/Check'; @@ -26,7 +24,6 @@ interface ConnectBoxProps { const ConnectBox: React.FC = ({ onConnectWorldID, - onConnectTwitter, onConnectFarcaster, }) => { const { data: badges } = useGetPublicBadges(); @@ -71,7 +68,6 @@ const ConnectBox: React.FC = ({ const { mutateAsync: worldIdSignIn } = useWorldSignIn(); const { data: connectionStatus } = useGetConnectionStatus(); const { data: delegates } = useGetDelegationStatus(); - const connected = false; // tempo variable const handleVerify = async (proof: ISuccessResult) => { return (await worldIdSignIn(proof)); @@ -147,49 +143,21 @@ const ConnectBox: React.FC = ({ ? 'Connect your X and Farcaster account to find out if someone delegated their voting power to you.' : 'Some people have delegated their voting power to you. With great power comes great responsibility. Use it wisely.'}

- {connected - ? ( -
- -
-
-

- 5 people - {' '} - delegated to - you -

-
- -
-
- ) - : ( - - )} {connectionStatus?.farcaster ? (
- + Farcaster Icon

- {delegates?.toYou?.budget.length ?? 'No'} - {' '} - people + {delegates?.toYou?.budget.length ? `${delegates?.toYou?.budget.length} people delegated to you` : 'You have no delegations'} - {' '} - delegated to - you

)} diff --git a/app/allocation/components/WorldIdSignInSuccessModal.tsx b/app/allocation/components/WorldIdSignInSuccessModal.tsx index 28b54ce..8afd166 100644 --- a/app/allocation/components/WorldIdSignInSuccessModal.tsx +++ b/app/allocation/components/WorldIdSignInSuccessModal.tsx @@ -41,7 +41,6 @@ const WorldIdSignInSuccessModal: React.FC = ({ 'holderPoints', badges, )} - worldCoinVerified={badges?.worldCoinVerified} />
)} diff --git a/app/comparison/card/modals/BadgesModal.tsx b/app/comparison/card/modals/BadgesModal.tsx index 1d692be..9b3652b 100644 --- a/app/comparison/card/modals/BadgesModal.tsx +++ b/app/comparison/card/modals/BadgesModal.tsx @@ -37,22 +37,12 @@ const BadgesModal = ({ badges }: BadgesModalProps) => { } switch (badge.type) { case BadgesEnum.HOLDER: - if (allBadges?.worldCoinVerified) { - return ( -
-
-

Verified WorldID

-
-
- ); - } - // eslint-disable-next-line no-fallthrough case BadgesEnum.DELEGATE: return (
token | string> + = { + holderPoints: { + Bronze: '/assets/images/badges/holder_bronze.svg', + Silver: '/assets/images/badges/holder_silver.svg', + Gold: '/assets/images/badges/holder_gold.svg', + Platinum: '/assets/images/badges/holder_platinum.svg', + Diamond: '/assets/images/badges/holder_diamond.svg', + Whale: '/assets/images/badges/holder_whale.svg', + }, + delegatePoints: { + Bronze: '/assets/images/badges/delegate_bronze.svg', + Silver: '/assets/images/badges/delegate_silver.svg', + Gold: '/assets/images/badges/delegate_gold.svg', + Platinum: '/assets/images/badges/delegate_platinum.svg', + Diamond: '/assets/images/badges/delegate_diamond.svg', + Whale: '/assets/images/badges/delegate_whale.svg', + }, + badgeholderPoints: '/assets/images/badges/badgeholder.svg', + recipientsPoints: '/assets/images/badges/recipient.svg', + }; + const BadgeCard: React.FC = ({ type, points, medal, amount, - worldCoinVerified, }) => { const formatAmount = (amount: number | undefined) => { if (amount === undefined) return ''; @@ -38,39 +58,25 @@ const BadgeCard: React.FC = ({ : amount.toString(); }; const handleBadgesImage = () => { - switch (type) { - case 'holderPoints': - return '/images/badges/holder/' + medal?.toLowerCase() + '/128.svg'; - case 'delegatePoints': - return '/images/badges/delegate/' + medal?.toLowerCase() + '/128.svg'; - case 'recipientsPoints': - return '/images/badges/recipient/128.svg'; - case 'badgeholderPoints': - return '/images/badges/badgeholder/128.svg'; - default: - return '/images/badges/1.png'; + const image = badgeImages[type]; + if (typeof image === 'string') { + return image; } + if (medal) { + return image[medal]; + } + throw new Error(`Badge of type ${type} requires a medal.`); }; const handleBadgeInfo = (amount?: number, points?: number) => { switch (type) { case 'holderPoints': - if (worldCoinVerified) { - return ( -
-
-

Verified WorldID

-
-
- ); - } - // eslint-disable-next-line no-fallthrough case 'delegatePoints': return (
token { + setShowBhModal(false); router.push('/allocation'); }} > {notBhOpen && ( - { open(); }} onConnectFarcaster={() => { setIsOpenFarcasterModal(true); - setShowBhModal(false); }} - onConnectTwitter={() => {}} + /> )} diff --git a/app/utils/wallet/modals/NotBhModal.tsx b/app/utils/wallet/modals/NotBhModal.tsx index 72e5149..88cd9a9 100644 --- a/app/utils/wallet/modals/NotBhModal.tsx +++ b/app/utils/wallet/modals/NotBhModal.tsx @@ -5,26 +5,24 @@ import { useRouter } from 'next/navigation'; import { shortenWalletAddress } from '@/app/comparison/utils/helpers'; import { BadgeData, getBadgeAmount, getBadgeMedal, useGetPublicBadges } from '../../getBadges'; import BadgeCard, { BadgeCardEntryType } from '../../BadgeCard'; -import { XIcon } from '@/public/assets/icon-components/XIcon'; import { WarpcastIcon } from '@/public/assets/icon-components/WarpcastIcon'; import { WorldIdIcon } from '@/public/assets/icon-components/WorldIdIcon'; import { useGetConnectionStatus, useGetDelegationStatus } from '../../getConnectionStatus'; import { CheckIcon } from '@/public/assets/icon-components/Check'; -interface SignedModalProps { - onConnectTwitter: () => void +interface BhModalProps { onConnectFarcaster: () => void open: () => void } -const NotBadgeHolder: React.FC = ( - { onConnectFarcaster, onConnectTwitter, open } + +const BadgeHolderModal: React.FC = ( + { onConnectFarcaster, open } ) => { const { address } = useAccount(); const { data: badges } = useGetPublicBadges(); const { data: connectionStatus } = useGetConnectionStatus(); const { data: delegates } = useGetDelegationStatus(); - const isWorldCoinVerified = badges?.worldCoinVerified ?? false; const badgeCards = useMemo(() => { if (!badges) return null; const { @@ -51,14 +49,13 @@ const NotBadgeHolder: React.FC = ( key, badges, )} - worldCoinVerified={isWorldCoinVerified} /> ); }); }, [badges]); const router = useRouter(); return ( -
+

Welcome to the Pairwise voting for "Retro Funding 6"

{badges && Object.keys(badges).length > 0 ? ( @@ -118,13 +115,6 @@ const NotBadgeHolder: React.FC = (
)}
-