--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { WrappedFieldProps } from 'redux-form';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { FormControlLabel, Checkbox, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
+
+type CssRules = 'checkboxField';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ checkboxField: {
+
+ }
+});
+
+export const CheckboxField = withStyles(styles)((props: WrappedFieldProps & WithStyles<CssRules> & { label?: string }) =>
+ <FormControlLabel
+ control={
+ <Checkbox
+ checked={props.input.value}
+ onChange={props.input.onChange}
+ color="primary" />
+ }
+ label={props.label}
+ />);
\ No newline at end of file
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
-import { Field } from "redux-form";
+import { Field } from 'redux-form';
import { TextField } from "~/components/text-field/text-field";
+import { CheckboxField } from '~/components/checkbox-field/checkbox-field';
import { Checkbox, FormControlLabel } from '@material-ui/core';
export const SearchBarTypeField = () =>
label="Project name" />;
export const SearchBarTrashField = () =>
- <FormControlLabel
- control={
- <Checkbox
- checked={false}
- value="true"
- color="primary"
- />
- }
+ <Field
+ name='inTrash'
+ component={CheckboxField}
label="In trash" />;
export const SearchBarDataFromField = () =>
label="Value" />;
export const SearchBarSaveSearchField = () =>
- <FormControlLabel
- control={
- <Checkbox
- checked={false}
- value="true"
- color="primary"
- />
- }
+ <Field
+ name='saveQuery'
+ component={CheckboxField}
label="Save search query" />;
export const SearchBarQuerySearchField = () =>