Commit 77b75aa6 authored by Steven's avatar Steven

chore: tweak memo display

parent 9faee68d
This diff is collapsed.
import React, { useState } from "react"; import React, { useState } from "react";
import { getDateTimeString } from "@/helpers/datetime";
import { generateDialog } from "./Dialog"; import { generateDialog } from "./Dialog";
import Icon from "./Icon"; import Icon from "./Icon";
import "@/less/preview-image-dialog.less"; import "@/less/preview-image-dialog.less";
...@@ -35,13 +34,6 @@ const PreviewImageDialog: React.FC<Props> = ({ destroy, imgUrls, initialIndex }: ...@@ -35,13 +34,6 @@ const PreviewImageDialog: React.FC<Props> = ({ destroy, imgUrls, initialIndex }:
destroy(); destroy();
}; };
const handleDownloadBtnClick = () => {
const a = document.createElement("a");
a.href = imgUrls[currentIndex];
a.download = `memos-${getDateTimeString(Date.now())}.png`;
a.click();
};
const handleTouchStart = (event: React.TouchEvent) => { const handleTouchStart = (event: React.TouchEvent) => {
if (event.touches.length > 1) { if (event.touches.length > 1) {
// two or more fingers, ignore // two or more fingers, ignore
...@@ -126,9 +118,6 @@ const PreviewImageDialog: React.FC<Props> = ({ destroy, imgUrls, initialIndex }: ...@@ -126,9 +118,6 @@ const PreviewImageDialog: React.FC<Props> = ({ destroy, imgUrls, initialIndex }:
<button className="btn" onClick={handleCloseBtnClick}> <button className="btn" onClick={handleCloseBtnClick}>
<Icon.X className="icon-img" /> <Icon.X className="icon-img" />
</button> </button>
<button className="btn" onClick={handleDownloadBtnClick}>
<Icon.Download className="icon-img" />
</button>
</div> </div>
<div className="img-container" onClick={handleImgContainerClick}> <div className="img-container" onClick={handleImgContainerClick}>
<img <img
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
} }
> .memo-top-wrapper { > .memo-top-wrapper {
@apply flex flex-row justify-between items-center w-full h-6 mb-1; @apply flex flex-row justify-between items-center w-full h-6;
> .btns-container { > .btns-container {
@apply flex flex-row justify-end items-center relative shrink-0; @apply flex flex-row justify-end items-center relative shrink-0;
......
...@@ -83,7 +83,7 @@ const Explore = () => { ...@@ -83,7 +83,7 @@ const Explore = () => {
<div className="relative w-full h-auto flex flex-col justify-start items-start"> <div className="relative w-full h-auto flex flex-col justify-start items-start">
<MemoFilter /> <MemoFilter />
{sortedMemos.map((memo) => ( {sortedMemos.map((memo) => (
<Memo key={memo.id} memo={memo} lazyRendering /> <Memo key={memo.id} memo={memo} lazyRendering showCreator />
))} ))}
{loadingStatus === "fetching" ? ( {loadingStatus === "fetching" ? (
......
...@@ -210,7 +210,7 @@ const MemoDetail = () => { ...@@ -210,7 +210,7 @@ const MemoDetail = () => {
<span className="text-gray-400 text-sm ml-0.5">({comments.length})</span> <span className="text-gray-400 text-sm ml-0.5">({comments.length})</span>
</div> </div>
{comments.map((comment) => ( {comments.map((comment) => (
<Memo key={comment.id} memo={comment} /> <Memo key={comment.id} memo={comment} showCreator />
))} ))}
</> </>
)} )}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment