diff options
author | crupest <crupest@outlook.com> | 2021-01-13 17:06:43 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-13 17:06:55 +0800 |
commit | af90b402dae2f4b9406c815865df9de034d59f87 (patch) | |
tree | acb9cf4e310c5170795b16ff31afb95df707e3c7 /FrontEnd/src/app/views/timeline-common/TimelineItem.tsx | |
parent | 12e12dff4fb83e125a47b62a2c4be335363de089 (diff) | |
download | timeline-af90b402dae2f4b9406c815865df9de034d59f87.tar.gz timeline-af90b402dae2f4b9406c815865df9de034d59f87.tar.bz2 timeline-af90b402dae2f4b9406c815865df9de034d59f87.zip |
...
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelineItem.tsx')
-rw-r--r-- | FrontEnd/src/app/views/timeline-common/TimelineItem.tsx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelineItem.tsx b/FrontEnd/src/app/views/timeline-common/TimelineItem.tsx index 74431402..c096f890 100644 --- a/FrontEnd/src/app/views/timeline-common/TimelineItem.tsx +++ b/FrontEnd/src/app/views/timeline-common/TimelineItem.tsx @@ -1,7 +1,6 @@ import React from "react"; import clsx from "clsx"; import { Link } from "react-router-dom"; -import { useTranslation } from "react-i18next"; import { useAvatar } from "@/services/user"; import { TimelinePostInfo } from "@/services/timeline"; @@ -24,8 +23,6 @@ export interface TimelineItemProps { } const TimelineItem: React.FC<TimelineItemProps> = (props) => { - const { i18n } = useTranslation(); - const current = props.current === true; const { more } = props; @@ -42,6 +39,15 @@ const TimelineItem: React.FC<TimelineItemProps> = (props) => { > <TimelineLine center="node" current={current} /> <div className="timeline-item-card"> + {more != null ? ( + <i + className="bi-chevron-down text-info icon-button float-right" + onClick={(e) => { + more.toggle(); + e.stopPropagation(); + }} + /> + ) : null} <div className="timeline-item-header"> <span className="mr-2"> <span> @@ -52,19 +58,10 @@ const TimelineItem: React.FC<TimelineItemProps> = (props) => { {props.post.author.nickname} </small> <small className="text-secondary white-space-no-wrap"> - {props.post.time.toLocaleString(i18n.languages)} + {props.post.time.toLocaleTimeString()} </small> </span> </span> - {more != null ? ( - <i - className="bi-chevron-down text-info icon-button" - onClick={(e) => { - more.toggle(); - e.stopPropagation(); - }} - /> - ) : null} </div> <div className="timeline-content"> {(() => { |