Sha256: e0e89da2c2f1a7fd9d23e5f9c573567b5fbc630617ed5cf0c4eff2a939378788
Contents?: true
Size: 1.29 KB
Versions: 55
Compression:
Stored size: 1.29 KB
Contents
import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import { TextInput, FormGroup, ValidatedOptions } from '@patternfly/react-core'; import { translate as __ } from 'foremanReact/common/I18n'; import { RepeatDaily } from './RepeatDaily'; import { noop } from '../../../helpers'; export const RepeatMonth = ({ repeatData, setRepeatData, setValid }) => { const { days, at } = repeatData; useEffect(() => { if (days && at) { setValid(true); } else { setValid(false); } return () => setValid(true); }, [setValid, days, at]); return ( <> <FormGroup label={__('Days')} isRequired> <TextInput isRequired validated={days ? ValidatedOptions.noval : ValidatedOptions.error} aria-label="days" placeholder="1,2..." type="text" value={repeatData.days || ''} onChange={newTime => { setRepeatData({ ...repeatData, days: newTime }); }} /> </FormGroup> <RepeatDaily repeatData={repeatData} setRepeatData={setRepeatData} setValid={noop} /> </> ); }; RepeatMonth.propTypes = { repeatData: PropTypes.object.isRequired, setRepeatData: PropTypes.func.isRequired, setValid: PropTypes.func.isRequired, };
Version data entries
55 entries across 55 versions & 1 rubygems