토픽 목록 및 카테고리에서 좋아요 표시 - Reddit 스타일 테마

Moin, 감사합니다. 테마를 포크하고 javascripts/discourse/connectors/topic-list-item/item.gjs 파일을 수정했습니다.

누군가에게 도움이 되길 바랍니다.

  1. 아래에 이 코드를 추가했습니다.
get likeCount() {
  return (
    this.args.outletArgs.topic.like_count ??
    this.args.outletArgs.topic.likeCount ??
    0
  );
}

아래 코드 바로 아래에 추가했습니다:

@action
share(event) {
  event.stopPropagation();

  this.modal.show(ShareTopicModal, {
    model: { topic: this.args.outletArgs.topic },
  });
}

get likeCount() {
  return (
    this.args.outletArgs.topic.like_count ??
    this.args.outletArgs.topic.likeCount ??
    0
  );
}

<template>
  1. 그리고 이 부분을
<div class="custom-topic-layout_bottom-bar">
  <span class="reply-count">
    {{icon "reply"}}
    {{@outletArgs.topic.replyCount}}
    {{i18n "replies"}}
  </span>

다음과 같이 변경했습니다:

<div class="custom-topic-layout_bottom-bar">
  <span class="like-count">
    {{icon "heart"}}
    {{this.likeCount}}
    Likes
  </span>

  <span class="reply-count">
    {{icon "reply"}}
    {{@outletArgs.topic.replyCount}}
    {{i18n "replies"}}
  </span>```