@@ -6,8 +6,10 @@ import {
66 FormDropdownField ,
77 FormTextField ,
88 icons ,
9+ Paragraph
910} from '../../components' ;
1011import { iconColors , iconSizes } from '../../../constants' ;
12+ import { formatDateToDisplay } from '../../../utils' ;
1113import DatePicker from 'react-datepicker' ;
1214
1315import 'bootstrap/dist/css/bootstrap.min.css' ;
@@ -363,12 +365,15 @@ const FilterComponent = ({
363365 switch ( filter ?. contains . selectedValue . type ) {
364366 case 'string' :
365367 return (
366- < FormTextField
367- label = { '' }
368- placeholder = { '' }
369- value = { filter . filterValue }
370- onChange = { ( value : string ) => handleValueFieldChange ( filter , value ) }
371- />
368+ < Box style = { { width : '146px' } } >
369+ < FormTextField
370+ label = { '' }
371+ placeholder = { '' }
372+ value = { filter . filterValue }
373+ onChange = { ( value : string ) => handleValueFieldChange ( filter , value ) }
374+ style = { { borderRadius : 0 , width : '146px' , fontSize : '12px' , color : '#424240' } }
375+ />
376+ </ Box >
372377 ) ;
373378 case 'date' :
374379 const ExampleCustomInput = forwardRef (
@@ -387,20 +392,25 @@ const FilterComponent = ({
387392 ) ;
388393 // date-picker
389394 return (
390- < DatePicker
391- selected = { filter . filterValue }
392- onChange = { ( value : any ) => handleValueFieldChange ( filter , value ) }
393- customInput = { < ExampleCustomInput /> }
394- />
395+ < Box style = { { width : '146px' } } >
396+ < DatePicker
397+ selected = { filter . filterValue }
398+ onChange = { ( value : any ) => handleValueFieldChange ( filter , value ) }
399+ customInput = { < ExampleCustomInput /> }
400+ />
401+ </ Box >
395402 ) ;
396403 default :
397404 return (
398- < FormTextField
399- label = { '' }
400- placeholder = { '' }
401- disabled
402- value = { filter . filterValue }
403- />
405+ < Box style = { { width : '146px' } } >
406+ < FormTextField
407+ label = { '' }
408+ placeholder = { '' }
409+ disabled
410+ value = { filter . filterValue }
411+ style = { { borderRadius : 0 , width : '146px' , fontSize : '12px' , color : '#424240' } }
412+ />
413+ </ Box >
404414 ) ;
405415 }
406416 } ;
@@ -432,31 +442,32 @@ const FilterComponent = ({
432442 />
433443 </ Box >
434444 { console . log ( filters ) }
435- < Box style = { { padding : '5px 0px 0px 7px' } } className = "text-muted h5" >
445+ < Box style = { { padding : '5px 0px 0px 7px' , display : 'flex' } } className = "text-muted h5" >
436446 { /* Filter your stack */ }
437447 { ! applyFilter && ! filters [ 0 ] ?. column ?. selectedValue ?. label
438448 ? 'Filter your stack'
439449 : filters [ 0 ] ?. column ?. selectedValue . label && ! applyFilter
440450 ? filters . map ( ( filter : any , index : number ) => {
441451 return (
442- < FlexBox . Row >
443- < Box
444- onClick = { ( ) => hanldeDelete ( index ) }
445- style = { {
446- width : '33px' ,
447- height : '33px' ,
448- // background: '#8045FF',
449- borderRadius : '4px' ,
450- } }
451- >
452- { `${ filter . column . selectedValue . label } ${ filter . filterValue } ` }
452+ < FlexBox . Row key = { index } className = { styles . tile } >
453+ < Box onClick = { ( ) => hanldeDelete ( index ) } >
454+ { `${ filter . column . selectedValue . label } ${ typeof filter . filterValue === 'string' ? filter . filterValue : formatDateToDisplay ( filter . filterValue ) } ` }
453455 </ Box >
456+
457+ < Box onClick = { ( ) => setFilter ( [ ] ) } >
458+ < icons . closeWithBorder
459+ style = { { paddingLeft : '7px' } }
460+ size = { iconSizes . sm }
461+ color = { iconColors . grey }
462+ />
463+ </ Box >
464+
454465 </ FlexBox . Row >
455466 ) ;
456467 } )
457468 : 'Filter your stack' }
458- { ! applyFilter && ! filters [ 0 ] ?. column ?. selectedValue ?. label ? (
459- 'Filter your stack'
469+ { /* { !applyFilter && !filters[0]?.column?.selectedValue?.label ? (
470+ null
460471 ) : filters[0]?.column?.selectedValue.label && !applyFilter ? (
461472 <Box
462473 onClick={() => setFilter([])}
@@ -468,27 +479,28 @@ const FilterComponent = ({
468479 borderRadius: '4px',
469480 }}
470481 >
471- < icons . delete
482+ <icons.close
472483 style={{ padding: '7px 0px 0px 7px' }}
473- size = { iconSizes . md }
484+ size={iconSizes.sm }
474485 color={iconColors.grey}
475486 />
476487 </Box>
477488 ) : (
478- 'Filter your stack'
479- ) }
489+ null
490+ )} */ }
480491 </ Box >
481492 </ FlexBox >
482493 { applyFilter && (
483- < Box className = "mb-4" >
494+ < Box className = "mb-4 mt-19 " >
484495 < Container >
485- < p className = "h3 text-muted" > Custom Filtering</ p >
496+ < Paragraph className = "h3 text-muted" color = 'black' style = { { fontSize : '16px' } } > Custom Filtering</ Paragraph >
486497 { filters . map ( ( filter : any , index : number ) => {
487498 return (
488- < FlexBox . Row key = { index } className = "align-items-center mb-1" >
489- < Box className = "mr-4 mt-5 h4 text-muted" >
499+ < FlexBox . Row key = { index } className = "mb-1" >
500+ < Box className = "mr-4 mt-5 h4 text-muted" style = { { fontSize : '12px' , width : '46px' , color : '#424240' } } >
490501 { index === 0 ? 'Where' : 'And' }
491502 </ Box >
503+ < Box style = { { width : '146px' } } >
492504 < FormDropdownField
493505 label = { '' }
494506 onChange = { ( value : string ) =>
@@ -497,7 +509,13 @@ const FilterComponent = ({
497509 placeholder = { 'Column Name' }
498510 value = { filter . column . selectedValue . value }
499511 options = { filter . column . options }
512+ style = { { borderTopRightRadius : 0 ,
513+ borderBottomRightRadius : 0 , width : '146px' ,
514+ fontSize : '12px' , color : '#424240'
515+ } }
500516 />
517+ </ Box >
518+ < Box style = { { width : '146px' } } >
501519 < FormDropdownField
502520 label = { '' }
503521 disabled = { ! filter . column . selectedValue . type }
@@ -510,22 +528,17 @@ const FilterComponent = ({
510528 filter . contains . options ,
511529 filter . column . selectedValue . type ,
512530 ) }
513- />
531+ style = { { borderRadius : 0 , width : '146px' ,
532+ fontSize : '12px' , color : '#424240'
533+ } }
534+ />
535+ </ Box >
514536 { valueField ( filter ) }
515537
516- < Box
517- onClick = { ( ) => hanldeDelete ( index ) }
518- style = { {
519- marginTop : '23px' ,
520- width : '130px' ,
521- height : '40px' ,
522- border : '1px solid #c9cbd0' ,
523- borderRadius : '4px' ,
524- } }
525- >
538+ < Box onClick = { ( ) => hanldeDelete ( index ) } className = { styles . removeIcon } >
526539 < icons . delete
527540 style = { { padding : '7px 0px 0px 7px' } }
528- size = { iconSizes . md }
541+ size = { iconSizes . sm }
529542 color = { iconColors . grey }
530543 />
531544 </ Box >
@@ -534,10 +547,10 @@ const FilterComponent = ({
534547 } ) }
535548 < FlexBox . Row className = "mt-5" onClick = { addAnotherFilter } >
536549 < icons . simplePlus
537- size = { iconSizes . lg }
550+ size = { iconSizes . md }
538551 color = { iconColors . darkGrey }
539552 />
540- < span className = "h3 text-muted ml-1 mt-2" > Add Condition</ span >
553+ < Paragraph className = "h3 text-muted ml-1 mt-2" style = { { fontSize : '14px' , fontWeight : 'bold' , color : '#747474' , cursor : 'pointer' } } > Add Condition</ Paragraph >
541554 </ FlexBox . Row >
542555 </ Container >
543556 </ Box >
0 commit comments