wip: timeline

This commit is contained in:
Ren Amamiya
2023-09-21 09:11:45 +07:00
parent 0e5adb246f
commit 17fe3bb1f6
13 changed files with 107 additions and 155 deletions

View File

@@ -1,10 +1,12 @@
import { NDKFilter, NDKKind } from '@nostr-dev-kit/ndk';
import { useEffect } from 'react';
import { Link } from 'react-router-dom';
import { useStorage } from '@libs/storage/provider';
import { AccountMoreActions } from '@shared/accounts/more';
import { SettingsIcon } from '@shared/icons';
import { Image } from '@shared/image';
import { Logout } from '@shared/logout';
import { useActivities } from '@stores/activities';
@@ -63,23 +65,31 @@ export function ActiveAccount() {
}
return (
<div className="flex h-16 items-center justify-between border-l-2 border-transparent pb-2 pl-4 pr-2">
<div className="flex items-center gap-2.5">
<div className="flex h-16 items-center justify-between border-l-2 border-transparent pb-2 pl-4 pr-3">
<Link to={`/users/${db.account.pubkey}`} className="flex items-center gap-1.5">
<Image
src={user?.picture || user?.image}
alt={db.account.npub}
className="h-10 w-10 shrink-0 rounded-lg object-cover"
className="h-9 w-9 shrink-0 rounded-lg object-cover"
/>
<div className="flex w-full flex-1 flex-col items-start gap-1.5">
<p className="max-w-[10rem] truncate font-bold leading-none text-white">
<div className="flex w-full flex-1 flex-col items-start gap-0.5">
<p className="max-w-[10rem] truncate font-semibold leading-none text-white">
{user?.name || user?.display_name}
</p>
<span className="max-w-[8rem] truncate text-sm leading-none text-white/50">
{displayNpub(db.account.pubkey, 16)}
<span className="max-w-[7rem] truncate text-sm leading-none text-white/50">
{user?.nip05 || displayNpub(db.account.pubkey, 12)}
</span>
</div>
</Link>
<div className="inline-flex divide-x divide-white/5 rounded-lg border-t border-white/10 bg-white/20">
<Link
to="/settings/"
className="inline-flex h-9 w-9 items-center justify-center hover:bg-white/10"
>
<SettingsIcon className="h-4 w-4 text-white" />
</Link>
<Logout />
</div>
<AccountMoreActions pubkey={db.account.pubkey} />
</div>
);
}