5 changed files with 87 additions and 6 deletions
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
import { MessageCircle } from 'lucide-react' |
||||
import BottomNavigationBarItem from './BottomNavigationBarItem' |
||||
|
||||
export default function DiscussionsButton() { |
||||
// TODO: Implement discussions navigation when the component is built
|
||||
const handleClick = () => { |
||||
// Placeholder for future discussions functionality
|
||||
console.log('Discussions button clicked - component to be implemented') |
||||
} |
||||
|
||||
return ( |
||||
<BottomNavigationBarItem onClick={handleClick}> |
||||
<MessageCircle /> |
||||
</BottomNavigationBarItem> |
||||
) |
||||
} |
||||
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' |
||||
import { Button } from '@/components/ui/button' |
||||
import { Skeleton } from '@/components/ui/skeleton' |
||||
import { generateImageByPubkey } from '@/lib/pubkey' |
||||
import { cn } from '@/lib/utils' |
||||
import { usePrimaryPage } from '@/PageManager' |
||||
import { useNostr } from '@/providers/NostrProvider' |
||||
import { UserRound } from 'lucide-react' |
||||
import { useMemo } from 'react' |
||||
|
||||
export default function AccountButton() { |
||||
const { navigate, current, display } = usePrimaryPage() |
||||
const { pubkey, profile } = useNostr() |
||||
const defaultAvatar = useMemo( |
||||
() => (profile?.pubkey ? generateImageByPubkey(profile.pubkey) : ''), |
||||
[profile] |
||||
) |
||||
const active = useMemo(() => current === 'me' && display, [display, current]) |
||||
|
||||
return ( |
||||
<Button |
||||
variant="ghost" |
||||
size="titlebar-icon" |
||||
onClick={() => navigate('me')} |
||||
className={active ? 'bg-accent/50' : ''} |
||||
> |
||||
{pubkey ? ( |
||||
profile ? ( |
||||
<Avatar className={cn('w-6 h-6', active ? 'ring-primary ring-1' : '')}> |
||||
<AvatarImage src={profile.avatar} className="object-cover object-center" /> |
||||
<AvatarFallback> |
||||
<img src={defaultAvatar} /> |
||||
</AvatarFallback> |
||||
</Avatar> |
||||
) : ( |
||||
<Skeleton className={cn('w-6 h-6 rounded-full', active ? 'ring-primary ring-1' : '')} /> |
||||
) |
||||
) : ( |
||||
<UserRound /> |
||||
)} |
||||
</Button> |
||||
) |
||||
} |
||||
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
import { usePrimaryPage } from '@/PageManager' |
||||
import { Button } from '@/components/ui/button' |
||||
import { Compass } from 'lucide-react' |
||||
|
||||
export default function ExploreButton() { |
||||
const { navigate, current, display } = usePrimaryPage() |
||||
|
||||
return ( |
||||
<Button |
||||
variant="ghost" |
||||
size="titlebar-icon" |
||||
onClick={() => navigate('explore')} |
||||
className={current === 'explore' && display ? 'bg-accent/50' : ''} |
||||
> |
||||
<Compass /> |
||||
</Button> |
||||
) |
||||
} |
||||
Loading…
Reference in new issue