diff --git a/src/components/CellList.tsx b/src/components/CellList.tsx index c31d4f4..ad151de 100644 --- a/src/components/CellList.tsx +++ b/src/components/CellList.tsx @@ -29,7 +29,9 @@ import { Cell } from '@/types/forum'; import { usePending } from '@/hooks/usePending'; // Empty State Component -const EmptyState: React.FC<{ canCreateCell: boolean }> = ({ canCreateCell }) => { +const EmptyState: React.FC<{ canCreateCell: boolean }> = ({ + canCreateCell, +}) => { return (
{/* Visual Element */} @@ -76,10 +78,7 @@ const CellItem: React.FC<{ cell: Cell }> = ({ cell }) => { const pending = usePending(cell.id); return ( - +
{
-

- Decentralized Cells -

+

Decentralized Cells

Discover communities built on Bitcoin Ordinals

- {/* Only show controls when cells exist */} - {hasCells && ( -
- + {/* Only show controls when cells exist */} + {hasCells && ( +
+ - + - - - {canCreateCell && ( - - )} -
- )} + + + {canCreateCell && } +
+ )}
diff --git a/src/components/Header.tsx b/src/components/Header.tsx index f608d6a..74fa191 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -122,7 +122,6 @@ const Header = () => { }); }; - const getStatusIcon = () => { if (!isConnected) return ; @@ -191,24 +190,29 @@ const Header = () => { {isConnected ? (
{/* Status Badge */} - {getStatusIcon()} - {verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED && delegationInfo?.isValid + {verificationStatus === + EVerificationStatus.ENS_ORDINAL_VERIFIED && + delegationInfo?.isValid ? 'READY' - : verificationStatus === EVerificationStatus.ENS_ORDINAL_VERIFIED - ? 'EXPIRED' - : 'VERIFY' - } + : verificationStatus === + EVerificationStatus.ENS_ORDINAL_VERIFIED + ? 'EXPIRED' + : 'VERIFY'} @@ -224,37 +228,53 @@ const Header = () => { - +
-
{displayName}
-
{address?.slice(0, 8)}...{address?.slice(-4)}
+
+ {displayName} +
+
+ {address?.slice(0, 8)}...{address?.slice(-4)} +
- + - + Profile - + - + Bookmarks - + - - + + Setup Wizard - + - - @@ -279,7 +299,11 @@ const Header = () => { onClick={() => setMobileMenuOpen(!mobileMenuOpen)} className="md:hidden text-white hover:bg-cyber-muted/30" > - {mobileMenuOpen ? : } + {mobileMenuOpen ? ( + + ) : ( + + )}
@@ -395,7 +419,7 @@ const Header = () => { )} - + {/* Mobile Network Status */}
diff --git a/src/components/PostList.tsx b/src/components/PostList.tsx index 01ebbe9..a613efc 100644 --- a/src/components/PostList.tsx +++ b/src/components/PostList.tsx @@ -267,10 +267,7 @@ const PostList = () => {
) : ( visiblePosts.map(post => ( -
+
- - - - Clear All Bookmarks - - Are you sure you want to remove all your bookmarks? This - action cannot be undone. - - - - Cancel - 0 && ( + + +
+ + + + + Clear All Bookmarks + + Are you sure you want to remove all your bookmarks? This + action cannot be undone. + + + + Cancel + + Clear All + + + + + )} +

Your saved posts and comments. Bookmarks are stored locally and @@ -174,83 +172,83 @@ const BookmarksPage = () => {

- {/* Stats */} - {bookmarks.length > 0 && ( -
- - - {postBookmarks.length} Posts - - - - {commentBookmarks.length} Comments - - - - {bookmarks.length} Total - -
- )} + {/* Stats */} + {bookmarks.length > 0 && ( +
+ + + {postBookmarks.length} Posts + + + + {commentBookmarks.length} Comments + + + + {bookmarks.length} Total + +
+ )} - {/* Tabs */} - - setActiveTab(value as 'all' | 'posts' | 'comments') - } - className="w-full" - > - - - - All ({bookmarks.length}) - - - - Posts ({postBookmarks.length}) - - - - Comments ({commentBookmarks.length}) - - + {/* Tabs */} + + setActiveTab(value as 'all' | 'posts' | 'comments') + } + className="w-full" + > + + + + All ({bookmarks.length}) + + + + Posts ({postBookmarks.length}) + + + + Comments ({commentBookmarks.length}) + + - - - + + + - - - + + + - - - - + + + +
diff --git a/src/pages/FeedPage.tsx b/src/pages/FeedPage.tsx index 3560954..14a3094 100644 --- a/src/pages/FeedPage.tsx +++ b/src/pages/FeedPage.tsx @@ -105,49 +105,47 @@ const FeedPage: React.FC = () => {

Popular Posts

-

- Latest posts from all cells -

+

Latest posts from all cells

-
- +
+ - + - -
+ +
diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index c8b70be..5939f39 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -58,21 +58,21 @@ export default function ProfilePage() { const [isEditing, setIsEditing] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false); - const [callSign, setCallSign] = useState(currentUser?.callSign || ''); - const [displayPreference, setDisplayPreference] = useState( - currentUser?.displayPreference || EDisplayPreference.WALLET_ADDRESS - ); + const [callSign, setCallSign] = useState(''); + const [displayPreference, setDisplayPreference] = useState(EDisplayPreference.WALLET_ADDRESS); const [walletWizardOpen, setWalletWizardOpen] = useState(false); - // Update local state when user data changes + // Initialize and update local state when user data changes useEffect(() => { if (currentUser) { - setCallSign(currentUser.callSign || ''); - setDisplayPreference( - currentUser.displayPreference || EDisplayPreference.WALLET_ADDRESS - ); + // Use the same data source as the display (userInfo) for consistency + const currentCallSign = userInfo.callSign || currentUser.callSign || ''; + const currentDisplayPreference = userInfo.displayPreference || currentUser.displayPreference || EDisplayPreference.WALLET_ADDRESS; + + setCallSign(currentCallSign); + setDisplayPreference(currentDisplayPreference); } - }, [currentUser]); + }, [currentUser, userInfo.callSign, userInfo.displayPreference]); // Copy to clipboard function const copyToClipboard = async (text: string, label: string) => { @@ -100,8 +100,12 @@ export default function ProfilePage() {
-

Connect Required

-

Please connect your wallet to view your profile.

+

+ Connect Required +

+

+ Please connect your wallet to view your profile. +

@@ -168,8 +172,12 @@ export default function ProfilePage() { }; const handleCancel = () => { - setCallSign(currentUser.callSign || ''); - setDisplayPreference(currentUser.displayPreference); + // Reset to the same data source as display for consistency + const currentCallSign = userInfo.callSign || currentUser.callSign || ''; + const currentDisplayPreference = userInfo.displayPreference || currentUser.displayPreference || EDisplayPreference.WALLET_ADDRESS; + + setCallSign(currentCallSign); + setDisplayPreference(currentDisplayPreference); setIsEditing(false); }; @@ -220,7 +228,9 @@ export default function ProfilePage() { {/* Page Header */}

Profile

-

Manage your account settings and preferences

+

+ Manage your account settings and preferences +

{/* Two-Card Layout: User Profile + Security Status */} @@ -283,12 +293,15 @@ export default function ProfilePage() {
- {currentUser.address.slice(0, 8)}...{currentUser.address.slice(-6)} + {currentUser.address.slice(0, 8)}... + {currentUser.address.slice(-6)}
-
- {(delegationStatus.hasDelegation || delegationInfo?.hasDelegation) && ( + {(delegationStatus.hasDelegation || + delegationInfo?.hasDelegation) && ( )} @@ -430,41 +465,61 @@ export default function ProfilePage() { {/* Delegation Status */}
- Delegation + + Delegation + - {(delegationStatus.isValid || delegationInfo?.isValid) ? 'Active' : 'Inactive'} + {delegationStatus.isValid || delegationInfo?.isValid + ? 'Active' + : 'Inactive'}
{/* Expiry Date */} - {(delegationStatus.expiresAt || currentUser.delegationExpiry) && ( + {(delegationStatus.expiresAt || + currentUser.delegationExpiry) && (
- Valid until + + Valid until +
- {(delegationStatus.expiresAt || new Date(currentUser.delegationExpiry!)).toLocaleDateString()} + {( + delegationStatus.expiresAt || + new Date(currentUser.delegationExpiry!) + ).toLocaleDateString()}
)} {/* Signature Status */}
- Signature + + Signature + - {(delegationStatus.isValid || currentUser.delegationSignature === 'valid') ? 'Valid' : 'Not signed'} + {delegationStatus.isValid || + currentUser.delegationSignature === 'valid' + ? 'Valid' + : 'Not signed'}
@@ -476,15 +531,22 @@ export default function ProfilePage() {
- {(delegationStatus.publicKey || currentUser.browserPubKey) + {delegationStatus.publicKey || currentUser.browserPubKey ? `${(delegationStatus.publicKey || currentUser.browserPubKey!).slice(0, 12)}...${(delegationStatus.publicKey || currentUser.browserPubKey!).slice(-8)}` : 'Not delegated'}
- {(delegationStatus.publicKey || currentUser.browserPubKey) && ( + {(delegationStatus.publicKey || + currentUser.browserPubKey) && (
{/* Warning for expired delegation */} - {(!delegationStatus.isValid && delegationStatus.hasDelegation) || (!delegationInfo?.isValid && delegationInfo?.hasDelegation) && ( -
-
- - - Delegation expired. Renew to continue using your browser key. - -
-
- )} + {(!delegationStatus.isValid && + delegationStatus.hasDelegation) || + (!delegationInfo?.isValid && + delegationInfo?.hasDelegation && ( +
+
+ + + Delegation expired. Renew to continue using your + browser key. + +
+
+ ))} -