feat: redesign navigation bar

This commit is contained in:
2024-01-10 13:57:44 +07:00
parent f2504071cd
commit a5ad4fe05c
17 changed files with 274 additions and 197 deletions

View File

@@ -111,8 +111,10 @@ export class Ark {
public async getUserProfile(pubkey?: string) {
try {
// get clean pubkey without any special characters
let hexstring = pubkey.replace(/[^a-zA-Z0-9]/g, "").replace("nostr:", "");
const currentUserPubkey = this.#storage.account.pubkey;
let hexstring = pubkey
? pubkey.replace(/[^a-zA-Z0-9]/g, "").replace("nostr:", "")
: currentUserPubkey;
if (
hexstring.startsWith("npub1") ||
@@ -127,7 +129,7 @@ export class Ark {
}
const user = this.ndk.getUser({
pubkey: pubkey ? hexstring : currentUserPubkey,
pubkey: hexstring,
});
const profile = await user.fetchProfile({
@@ -144,8 +146,10 @@ export class Ark {
public async getUserContacts(pubkey?: string) {
try {
// get clean pubkey without any special characters
let hexstring = pubkey.replace(/[^a-zA-Z0-9]/g, "").replace("nostr:", "");
const currentUserPubkey = this.#storage.account.pubkey;
let hexstring = pubkey
? pubkey.replace(/[^a-zA-Z0-9]/g, "").replace("nostr:", "")
: currentUserPubkey;
if (
hexstring.startsWith("npub1") ||
@@ -160,7 +164,7 @@ export class Ark {
}
const user = this.ndk.getUser({
pubkey: pubkey ? hexstring : currentUserPubkey,
pubkey: hexstring,
});
const contacts = [...(await user.follows())].map((user) => user.pubkey);

View File

@@ -41,7 +41,7 @@ export function ColumnLiveWidget({
className="inline-flex items-center justify-center h-8 gap-1 pl-2 pr-2.5 text-sm font-semibold rounded-full w-max bg-neutral-950 dark:bg-neutral-50 hover:bg-neutral-900 dark:hover:bg-neutral-100 text-neutral-50 dark:text-neutral-950"
>
<ChevronUpIcon className="w-4 h-4" />
{events.length} {events.length === 1 ? "new event" : "new events"}
{events.length} {events.length === 1 ? "new note" : "new notes"}
</button>
</div>
);