mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-05 04:43:40 +00:00
Fix show more button
This commit is contained in:
parent
0a15170757
commit
8b3de91408
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user