mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Handle missing notes
This commit is contained in:
parent
7c13ded03c
commit
913c478e9e
@ -36,6 +36,21 @@
|
||||
background-color: var(--background-card);
|
||||
}
|
||||
|
||||
.missingNote {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
p {
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
line-height: 34px;
|
||||
padding-inline: 20px;
|
||||
margin: 2px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 720px) {
|
||||
.border {
|
||||
height: 36px;
|
||||
|
@ -16,7 +16,7 @@ import { sortByRecency } from '../stores/note';
|
||||
import { scrollWindowTo } from '../lib/scroll';
|
||||
import { useIntl } from '@cookbook/solid-intl';
|
||||
import Search from '../components/Search/Search';
|
||||
import { thread as t } from '../translations';
|
||||
import { placeholders as tPlaceholders, thread as t } from '../translations';
|
||||
import { userName } from '../stores/profile';
|
||||
import PageTitle from '../components/PageTitle/PageTitle';
|
||||
import NavHeader from '../components/NavHeader/NavHeader';
|
||||
@ -181,31 +181,42 @@ const Thread: Component = () => {
|
||||
}
|
||||
</For>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
<Show when={primaryNote()}>
|
||||
<div id="primary_note">
|
||||
<NotePrimary
|
||||
note={primaryNote() as PrimalNote}
|
||||
/>
|
||||
<Show when={account?.hasPublicKey()}>
|
||||
<ReplyToNote
|
||||
<Show
|
||||
when={primaryNote()}
|
||||
fallback={
|
||||
<div class={styles.missingNote}>
|
||||
<p>
|
||||
{intl.formatMessage(tPlaceholders.missingNote.firstLine)}
|
||||
</p>
|
||||
<p>
|
||||
{intl.formatMessage(tPlaceholders.missingNote.secondLine)}
|
||||
</p>
|
||||
</div>
|
||||
}>
|
||||
<div id="primary_note">
|
||||
<NotePrimary
|
||||
note={primaryNote() as PrimalNote}
|
||||
onNotePosted={onNotePosted}
|
||||
/>
|
||||
</Show>
|
||||
<Show when={account?.hasPublicKey()}>
|
||||
<ReplyToNote
|
||||
note={primaryNote() as PrimalNote}
|
||||
onNotePosted={onNotePosted}
|
||||
/>
|
||||
</Show>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
<div class={styles.repliesHolder} ref={repliesHolder}>
|
||||
<For each={replyNotes()}>
|
||||
{note =>
|
||||
<div>
|
||||
<Note note={note} shorten={true} />
|
||||
</div>
|
||||
}
|
||||
</For>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
<div class={styles.repliesHolder} ref={repliesHolder}>
|
||||
<For each={replyNotes()}>
|
||||
{note =>
|
||||
<div>
|
||||
<Note note={note} shorten={true} />
|
||||
</div>
|
||||
}
|
||||
</For>
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
)
|
||||
|
@ -992,6 +992,18 @@ export const notifications = {
|
||||
};
|
||||
|
||||
export const placeholders = {
|
||||
missingNote: {
|
||||
firstLine: {
|
||||
id: 'placeholders.missingNote.firstLine',
|
||||
defaultMessage: 'Oups! We can\'t seem to find this note.',
|
||||
description: 'Placeholder when the note is missing',
|
||||
},
|
||||
secondLine: {
|
||||
id: 'placeholders.missingNote.secondLine',
|
||||
defaultMessage: 'It may have been deleted by the author.',
|
||||
description: 'Placeholder when the note is missing',
|
||||
},
|
||||
},
|
||||
noLikeDetails: {
|
||||
id: 'placeholders.noLikeDetails',
|
||||
defaultMessage: 'No details for likes found',
|
||||
|
Loading…
Reference in New Issue
Block a user