mirror of
https://github.com/usememos/memos.git
synced 2024-11-11 01:12:40 +08:00
chore: change memo created time (#556)
This commit is contained in:
parent
1d41d53723
commit
50d41c456b
2 changed files with 11 additions and 1 deletions
|
@ -69,6 +69,9 @@ const ChangeMemoCreatedTsDialog: React.FC<Props> = (props: Props) => {
|
|||
</button>
|
||||
</div>
|
||||
<div className="dialog-content-container">
|
||||
<p className="w-full bg-yellow-100 border border-yellow-400 rounded p-2 text-xs leading-4">
|
||||
THIS IS NOT A NORMAL BEHAVIOR. PLEASE MAKE SURE YOU REALLY NEED IT.
|
||||
</p>
|
||||
<label className="form-label input-form-label">
|
||||
<input type="datetime-local" value={createdAt} max={maxDatetimeValue} onChange={handleDatetimeInputChange} />
|
||||
</label>
|
||||
|
|
|
@ -12,6 +12,7 @@ import MemoContent from "./MemoContent";
|
|||
import MemoResources from "./MemoResources";
|
||||
import showShareMemoImageDialog from "./ShareMemoImageDialog";
|
||||
import showPreviewImageDialog from "./PreviewImageDialog";
|
||||
import showChangeMemoCreatedTsDialog from "./ChangeMemoCreatedTsDialog";
|
||||
import "../less/memo.less";
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
@ -171,6 +172,10 @@ const Memo: React.FC<Props> = (props: Props) => {
|
|||
editorStateService.setEditMemoWithId(memo.id);
|
||||
};
|
||||
|
||||
const handleMemoDisplayTimeClick = () => {
|
||||
showChangeMemoCreatedTsDialog(memo.id);
|
||||
};
|
||||
|
||||
const handleMemoVisibilityClick = (visibility: Visibility) => {
|
||||
const currVisibilityQuery = locationService.getState().query?.visibility;
|
||||
if (currVisibilityQuery === visibility) {
|
||||
|
@ -185,7 +190,9 @@ const Memo: React.FC<Props> = (props: Props) => {
|
|||
{memo.pinned && <div className="corner-container"></div>}
|
||||
<div className="memo-top-wrapper">
|
||||
<div className="status-text-container">
|
||||
<span className="time-text">{displayTimeStr}</span>
|
||||
<span className="time-text" onDoubleClick={handleMemoDisplayTimeClick}>
|
||||
{displayTimeStr}
|
||||
</span>
|
||||
{memo.visibility !== "PRIVATE" && !isVisitorMode && (
|
||||
<span
|
||||
className={`status-text ${memo.visibility.toLocaleLowerCase()}`}
|
||||
|
|
Loading…
Reference in a new issue