@@ -3,6 +3,7 @@ import {Link } from 'react-router-dom'
33import { Button , Dropdown , Badge } from 'react-bootstrap'
44import { ListGroup } from 'react-bootstrap'
55import { useState , useEffect } from 'react'
6+ import { isMobile } from 'react-device-detect'
67import IndexSearchForm from './IndexSearchForm'
78import BoostSettingsModal from './BoostSettingsModal'
89import SelectedItemsModal from './SelectedItemsModal'
@@ -426,10 +427,10 @@ export default function IndexLayout(props) {
426427 </ > }
427428
428429 { ( tune . books && tune . books . length > 0 ) && < span style = { { marginRight :'1em' , float :'right' } } >
429- { tune . books . map ( function ( book , count ) { if ( props . currentTuneBook && props . currentTuneBook === book ) { return null } else { return < Button onClick = { function ( ) { props . setCurrentTuneBook ( book ) ; props . setFilter ( '' ) ; props . forceRefresh ( ) } } key = { book } variant = "primary" style = { { color :'white' , marginRight :'0.1em' , fontSize :'0.5em' } } > { book } </ Button > } } ) }
430+ { tune . books . map ( function ( book , count ) { if ( props . currentTuneBook && props . currentTuneBook === book ) { return null } else { return < Button disabled = { isMobile } onClick = { function ( ) { if ( ! isMobile ) { props . setCurrentTuneBook ( book ) ; props . setFilter ( '' ) ; props . forceRefresh ( ) } } } key = { book } variant = "primary" style = { { color :'white' , marginRight :'0.1em' , fontSize :'0.5em' } } > { book } </ Button > } } ) }
430431 </ span > }
431432 { ( Array . isArray ( tune . tags ) && tune . tags . length > 0 ) && < span style = { { marginRight :'1em' , float :'right' } } >
432- { tune . tags . map ( function ( tag , count ) { return props . tagFilter . indexOf ( tag ) === - 1 ? < Button key = { tag } variant = "info" onClick = { function ( ) { props . setTagFilter ( [ tag ] ) ; props . setFilter ( '' ) ; props . forceRefresh ( ) } } style = { { marginRight :'0.1em' , fontSize :'0.5em' } } > { tag } </ Button > : '' } ) }
433+ { tune . tags . map ( function ( tag , count ) { return props . tagFilter . indexOf ( tag ) === - 1 ? < Button disabled = { isMobile } key = { tag } variant = "info" onClick = { function ( ) { if ( ! isMobile ) { props . setTagFilter ( [ tag ] ) ; props . setFilter ( '' ) ; props . forceRefresh ( ) } } } style = { { marginRight :'0.1em' , fontSize :'0.5em' } } > { tag } </ Button > : '' } ) }
433434 </ span > }
434435 { ( Object . keys ( filtered ) . length > 0 && Object . keys ( filtered ) . length < LIST_PROTECTION_LIMIT ) && < >
435436 { tune . key && < Button style = { { marginRight :'1em' , float :'right' } } variant = { 'outline-success' } > { tune . key } </ Button > }
0 commit comments