mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-18 19:23:40 +00:00
Fix show more button
This commit is contained in:
parent
0a15170757
commit
8b3de91408
@ -1,5 +1,7 @@
|
|||||||
# Current
|
# Current
|
||||||
|
|
||||||
|
- [ ] nsec bunker support
|
||||||
|
- [ ] Add relayset support with kind 30022
|
||||||
- [ ] White-labeled
|
- [ ] White-labeled
|
||||||
- [ ] Add invite code registration for relay
|
- [ ] Add invite code registration for relay
|
||||||
- [ ] Add endpoint to nostream that updates whitelist
|
- [ ] Add endpoint to nostream that updates whitelist
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
export let anchorId = null
|
export let anchorId = null
|
||||||
export let maxLength = 700
|
export let maxLength = 700
|
||||||
export let showEntire = false
|
export let showEntire = false
|
||||||
export let hideShowMore = true
|
export let expandable = true
|
||||||
export let showMedia = user.getSetting("showMedia")
|
export let showMedia = user.getSetting("showMedia")
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
{:else if note.kind === 30023}
|
{:else if note.kind === 30023}
|
||||||
<NoteContentKind30023 {note} {showEntire} {showMedia} />
|
<NoteContentKind30023 {note} {showEntire} {showMedia} />
|
||||||
{:else}
|
{:else}
|
||||||
<NoteContentKind1 {note} {anchorId} {maxLength} {showEntire} {showMedia} {hideShowMore}>
|
<NoteContentKind1 {note} {anchorId} {maxLength} {showEntire} {showMedia} {expandable}>
|
||||||
<div slot="note-content" let:quote>
|
<div slot="note-content" let:quote>
|
||||||
<svelte:self note={quote} {anchorId} {maxLength} />
|
<svelte:self note={quote} {anchorId} {maxLength} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,13 +25,15 @@
|
|||||||
export let anchorId = false
|
export let anchorId = false
|
||||||
export let showEntire = false
|
export let showEntire = false
|
||||||
export let showMedia = false
|
export let showMedia = false
|
||||||
export let hideShowMore = false
|
export let expandable = true
|
||||||
|
|
||||||
const fullContent = parseContent(note)
|
const fullContent = parseContent(note)
|
||||||
const shortContent = truncateContent(fullContent, {maxLength, showEntire, showMedia})
|
const shortContent = truncateContent(fullContent, {maxLength, showEntire, showMedia})
|
||||||
const links = getLinks(shortContent)
|
const links = getLinks(shortContent)
|
||||||
const extraLinks = without(links, getLinks(fullContent))
|
const extraLinks = without(links, getLinks(fullContent))
|
||||||
|
|
||||||
|
console.log(fullContent, shortContent)
|
||||||
|
|
||||||
export const isNewline = i =>
|
export const isNewline = i =>
|
||||||
!shortContent[i] ||
|
!shortContent[i] ||
|
||||||
shortContent[i].type === NEWLINE ||
|
shortContent[i].type === NEWLINE ||
|
||||||
@ -46,7 +48,7 @@
|
|||||||
{#if type === NEWLINE}
|
{#if type === NEWLINE}
|
||||||
<NoteContentNewline {value} />
|
<NoteContentNewline {value} />
|
||||||
{:else if type === ELLIPSIS}
|
{:else if type === ELLIPSIS}
|
||||||
{#if !hideShowMore}
|
{#if expandable}
|
||||||
<NoteContentEllipsis />
|
<NoteContentEllipsis />
|
||||||
{/if}
|
{/if}
|
||||||
{:else if type === TOPIC}
|
{:else if type === TOPIC}
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="break-word overflow-hidden text-gray-1">
|
<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>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user