wip: migrate to ark

This commit is contained in:
reya
2023-12-08 09:32:48 +07:00
parent 5f90bd0d22
commit 68886ad584
26 changed files with 441 additions and 349 deletions
+6 -6
View File
@@ -2,7 +2,7 @@ import * as Avatar from '@radix-ui/react-avatar';
import { minidenticon } from 'minidenticons';
import { Link } from 'react-router-dom';
import { useStorage } from '@libs/storage/provider';
import { useArk } from '@libs/ark';
import { AccountMoreActions } from '@shared/accounts/more';
import { NetworkStatusIndicator } from '@shared/networkStatusIndicator';
@@ -10,12 +10,12 @@ import { NetworkStatusIndicator } from '@shared/networkStatusIndicator';
import { useProfile } from '@utils/hooks/useProfile';
export function ActiveAccount() {
const { db } = useStorage();
const { user } = useProfile(db.account.pubkey);
const { ark } = useArk();
const { user } = useProfile(ark.account.pubkey);
const svgURI =
'data:image/svg+xml;utf8,' +
encodeURIComponent(minidenticon(db.account.pubkey, 90, 50));
encodeURIComponent(minidenticon(ark.account.pubkey, 90, 50));
return (
<div className="flex flex-col gap-1 rounded-lg bg-neutral-100 p-1 ring-1 ring-transparent hover:bg-neutral-200 hover:ring-blue-500 dark:bg-neutral-900 dark:hover:bg-neutral-800">
@@ -23,7 +23,7 @@ export function ActiveAccount() {
<Avatar.Root>
<Avatar.Image
src={user?.picture || user?.image}
alt={db.account.pubkey}
alt={ark.account.pubkey}
loading="lazy"
decoding="async"
style={{ contentVisibility: 'auto' }}
@@ -32,7 +32,7 @@ export function ActiveAccount() {
<Avatar.Fallback delayMs={150}>
<img
src={svgURI}
alt={db.account.pubkey}
alt={ark.account.pubkey}
className="aspect-square h-auto w-full rounded-md bg-black dark:bg-white"
/>
</Avatar.Fallback>