[front/perf] show voteup and comment count
This commit is contained in:
parent
4c05a47117
commit
6f5c2987b3
1 changed files with 16 additions and 9 deletions
|
@ -71,10 +71,10 @@
|
||||||
get-more (fn [event params]
|
get-more (fn [event params]
|
||||||
(.preventDefault event)
|
(.preventDefault event)
|
||||||
(dispatch [:get-more params])
|
(dispatch [:get-more params])
|
||||||
(dispatch [:set-history {:id (get-in params [:request :id])
|
(dispatch [:set-history
|
||||||
|
{:id (get-in params [:request :id])
|
||||||
:type :question
|
:type :question
|
||||||
:query (get-in params [:request :query])
|
:query (get-in params [:request :query])}]))]
|
||||||
}]))]
|
|
||||||
(if (:question loading)
|
(if (:question loading)
|
||||||
[:p "Loading..."]
|
[:p "Loading..."]
|
||||||
[:div
|
[:div
|
||||||
|
@ -91,11 +91,18 @@
|
||||||
(-> answer :author :name)]]
|
(-> answer :author :name)]]
|
||||||
[:div
|
[:div
|
||||||
{:dangerouslySetInnerHTML
|
{:dangerouslySetInnerHTML
|
||||||
{:__html (:content answer)}}]])]
|
{:__html (:content answer)}}]
|
||||||
(if end?
|
[:div {:class "text-slate-500 my-2.5"}
|
||||||
[:p {:class "mt-5"} "answers end here."]
|
[:p "发布于" (.toLocaleString (js/Date. (* (:created_time answer) 1000)) "zh-CN" {:timezone "UTC"})]
|
||||||
|
(when (not= (:created_time answer) (:updated_time answer))
|
||||||
|
[:p "编辑于" (.toLocaleString (js/Date. (* (:updated_time answer) 1000)) "zh-CN" {:timezone "UTC"})])]
|
||||||
|
[:div {:class "flex gap-4"}
|
||||||
|
[:span "🔼" (:voteup_count answer)]
|
||||||
|
[:span "🗨️️" (:comment_count answer)]]])]
|
||||||
(if (:more loading)
|
(if (:more loading)
|
||||||
[:p {:class "mt-5"} "loading more..."]
|
[:p {:class "mt-5"} "loading more..."]
|
||||||
|
(if end?
|
||||||
|
[:p {:class "mt-5"} "answers end here."]
|
||||||
[:div {:class "mt-5"}
|
[:div {:class "mt-5"}
|
||||||
[:button
|
[:button
|
||||||
{:type "button"
|
{:type "button"
|
||||||
|
|
Loading…
Reference in a new issue