diff --git a/src/models/Note.ts b/src/models/Note.ts index 7453528..f668c79 100644 --- a/src/models/Note.ts +++ b/src/models/Note.ts @@ -17,6 +17,7 @@ export interface Note { replyId: string | null; reply?: Note; text: string | null; + myReaction?: string; uri: string | null; url: string | null; user: User, diff --git a/src/views/_base.pug b/src/views/_base.pug index cb1d545..c231019 100644 --- a/src/views/_base.pug +++ b/src/views/_base.pug @@ -1,16 +1,38 @@ 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) - .note(id=note.id) - +avatar(note.user) - p: b=getUserName(note.user) - |   - span(style="color: gray")= getAcct(note.user) - p= note.text - aside - !=getVisibility(note) - !=new Date(note.createdAt).toLocaleString() + 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) + +note-header(note) + p + if (note.reply) + | ↩ + != note.text + if (note.renote) + p RN: + .sub-note + +avatar(note.renote.user) + +note-header(note.renote) + p= note.renote.text + aside + span.visibility= getVisibility(note) + 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 head diff --git a/src/views/timeline.pug b/src/views/timeline.pug index a3cf113..3c44a34 100644 --- a/src/views/timeline.pug +++ b/src/views/timeline.pug @@ -21,9 +21,5 @@ block content a(href="/settings") 設定 h2= timelineName each note in timeline - if (note.renote) - p: b 🔁 !{getUserName(note.user)} がRenote - +note(note.renote) - else - +note(note) + +note(note) hr \ No newline at end of file