@ -3,7 +3,7 @@ import { escape, indexOf } from "lodash-es";
import { IMAGE_URL_REG , LINK_REG , MEMO_LINK_REG , TAG_REG , UNKNOWN_ID } from "../helpers/consts" ;
import { DONE_BLOCK_REG , parseMarkedToHtml , TODO_BLOCK_REG } from "../helpers/marked" ;
import * as utils from "../helpers/utils" ;
import { editorStateService , locationService , memoService } from "../services" ;
import { editorStateService , locationService , memoService , userService } from "../services" ;
import Only from "./common/OnlyWhen" ;
import Image from "./Image" ;
import showMemoCardDialog from "./MemoCardDialog" ;
@ -112,7 +112,7 @@ const Memo: React.FC<Props> = (props: Props) => {
} else {
locationService . setTagQuery ( tagName ) ;
}
} else if ( targetEl . classList . contains ( "todo-block" ) ) {
} else if ( targetEl . classList . contains ( "todo-block" ) && userService . isNotVisitor ( ) ) {
const status = targetEl . dataset ? . value ;
const todoElementList = [ . . . ( memoContainerRef . current ? . querySelectorAll ( ` span.todo-block[data-value= ${ status } ] ` ) ? ? [ ] ) ] ;
for ( const element of todoElementList ) {
@ -158,38 +158,40 @@ const Memo: React.FC<Props> = (props: Props) => {
< span className = "ml-2" > PINNED < / span >
< / Only >
< / span >
< div className = "btns-container" >
< span className = "btn more-action-btn" >
< img className = "icon-img" src = "/icons/more.svg" / >
< / span >
< div className = "more-action-btns-wrapper" >
< div className = "more-action-btns-container" >
< div className = "btns-container" >
< div className = "btn" onClick = { handleTogglePinMemoBtnClick } >
< img className = "icon-img" src = "/icons/pin.svg" alt = "" / >
< span className = "tip-text" > { memo . pinned ? "Unpin" : "Pin" } < / span >
< / div >
< div className = "btn" onClick = { handleEditMemoClick } >
< img className = "icon-img" src = "/icons/edit.svg" alt = "" / >
< span className = "tip-text" > Edit < / span >
< / div >
< div className = "btn" onClick = { handleGenMemoImageBtnClick } >
< img className = "icon-img" src = "/icons/share.svg" alt = "" / >
< span className = "tip-text" > Share < / span >
{ userService . isNotVisitor ( ) && (
< div className = "btns-container" >
< span className = "btn more-action-btn" >
< img className = "icon-img" src = "/icons/more.svg" / >
< / span >
< div className = "more-action-btns-wrapper" >
< div className = "more-action-btns-container" >
< div className = "btns-container" >
< div className = "btn" onClick = { handleTogglePinMemoBtnClick } >
< img className = "icon-img" src = "/icons/pin.svg" alt = "" / >
< span className = "tip-text" > { memo . pinned ? "Unpin" : "Pin" } < / span >
< / div >
< div className = "btn" onClick = { handleEditMemoClick } >
< img className = "icon-img" src = "/icons/edit.svg" alt = "" / >
< span className = "tip-text" > Edit < / span >
< / div >
< div className = "btn" onClick = { handleGenMemoImageBtnClick } >
< img className = "icon-img" src = "/icons/share.svg" alt = "" / >
< span className = "tip-text" > Share < / span >
< / div >
< / div >
< span className = "btn" onClick = { handleMarkMemoClick } >
Mark
< / span >
< span className = "btn" onClick = { handleShowMemoStoryDialog } >
View Story
< / span >
< span className = "btn archive-btn" onClick = { handleArchiveMemoClick } >
Archive
< / span >
< / div >
< span className = "btn" onClick = { handleMarkMemoClick } >
Mark
< / span >
< span className = "btn" onClick = { handleShowMemoStoryDialog } >
View Story
< / span >
< span className = "btn archive-btn" onClick = { handleArchiveMemoClick } >
Archive
< / span >
< / div >
< / div >
</ div >
) }
< / div >
< div
ref = { memoContainerRef }