chore: format and lint

This commit is contained in:
Ren Amamiya
2026-04-08 11:28:39 +07:00
parent 5b7b06ff5d
commit 387796faa3
26 changed files with 28646 additions and 25809 deletions

View File

@@ -1,15 +1,15 @@
import browser from 'webextension-polyfill'
import {render} from 'react-dom'
import {getPublicKey, nip19} from 'nostr-tools'
import React, {useState, useMemo, useEffect} from 'react'
import { render } from 'react-dom'
import { getPublicKey, nip19 } from 'nostr-tools'
import { useState, useMemo, useEffect } from 'react'
import QRCode from 'react-qr-code'
import {SettingsIcon} from './icons'
import {minidenticon} from 'minidenticons'
import { SettingsIcon } from './icons'
import { minidenticon } from 'minidenticons'
import * as Tabs from '@radix-ui/react-tabs'
function Popup() {
let [keys, setKeys] = useState(null)
let avatarURI = useMemo(
const [keys, setKeys] = useState(null)
const avatarURI = useMemo(
() =>
keys
? 'data:image/svg+xml;utf8,' +
@@ -25,27 +25,27 @@ function Popup() {
}
useEffect(() => {
browser.storage.local.get(['private_key', 'relays']).then(results => {
browser.storage.local.get(['private_key', 'relays']).then((results) => {
if (results.private_key) {
let hexKey = getPublicKey(results.private_key)
let npubKey = nip19.npubEncode(hexKey)
const hexKey = getPublicKey(results.private_key)
const npubKey = nip19.npubEncode(hexKey)
setKeys({npub: npubKey, hex: hexKey})
setKeys({ npub: npubKey, hex: hexKey })
if (results.relays) {
let relaysList = []
for (let url in results.relays) {
const relaysList = []
for (const url in results.relays) {
if (results.relays[url].write) {
relaysList.push(url)
if (relaysList.length >= 3) break
}
}
if (relaysList.length) {
let nprofileKey = nip19.nprofileEncode({
const nprofileKey = nip19.nprofileEncode({
pubkey: hexKey,
relays: relaysList
})
setKeys(prev => ({...prev, nprofile: nprofileKey}))
setKeys((prev) => ({ ...prev, nprofile: nprofileKey }))
}
}
} else {
@@ -71,6 +71,7 @@ function Popup() {
strokeWidth={1.5}
stroke="currentColor"
className="w-6 h-6"
aria-hidden="true"
>
<path
strokeLinecap="round"
@@ -95,6 +96,7 @@ function Popup() {
<img
src={avatarURI}
className="w-9 h-9 rounded-full bg-muted"
alt="Avatar"
/>
) : (
<div className="w-9 h-9 rounded-full bg-muted" />