diff --git a/src/components/FeedSidebar.tsx b/src/components/FeedSidebar.tsx
index dfd4be4..fb837d5 100644
--- a/src/components/FeedSidebar.tsx
+++ b/src/components/FeedSidebar.tsx
@@ -5,6 +5,7 @@ import { TrendingUp, Users, Eye } from 'lucide-react';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { useForumData, useForumSelectors, useAuth } from '@/hooks';
+import { EVerificationStatus } from '@/types/identity';
import { CypherImage } from '@/components/ui/CypherImage';
import { useUserDisplay } from '@/hooks';
@@ -29,9 +30,9 @@ const FeedSidebar: React.FC = () => {
// User's verification status display
const getVerificationBadge = () => {
- if (verificationStatus.level === 'verified-owner') {
+ if (verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED) {
return { text: 'Verified Owner', color: 'bg-green-500' };
- } else if (verificationStatus.level === 'verified-basic') {
+ } else if (verificationStatus === EVerificationStatus.WALLET_CONNECTED) {
return { text: 'Verified', color: 'bg-blue-500' };
} else if (ensName) {
return { text: 'ENS User', color: 'bg-purple-500' };
@@ -67,14 +68,14 @@ const FeedSidebar: React.FC = () => {
- {verificationStatus.level === 'unverified' && (
+ {verificationStatus === EVerificationStatus.WALLET_UNCONNECTED && (
Read-only mode. Verify wallet to participate.
)}
- {verificationStatus.level === 'verified-basic' &&
+ {verificationStatus === EVerificationStatus.WALLET_CONNECTED &&
!ordinalDetails && (
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index eb4cdd3..2d5cbb1 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -1,6 +1,8 @@
import React, { useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { useAuth, useNetworkStatus } from '@/hooks';
+import { useAuth as useAuthContext } from '@/contexts/useAuth';
+import { EVerificationStatus } from '@/types/identity';
import { useForum } from '@/contexts/useForum';
import { Button } from '@/components/ui/button';
@@ -27,7 +29,9 @@ import { WalletWizard } from '@/components/ui/wallet-wizard';
import { useUserDisplay } from '@/hooks';
const Header = () => {
- const { verificationStatus, delegationInfo } = useAuth();
+ const { verificationStatus } = useAuth();
+ const { getDelegationStatus } = useAuthContext();
+ const delegationInfo = getDelegationStatus();
const networkStatus = useNetworkStatus();
const location = useLocation();
const { toast } = useToast();
@@ -94,14 +98,10 @@ const Header = () => {
const getAccountStatusText = () => {
if (!isConnected) return 'Connect Wallet';
- if (verificationStatus.level === 'verified-owner') {
- return delegationInfo.isActive ? 'Ready to Post' : 'Delegation Expired';
- } else if (verificationStatus.level === 'verified-basic') {
+ if (verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED) {
+ return delegationInfo.isValid ? 'Ready to Post' : 'Delegation Expired';
+ } else if (verificationStatus === EVerificationStatus.WALLET_CONNECTED) {
return 'Verified (Read-only)';
- } else if (verificationStatus.level === 'unverified') {
- return verificationStatus.hasOrdinal
- ? 'Verify Wallet'
- : 'No Ordinals Found';
} else {
return 'Verify Wallet';
}
@@ -111,13 +111,15 @@ const Header = () => {
if (!isConnected) return 'text-red-400';
if (
- verificationStatus.level === 'verified-owner' &&
- delegationInfo.isActive
+ verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED &&
+ delegationInfo.isValid
) {
return 'text-green-400';
- } else if (verificationStatus.level === 'verified-basic') {
+ } else if (verificationStatus === EVerificationStatus.WALLET_CONNECTED) {
return 'text-yellow-400';
- } else if (verificationStatus.hasOrdinal || verificationStatus.hasENS) {
+ } else if (
+ verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED
+ ) {
return 'text-orange-400';
} else {
return 'text-red-400';
@@ -128,13 +130,15 @@ const Header = () => {
if (!isConnected) return
;
if (
- verificationStatus.level === 'verified-owner' &&
- delegationInfo.isActive
+ verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED &&
+ delegationInfo.isValid
) {
return
;
- } else if (verificationStatus.level === 'verified-basic') {
+ } else if (verificationStatus === EVerificationStatus.WALLET_CONNECTED) {
return
;
- } else if (verificationStatus.hasOrdinal || verificationStatus.hasENS) {
+ } else if (
+ verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED
+ ) {
return
;
} else {
return
;
diff --git a/src/components/PostList.tsx b/src/components/PostList.tsx
index 0d12407..6edca69 100644
--- a/src/components/PostList.tsx
+++ b/src/components/PostList.tsx
@@ -8,6 +8,7 @@ import {
useUserVotes,
useAuth,
} from '@/hooks';
+import { EVerificationStatus } from '@/types/identity';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
@@ -218,21 +219,22 @@ const PostList = () => {
)}
- {!canPost && verificationStatus.level === 'verified-basic' && (
-
-
-
-
Read-Only Mode
+ {!canPost &&
+ verificationStatus === EVerificationStatus.WALLET_CONNECTED && (
+
+
+
+
Read-Only Mode
+
+
+ Your wallet does not contain any Ordinal Operators. You can browse
+ threads but cannot post or interact.
+
+
+ No Ordinals Found
+
-
- Your wallet does not contain any Ordinal Operators. You can browse
- threads but cannot post or interact.
-
-
- No Ordinals Found
-
-
- )}
+ )}
{!canPost && !currentUser && (
diff --git a/src/components/examples/HookDemoComponent.tsx b/src/components/examples/HookDemoComponent.tsx
index f8fea2b..44834f2 100644
--- a/src/components/examples/HookDemoComponent.tsx
+++ b/src/components/examples/HookDemoComponent.tsx
@@ -9,6 +9,7 @@ import {
useNetworkStatus,
useForumSelectors,
} from '@/hooks';
+import { useAuth as useAuthContext } from '@/contexts/useAuth';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
@@ -22,6 +23,7 @@ export function HookDemoComponent() {
// Core data hooks - reactive and optimized
const forumData = useForumData();
const auth = useAuth();
+ const { getDelegationStatus } = useAuthContext();
// Derived hooks for specific data
const userVotes = useUserVotes();
@@ -131,12 +133,11 @@ export function HookDemoComponent() {
- Verification Level:{' '}
- {auth.verificationStatus.level}
+ Verification Level: {auth.verificationStatus}
Delegation Active:{' '}
- {auth.delegationInfo.isActive ? 'Yes' : 'No'}
+ {getDelegationStatus().isValid ? 'Yes' : 'No'}
diff --git a/src/components/ui/delegation-step.tsx b/src/components/ui/delegation-step.tsx
index 4bb21b4..74feab5 100644
--- a/src/components/ui/delegation-step.tsx
+++ b/src/components/ui/delegation-step.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { Button } from './button';
import { useAuth, useAuthActions } from '@/hooks';
+import { useAuth as useAuthContext } from '@/contexts/useAuth';
import { CheckCircle, AlertCircle, Trash2 } from 'lucide-react';
import { DelegationDuration } from '@/lib/delegation';
@@ -17,7 +18,9 @@ export function DelegationStep({
isLoading,
setIsLoading,
}: DelegationStepProps) {
- const { currentUser, delegationInfo, isAuthenticating } = useAuth();
+ const { currentUser, isAuthenticating } = useAuth();
+ const { getDelegationStatus } = useAuthContext();
+ const delegationInfo = getDelegationStatus();
const { delegateKey, clearDelegation } = useAuthActions();
const [selectedDuration, setSelectedDuration] =
@@ -125,19 +128,19 @@ export function DelegationStep({
{/* Status */}
- {delegationInfo.isActive ? (
+ {delegationInfo.isValid ? (
) : (
)}
- {delegationInfo.isActive ? 'Delegated' : 'Required'}
+ {delegationInfo.isValid ? 'Delegated' : 'Required'}
- {delegationInfo.isActive && delegationInfo.timeRemaining && (
+ {delegationInfo.isValid && delegationInfo.timeRemaining && (
{delegationInfo.timeRemaining} remaining
@@ -145,7 +148,7 @@ export function DelegationStep({
{/* Duration Selection */}
- {!delegationInfo.isActive && (
+ {!delegationInfo.isValid && (