File tree Expand file tree Collapse file tree
frontend/components/Bookmark Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ interface BookmarkProp {
2727 */
2828async function addTagToBookmark (
2929 bookmark : Bookmark ,
30- tag : string
30+ tag : string ,
3131) : Promise < TagAction > {
3232 let action : TagAction = {
3333 type : "add" ,
@@ -159,7 +159,7 @@ export default function BookmarkCard({ bookmark }: Readonly<BookmarkProp>) {
159159
160160 const isChanges = (
161161 beforeEdit : RefObject < Bookmark > ,
162- edit : RefObject < Bookmark >
162+ edit : RefObject < Bookmark > ,
163163 ) => {
164164 return JSON . stringify ( beforeEdit . current ) != JSON . stringify ( edit . current ) ;
165165 } ;
@@ -201,7 +201,7 @@ export default function BookmarkCard({ bookmark }: Readonly<BookmarkProp>) {
201201 const tagId = bookmark . tags [ idx ] . id ;
202202 if ( currentBookmark . current ) {
203203 currentBookmark . current . tags = currentBookmark . current . tags . filter (
204- ( t , i ) => i !== idx
204+ ( _t , i ) => i !== idx ,
205205 ) ;
206206 }
207207 api . deleteTagById ( bookmark . id , tagId ) ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import Bookmark from "@type/Bookmarks/Bookmark";
44import EditableField from "./EditableField" ;
55import { ScrapableBookmarkToggle } from "./ScrapableToggle" ;
66import style from "./bookmarkCard.module.scss" ;
7+ import { ScreenSizeProvider } from "@/contexts/ScreenSizeContext" ;
78
89interface CardBodyProp {
910 bookmark : Readonly < Bookmark > ;
@@ -22,9 +23,15 @@ export default function CardBody({
2223} : Readonly < CardBodyProp > ) {
2324 const [ isScrapable , setIsScrapable ] = useState ( bookmark . scrapable ) ;
2425
26+ const handleClick = ( ) => {
27+ const isMobile = window . innerWidth < 768 ;
28+ if ( isMobile ) {
29+ window . open ( bookmark . url ) ;
30+ }
31+ } ;
2532 return (
2633 < Card . Body className = { `` } >
27- < Card . Title className = { `${ style . cTitle } ` } >
34+ < Card . Title className = { `${ style . cTitle } ` } onClick = { handleClick } >
2835 { inEditMode ? (
2936 < EditableField
3037 fieldValue = { bookmark . title }
@@ -62,9 +69,11 @@ export default function CardBody({
6269 </ div >
6370 </ div >
6471 ) : (
65- < Card . Link target = "_blank" href = { bookmark . url } >
66- { bookmark . url }
67- </ Card . Link >
72+ < ScreenSizeProvider >
73+ < Card . Link target = "_blank" href = { bookmark . url } >
74+ { bookmark . url }
75+ </ Card . Link >
76+ </ ScreenSizeProvider >
6877 ) }
6978 { highlight ? (
7079 < div >
You can’t perform that action at this time.
0 commit comments