Re-organize profile and note actions

This commit is contained in:
Jonathan Staab 2023-04-05 12:40:36 -05:00
parent b563a6b291
commit b32a50ede9
3 changed files with 28 additions and 19 deletions

View File

@ -6,6 +6,11 @@
- Call close onbeforeunload to save pending changes
- [ ] Fix iOS/safari/firefox
- [ ] Revisit profile page and info, include similar access to hex keys etc on notes, keys page
- [ ] Add full profile details to key page
- [ ] Make profile edit more obvious
- [ ] Maybe consolidate settings pages into several sections, each with a modal
- [ ] Add zaps to likes tab
- [ ] Add like and zap details to note details
- [ ] Image classification
- https://github.com/bhky/opennsfw2
- Requires updating my OS -_-

View File

@ -56,7 +56,7 @@
$: muted = find(m => m[1] === pubkey, $mutes)
$: {
actions = [{onClick: share, label: "Share", icon: "share-nodes"}]
actions = []
if ($canPublish) {
if (following) {
@ -64,22 +64,26 @@
} else if (user.getPubkey() !== pubkey) {
actions.push({onClick: follow, label: "Follow", icon: "user-plus"})
}
}
if (muted) {
actions.push({onClick: unmute, label: "Muted", icon: "microphone-slash"})
} else if (user.getPubkey() !== pubkey) {
actions.push({onClick: mute, label: "Mute", icon: "microphone"})
}
actions.push({onClick: share, label: "Share", icon: "share-nodes"})
if (user.getPubkey() !== pubkey && $canPublish) {
actions.push({
onClick: () => navigate(`/messages/${npub}`),
label: "Message",
icon: "envelope",
})
if (muted) {
actions.push({onClick: unmute, label: "Unmute", icon: "microphone"})
} else if (user.getPubkey() !== pubkey) {
actions.push({onClick: mute, label: "Mute", icon: "microphone-slash"})
}
}
if (pool.forceUrls.length === 0) {
actions.push({onClick: openProfileInfo, label: "Profile", icon: "info"})
actions.push({onClick: openProfileInfo, label: "Details", icon: "info"})
}
if (user.getPubkey() === pubkey && $canPublish) {

View File

@ -125,17 +125,7 @@
$: {
actions = []
if (pool.forceUrls.length === 0) {
actions.push({
label: "Relays",
icon: "server",
onClick: () => {
showRelays = true
},
})
}
actions.push({label: "Permalink", icon: "link", onClick: copyLink})
actions.push({label: "Share", icon: "share-nodes", onClick: copyLink})
actions.push({label: "Quote", icon: "quote-left", onClick: quote})
if (muted) {
@ -143,6 +133,16 @@
} else {
actions.push({label: "Mute", icon: "microphone-slash", onClick: mute})
}
if (pool.forceUrls.length === 0) {
actions.push({
label: "Details",
icon: "info",
onClick: () => {
showRelays = true
},
})
}
}
const onClick = e => {
@ -302,7 +302,7 @@
const nevent = nip19.neventEncode({id: note.id, relays: [note.seen_on]})
copyToClipboard("nostr:" + nevent)
toast.show("info", "Copied to clipboard!")
toast.show("info", "Note link copied to clipboard!")
}
const quote = () => {