@@ -27,6 +27,7 @@ import DefaultUserIcon from "../../../icons/user/defaultUserIcon";
27
27
import {
28
28
useLoadersStore ,
29
29
useMiscellaneousStore ,
30
+ useModalStore ,
30
31
} from "../../../store/componentStore" ;
31
32
import {
32
33
type BookmarkViewDataTypes ,
@@ -59,6 +60,7 @@ import {
59
60
import "node_modules/video-react/dist/video-react.css" ;
60
61
61
62
import PlayIcon from "../../../icons/actionIcons/playIcon" ;
63
+ import VideoModal from "../modals/videoModal" ;
62
64
63
65
import ListBox from "./listBox" ;
64
66
@@ -120,6 +122,12 @@ const CardSection = ({
120
122
const toggleIsSearchLoading = useLoadersStore (
121
123
( state ) => state . toggleIsSearchLoading ,
122
124
) ;
125
+ const toggleShowVideoModal = useModalStore (
126
+ ( state ) => state . toggleShowVideoModal ,
127
+ ) ;
128
+ const setSelectedVideoId = useMiscellaneousStore (
129
+ ( state ) => state . setSelectedVideoId ,
130
+ ) ;
123
131
124
132
const categoryData = queryClient . getQueryData ( [ CATEGORIES_KEY , userId ] ) as {
125
133
data : CategoriesData [ ] ;
@@ -436,6 +444,8 @@ const CardSection = ({
436
444
width : number ,
437
445
type : string ,
438
446
) => {
447
+ const isVideo = isBookmarkVideo ( type ) ;
448
+
439
449
const imgClassName = classNames ( {
440
450
"min-h-[48px] min-w-[80px] max-h-[48px] max-w-[80px] object-cover rounded" :
441
451
cardTypeCondition === "list" ,
@@ -455,6 +465,7 @@ const CardSection = ({
455
465
} ) ;
456
466
457
467
const figureClassName = classNames ( {
468
+ relative : isVideo ,
458
469
"mr-3" : cardTypeCondition === "list" ,
459
470
"h-[48px] w-[80px] " : cardTypeCondition === "list" ,
460
471
"w-full h-[194px] " : cardTypeCondition === "card" ,
@@ -530,19 +541,27 @@ const CardSection = ({
530
541
return null ;
531
542
} ;
532
543
533
- const isVideo = isBookmarkVideo ( type ) ;
534
-
535
- // const playSvgClassName = classNames({
536
- // absolute: true,
537
- // "top-[43%] left-[43%]":
538
- // cardTypeCondition === "moodboard" || cardTypeCondition === "card",
539
- // "top-[13%] left-[27%]": cardTypeCondition === "list",
540
- // });
544
+ const playSvgClassName = classNames ( {
545
+ "hover:fill-slate-500 transition ease-in-out delay-50" : true ,
546
+ absolute : true ,
547
+ "top-[43%] left-[43%]" :
548
+ cardTypeCondition === "moodboard" || cardTypeCondition === "card" ,
549
+ "top-[13%] left-[27%]" : cardTypeCondition === "list" ,
550
+ } ) ;
541
551
542
552
return (
543
553
! isNull ( imgLogic ( ) ) && (
544
554
< figure className = { figureClassName } >
545
- { /* {isVideo ? <PlayIcon className={playSvgClassName} /> : null }{" "} */ }
555
+ { isVideo && (
556
+ < PlayIcon
557
+ className = { playSvgClassName }
558
+ onClick = { ( ) => {
559
+ toggleShowVideoModal ( ) ;
560
+ setSelectedVideoId ( id ) ;
561
+ } }
562
+ onPointerDown = { ( event ) => event . stopPropagation ( ) }
563
+ />
564
+ ) }
546
565
{ isVideo ? null : null } { imgLogic ( ) }
547
566
</ figure >
548
567
)
@@ -795,27 +814,30 @@ const CardSection = ({
795
814
} ) ;
796
815
797
816
return (
798
- < div
799
- className = { listWrapperClass }
800
- // style={{ height: "calc(100vh - 270px)"}}
801
- >
802
- < ListBox
803
- aria-label = "Categories"
804
- bookmarksColumns = { bookmarksColumns }
805
- bookmarksList = { bookmarksList }
806
- cardTypeCondition = { cardTypeCondition }
807
- isPublicPage = { isPublicPage }
808
- onBulkBookmarkDelete = { onBulkBookmarkDelete }
809
- onCategoryChange = { onCategoryChange }
810
- selectionMode = "multiple"
817
+ < >
818
+ < div
819
+ className = { listWrapperClass }
820
+ // style={{ height: "calc(100vh - 270px)"}}
811
821
>
812
- { renderSortByCondition ( ) ?. map ( ( item ) => (
813
- < Item key = { item ?. id } textValue = { item ?. id ?. toString ( ) } >
814
- { renderBookmarkCardTypes ( item ) }
815
- </ Item >
816
- ) ) }
817
- </ ListBox >
818
- </ div >
822
+ < ListBox
823
+ aria-label = "Categories"
824
+ bookmarksColumns = { bookmarksColumns }
825
+ bookmarksList = { bookmarksList }
826
+ cardTypeCondition = { cardTypeCondition }
827
+ isPublicPage = { isPublicPage }
828
+ onBulkBookmarkDelete = { onBulkBookmarkDelete }
829
+ onCategoryChange = { onCategoryChange }
830
+ selectionMode = "multiple"
831
+ >
832
+ { renderSortByCondition ( ) ?. map ( ( item ) => (
833
+ < Item key = { item ?. id } textValue = { item ?. id ?. toString ( ) } >
834
+ { renderBookmarkCardTypes ( item ) }
835
+ </ Item >
836
+ ) ) }
837
+ </ ListBox >
838
+ </ div >
839
+ < VideoModal listData = { listData } />
840
+ </ >
819
841
) ;
820
842
} ;
821
843
0 commit comments