chore: update memo props

This commit is contained in:
Steven 2023-10-09 21:09:17 +08:00
parent 425b43b3bb
commit 3822c26e32
4 changed files with 6 additions and 14 deletions

View file

@ -25,7 +25,6 @@ import "@/less/memo.less";
interface Props {
memo: Memo;
showVisibility?: boolean;
showCommentEntry?: boolean;
lazyRendering?: boolean;
}
@ -280,13 +279,6 @@ const Memo: React.FC<Props> = (props: Props) => {
)}
</div>
</div>
{memo.parent && props.showCommentEntry && (
<div>
<Link to={`/m/${memo.parent.id}`}>
<span className="text-xs text-gray-400 opacity-80">This is a comment of #{memo.parent.id}</span>
</Link>
</div>
)}
<MemoContent
content={memo.content}
onMemoContentClick={handleMemoContentClick}

View file

@ -133,7 +133,7 @@ const MemoList: React.FC = () => {
return (
<div className="memo-list-container">
{sortedMemos.map((memo) => (
<Memo key={`${memo.id}-${memo.displayTs}`} memo={memo} lazyRendering showVisibility showCommentEntry />
<Memo key={`${memo.id}-${memo.displayTs}`} memo={memo} lazyRendering showVisibility />
))}
{isFetching ? (
<div className="status-text-container fetching-tip">

View file

@ -93,7 +93,7 @@ const Explore = () => {
<div className="relative w-full h-auto flex flex-col justify-start items-start">
<MemoFilter />
{sortedMemos.map((memo) => {
return <Memo key={`${memo.id}-${memo.displayTs}`} memo={memo} showCommentEntry />;
return <Memo key={`${memo.id}-${memo.displayTs}`} memo={memo} />;
})}
{isComplete ? (
sortedMemos.length === 0 && (

View file

@ -119,16 +119,16 @@ const MemoDetail = () => {
<span className="text-gray-400 dark:text-gray-400">#{memo.id}</span>
</Tooltip>
</div>
<MemoContent content={memo.content} />
<MemoResourceListView resourceList={memo.resourceList} />
<MemoRelationListView relationList={referenceRelations} />
{memo.parent && (
<div className="mb-2">
<div className="w-full mt-2">
<Link to={`/m/${memo.parent.id}`}>
<span className="text-xs text-gray-400 opacity-80">This is a comment of #{memo.parent.id}</span>
</Link>
</div>
)}
<MemoContent content={memo.content} />
<MemoResourceListView resourceList={memo.resourceList} />
<MemoRelationListView relationList={referenceRelations} />
<div className="w-full mt-4 flex flex-col sm:flex-row justify-start sm:justify-between sm:items-center gap-2">
<div className="flex flex-row justify-start items-center">
<Link to={`/u/${encodeURIComponent(memo.creatorUsername)}`}>