renoteとreplyの表示サポート

This commit is contained in:
Xeltica 2020-07-24 02:44:58 +09:00
parent dbd58fc39d
commit 1676816373
3 changed files with 34 additions and 15 deletions

View File

@ -17,6 +17,7 @@ export interface Note {
replyId: string | null; replyId: string | null;
reply?: Note; reply?: Note;
text: string | null; text: string | null;
myReaction?: string;
uri: string | null; uri: string | null;
url: string | null; url: string | null;
user: User, user: User,

View File

@ -1,16 +1,38 @@
mixin avatar(user) mixin avatar(user)
img.avatar(src=user.avatarUrl, alt="avatar for " + user.username style="width: 64px; height: 64px; border-radius: 50%") img.avatar(src=user.avatarUrl, alt="avatar for " + user.username style="width: 64px; height: 64px; border-radius: 50%")&attributes(attributes)
mixin note-header(note)
div.header&attributes(attributes)
span.name= getUserName(note.user)
span.acct(style="color: gray")= getAcct(note.user)
mixin note(note) mixin note(note)
.note(id=note.id) if (note.reply)
+note(note.reply)(style="opacity: 0.5")
if (note.renote && !note.text)
p: b 🔁 !{getUserName(note.user)} がRenote
+note(note.renote)
else
.note&attributes(attributes)
+avatar(note.user) +avatar(note.user)
p: b=getUserName(note.user) +note-header(note)
|   p
span(style="color: gray")= getAcct(note.user) if (note.reply)
p= note.text | ↩
!= note.text
if (note.renote)
p RN:
.sub-note
+avatar(note.renote.user)
+note-header(note.renote)
p= note.renote.text
aside aside
!=getVisibility(note) span.visibility= getVisibility(note)
!=new Date(note.createdAt).toLocaleString() span.date= new Date(note.createdAt).toLocaleString()
.reactions
each val, key in note.reactions
span(class=(key === note.myReaction ? 'my reaction' : 'reaction'))=`${key} ${val}`
html html
head head

View File

@ -21,9 +21,5 @@ block content
a(href="/settings") 設定 a(href="/settings") 設定
h2= timelineName h2= timelineName
each note in timeline each note in timeline
if (note.renote)
p: b 🔁 !{getUserName(note.user)} がRenote
+note(note.renote)
else
+note(note) +note(note)
hr hr