final design (#184)
* feat: redesign * feat: update other columns to new design * chore: small fixes * fix: better manage external webview * feat: redesign note * feat: update ui * chore: update * chore: update * chore: polish ui * chore: update auth ui * feat: finalize note design * chore: small fixes * feat: add window management in rust * chore: format * feat: update ui for event screen * feat: update event screen * feat: final
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { BitcoinUnit } from "bitcoin-units";
|
||||
import dayjs from "dayjs";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
import updateLocale from "dayjs/plugin/updateLocale";
|
||||
import { nip19 } from "nostr-tools";
|
||||
import { AUDIOS, IMAGES, VIDEOS } from "./constants";
|
||||
import { BitcoinUnit } from "bitcoin-units";
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(updateLocale);
|
||||
@@ -61,10 +60,7 @@ export function displayNsec(key: string, len: number) {
|
||||
}
|
||||
|
||||
export function displayNpub(pubkey: string, len: number) {
|
||||
const npub = pubkey.startsWith("npub1")
|
||||
? pubkey
|
||||
: (nip19.npubEncode(pubkey) as string);
|
||||
if (npub.length <= len) return npub;
|
||||
if (pubkey.length <= len) return pubkey;
|
||||
|
||||
const separator = " ... ";
|
||||
|
||||
@@ -74,9 +70,9 @@ export function displayNpub(pubkey: string, len: number) {
|
||||
const backChars = Math.floor(charsToShow / 2);
|
||||
|
||||
return (
|
||||
npub.substr(0, frontChars) +
|
||||
pubkey.substr(0, frontChars) +
|
||||
separator +
|
||||
npub.substr(npub.length - backChars)
|
||||
pubkey.substr(pubkey.length - backChars)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user