File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export default function AdminAlbumThumbs(
1414 } ,
1515) {
1616 const items = xmlAlbum . album . item ? ( Array . isArray ( xmlAlbum . album . item ) ? xmlAlbum . album . item : [ xmlAlbum . album . item ] ) : [ ]
17+ const hasMultiSelection = ( selectedIndices ?. size ?? 0 ) > 1
1718
1819 if ( items . length === 0 ) {
1920 return < div > No items found</ div >
@@ -34,6 +35,7 @@ export default function AdminAlbumThumbs(
3435 key = { filename }
3536 id = { `select${ item . $ . id } ` }
3637 viewed = { isSelected }
38+ multiSelected = { hasMultiSelection && isSelected }
3739 />
3840 )
3941 } ) }
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ import config from '../../../src/models/config'
44import Img from '../Img'
55import styles from './styles.module.css'
66
7- function getViewed ( viewed : boolean ) {
7+ function getViewed ( viewed : boolean , multiSelected : boolean ) {
88 if ( viewed ) {
9- return `${ styles . highlight } ${ styles . imgButton } `
9+ return `${ multiSelected ? styles . highlightMulti : styles . highlight } ${ styles . imgButton } `
1010 }
1111 return styles . imgButton
1212}
@@ -18,13 +18,15 @@ function ThumbImg({
1818 src,
1919 id,
2020 viewed : globalViewed = false ,
21+ multiSelected = false ,
2122} : {
2223 onClick ?: ( event : MouseEvent < HTMLAnchorElement | HTMLUListElement > ) => void ;
2324 caption : string ;
2425 href ?: string ;
2526 src : string ;
2627 id : string ;
2728 viewed : boolean ;
29+ multiSelected ?: boolean ;
2830} ) {
2931 // Keep visuals (local state for immediate feedback) but never reset globally
3032 const [ viewed , setViewed ] = useState ( globalViewed )
@@ -43,7 +45,7 @@ function ThumbImg({
4345
4446 return (
4547 < li className = { styles . bullet } >
46- < a className = { getViewed ( globalViewed || viewed ) } href = { href } onClick = { handleClick } id = { id } >
48+ < a className = { getViewed ( globalViewed || viewed , multiSelected ) } href = { href } onClick = { handleClick } id = { id } >
4749 < Img
4850 src = { src }
4951 alt = { caption }
Original file line number Diff line number Diff line change 2525.highlight {
2626 border-color : white;
2727}
28+ .highlightMulti {
29+ border-color : # d9c24a ;
30+ }
You can’t perform that action at this time.
0 commit comments