zmiany do mobile, filtrowanie, poprawki
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jakub Kaniecki
2024-07-27 01:42:21 +02:00
parent 97b7e8726d
commit 45a2c8252e
14 changed files with 639 additions and 141 deletions

View File

@@ -1,33 +1,35 @@
import propTypes from 'prop-types'
import PropTypes from 'prop-types'
const Selector = (props) => {
return (
<>
<div className='grid grid-cols-2 sm:gap-[1px]'>
<span className='col-span-2 mx-auto text-l font- text-center font-poppins'>{props.name}</span>
{props.value_to_map_from.map((value_to_map_from) => (
<label key={value_to_map_from.id} className
='flex items-center justify-start text-sm font-poppins font-semibold text-gray-600'>
<input type='checkbox' name={props.inputname} value={value_to_map_from.id}
onChange={props.onChange}
className='mr-2'
checked={props.state[props.inputname]?.includes(value_to_map_from.id)}
/>
{value_to_map_from.name}
</label>
))}
</div>
<span className='col-span-2 mx-auto text-l font- text-center font-poppins'>{props.name}</span>
{props.value_to_map_from.map((value_to_map_from) => (
<label key={value_to_map_from.id} className='flex items-center justify-start text-sm font-poppins font-semibold text-gray-600'>
<input
type='checkbox'
name={props.inputname}
value={value_to_map_from.id}
onChange={props.onChange}
className='mr-2'
checked={Array.isArray(props.state[props.inputname]) && props.state[props.inputname].includes(value_to_map_from.id)}
/>
{value_to_map_from.name}
</label>
))}
</div>
</>
)
}
Selector.propTypes = {
value_to_map_from: propTypes.array,
setSearchQuery: propTypes.func,
name: propTypes.string,
inputname: propTypes.string,
onChange: propTypes.func,
state: propTypes.array
value_to_map_from: PropTypes.array,
setSearchQuery: PropTypes.func,
name: PropTypes.string,
inputname: PropTypes.string,
onChange: PropTypes.func,
state: PropTypes.object
}
export default Selector
export default Selector