Skip to content

Commit

Permalink
fix: label as prop
Browse files Browse the repository at this point in the history
  • Loading branch information
awgaan authored and varl committed Mar 23, 2020
1 parent 53841cb commit e5338b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/components/CheckboxList/CheckboxList.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Checkbox, InputField, MenuItem, Radio } from '@dhis2/ui-core';
import s from './CheckboxList.module.css';

const CheckboxList = ({
label,
selected,
select,
onSelectAll,
Expand All @@ -22,7 +23,7 @@ const CheckboxList = ({
<div className={s.filter}>
<InputField
name="filter"
label={i18n.t('filter data sets by name')}
label={label}
value={filter}
onChange={e => setFilter(e.target.value)}
dense
Expand Down
3 changes: 0 additions & 3 deletions src/components/CheckboxList/CheckboxList.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.body {
width: 95%;
height: 250px;
overflow: scroll;
overflow-x: hidden;
Expand All @@ -19,13 +18,11 @@
padding: 0 !important;
}
.filter {
width: 95%;
margin: 0 0 5px 0;
}
.actions {
display: flex;
flex-direction: row;
width: 95%;
margin: 5px 0;
}
.action {
Expand Down
13 changes: 10 additions & 3 deletions src/components/DataSetPicker/DataSetPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ const dataSetQuery = {
},
};

const DataSetPicker = ({ selected, setSelected, multiSelect = true }) => {
const DataSetPicker = ({
selected,
setSelected,
multiSelect = true,
withFilter = true,
withActions = true,
}) => {
const [list, setList] = useState([]);
const { loading, error, data } = useDataQuery(dataSetQuery);

Expand Down Expand Up @@ -60,14 +66,15 @@ const DataSetPicker = ({ selected, setSelected, multiSelect = true }) => {
{loading && <CircularLoader />}
{data && (
<CheckboxList
label={i18n.t('Filter data sets by name')}
selected={selected}
select={onSelect}
onSelectAll={onSelectAll}
onClearAll={onClearAll}
multiSelect={multiSelect}
list={list}
withFilter
withActions
withFilter={withFilter}
withActions={withActions}
/>
)}
</div>
Expand Down

0 comments on commit e5338b8

Please sign in to comment.