Fix show more button

This commit is contained in:
Jonathan Staab 2023-06-29 08:45:04 -07:00
parent 0a15170757
commit 8b3de91408
4 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,7 @@
# Current
- [ ] nsec bunker support
- [ ] Add relayset support with kind 30022
- [ ] White-labeled
- [ ] Add invite code registration for relay
- [ ] Add endpoint to nostream that updates whitelist

View File

@ -11,7 +11,7 @@
export let anchorId = null
export let maxLength = 700
export let showEntire = false
export let hideShowMore = true
export let expandable = true
export let showMedia = user.getSetting("showMedia")
</script>
@ -26,7 +26,7 @@
{:else if note.kind === 30023}
<NoteContentKind30023 {note} {showEntire} {showMedia} />
{:else}
<NoteContentKind1 {note} {anchorId} {maxLength} {showEntire} {showMedia} {hideShowMore}>
<NoteContentKind1 {note} {anchorId} {maxLength} {showEntire} {showMedia} {expandable}>
<div slot="note-content" let:quote>
<svelte:self note={quote} {anchorId} {maxLength} />
</div>

View File

@ -25,13 +25,15 @@
export let anchorId = false
export let showEntire = false
export let showMedia = false
export let hideShowMore = false
export let expandable = true
const fullContent = parseContent(note)
const shortContent = truncateContent(fullContent, {maxLength, showEntire, showMedia})
const links = getLinks(shortContent)
const extraLinks = without(links, getLinks(fullContent))
console.log(fullContent, shortContent)
export const isNewline = i =>
!shortContent[i] ||
shortContent[i].type === NEWLINE ||
@ -46,7 +48,7 @@
{#if type === NEWLINE}
<NoteContentNewline {value} />
{:else if type === ELLIPSIS}
{#if !hideShowMore}
{#if expandable}
<NoteContentEllipsis />
{/if}
{:else if type === TOPIC}

View File

@ -75,7 +75,7 @@
</small>
</div>
<div class="break-word overflow-hidden text-gray-1">
<NoteContent maxLength={80} hideShowMore showMedia={false} {note} />
<NoteContent maxLength={80} expandable={false} showMedia={false} {note} />
</div>
</Card>
</div>