mirror of
https://github.com/usememos/memos.git
synced 2025-01-06 23:36:31 +03:00
fix: memo content availability for visitor mode (#1605)
This commit is contained in:
parent
fab8a71fd2
commit
3fad718807
@ -32,7 +32,8 @@ const MemoContent: React.FC<Props> = (props: Props) => {
|
|||||||
|
|
||||||
//variable for auto-collapse
|
//variable for auto-collapse
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const { localSetting } = userStore.state.user as User;
|
const isVisitorMode = userStore.isVisitorMode();
|
||||||
|
const autoCollapse: boolean = isVisitorMode ? true : (userStore.state.user as User).localSetting.enableAutoCollapse;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (showFull) {
|
if (showFull) {
|
||||||
@ -72,15 +73,13 @@ const MemoContent: React.FC<Props> = (props: Props) => {
|
|||||||
<div className={`memo-content-wrapper ${className || ""}`}>
|
<div className={`memo-content-wrapper ${className || ""}`}>
|
||||||
<div
|
<div
|
||||||
ref={memoContentContainerRef}
|
ref={memoContentContainerRef}
|
||||||
className={`memo-content-text ${
|
className={`memo-content-text ${autoCollapse && state.expandButtonStatus === 0 ? "max-h-64 overflow-y-hidden" : ""}`}
|
||||||
localSetting.enableAutoCollapse && state.expandButtonStatus === 0 ? "max-h-64 overflow-y-hidden" : ""
|
|
||||||
}`}
|
|
||||||
onClick={handleMemoContentClick}
|
onClick={handleMemoContentClick}
|
||||||
onDoubleClick={handleMemoContentDoubleClick}
|
onDoubleClick={handleMemoContentDoubleClick}
|
||||||
>
|
>
|
||||||
{marked(content)}
|
{marked(content)}
|
||||||
</div>
|
</div>
|
||||||
{localSetting.enableAutoCollapse && state.expandButtonStatus !== -1 && (
|
{autoCollapse && state.expandButtonStatus !== -1 && (
|
||||||
<div className={`expand-btn-container ${state.expandButtonStatus === 0 && "!-mt-7"}`}>
|
<div className={`expand-btn-container ${state.expandButtonStatus === 0 && "!-mt-7"}`}>
|
||||||
<div className="absolute top-0 left-0 w-full h-full blur-lg bg-white dark:bg-zinc-700"></div>
|
<div className="absolute top-0 left-0 w-full h-full blur-lg bg-white dark:bg-zinc-700"></div>
|
||||||
<span className={`btn z-10 ${state.expandButtonStatus === 0 ? "expand-btn" : "fold-btn"}`} onClick={handleExpandBtnClick}>
|
<span className={`btn z-10 ${state.expandButtonStatus === 0 ? "expand-btn" : "fold-btn"}`} onClick={handleExpandBtnClick}>
|
||||||
|
Loading…
Reference in New Issue
Block a user