mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-13 15:09:12 +00:00
feat: add REACTIONS environment variable and integrate it into item component
This commit is contained in:
@@ -23,6 +23,7 @@ STATIC_PROXY=""
|
|||||||
GOOGLE_SEARCH_SITE=""
|
GOOGLE_SEARCH_SITE=""
|
||||||
TAGS=""
|
TAGS=""
|
||||||
COMMENTS=""
|
COMMENTS=""
|
||||||
|
REACTIONS=""
|
||||||
LINKS=""
|
LINKS=""
|
||||||
NAVS=""
|
NAVS=""
|
||||||
RSS_BEAUTIFY=""
|
RSS_BEAUTIFY=""
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const { post, isItem } = Astro.props
|
|||||||
|
|
||||||
const channel = getEnv(import.meta.env, Astro, 'CHANNEL')
|
const channel = getEnv(import.meta.env, Astro, 'CHANNEL')
|
||||||
const COMMENTS = getEnv(import.meta.env, Astro, 'COMMENTS')
|
const COMMENTS = getEnv(import.meta.env, Astro, 'COMMENTS')
|
||||||
|
const REACTIONS = getEnv(import.meta.env, Astro, 'REACTIONS')
|
||||||
|
|
||||||
const datetime = dayjs(post.datetime).tz(timezone)
|
const datetime = dayjs(post.datetime).tz(timezone)
|
||||||
const timeago = datetime.isBefore(dayjs().subtract(1, 'w')) ? datetime.format('HH:mm · ll · ddd') : datetime.fromNow()
|
const timeago = datetime.isBefore(dayjs().subtract(1, 'w')) ? datetime.format('HH:mm · ll · ddd') : datetime.fromNow()
|
||||||
@@ -30,7 +31,7 @@ const timeago = datetime.isBefore(dayjs().subtract(1, 'w')) ? datetime.format('H
|
|||||||
</div>
|
</div>
|
||||||
{post.content.length > 0 && <div class={`text-box content`} set:html={post.content} />}
|
{post.content.length > 0 && <div class={`text-box content`} set:html={post.content} />}
|
||||||
{
|
{
|
||||||
post.reactions?.length > 0 && (
|
REACTIONS && post.reactions?.length > 0 && (
|
||||||
<div class="reaction-box">
|
<div class="reaction-box">
|
||||||
<div class="reaction-list">
|
<div class="reaction-list">
|
||||||
{post.reactions.map((reaction) => (
|
{post.reactions.map((reaction) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user