chore: update memo display time (#327)

* chore: update memo display time

* chore: update
This commit is contained in:
boojack
2022-10-21 20:26:00 +08:00
committed by GitHub
parent b68d6e2693
commit 2a4fc7dcc3
17 changed files with 59 additions and 73 deletions

View File

@ -12,12 +12,7 @@ interface Props {
}
const ArchivedMemo: React.FC<Props> = (props: Props) => {
const { memo: propsMemo } = props;
const memo = {
...propsMemo,
createdAtStr: utils.getDateTimeString(propsMemo.createdTs),
archivedAtStr: utils.getDateTimeString(propsMemo.updatedTs ?? Date.now()),
};
const { memo } = props;
const { t } = useTranslation();
const [showConfirmDeleteBtn, toggleConfirmDeleteBtn] = useToggle(false);
@ -60,7 +55,7 @@ const ArchivedMemo: React.FC<Props> = (props: Props) => {
<div className={`memo-wrapper archived-memo ${"memos-" + memo.id}`} onMouseLeave={handleMouseLeaveMemoWrapper}>
<div className="memo-top-wrapper">
<span className="time-text">
{t("common.archived-at")} {memo.archivedAtStr}
{t("common.archived-at")} {utils.getDateTimeString(memo.updatedTs)}
</span>
<div className="btns-container">
<span className="btn restore-btn" onClick={handleRestoreMemoClick}>