
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
redux-form-react-submitbutton
Advanced tools
A submit button for redux form that dynamically changes based on the current form state
A submit button for redux-form that dynamically changes based on the current redux-form state.
https://deedmob.github.io/redux-form-react-submitbutton/example/
yarn add redux-form-react-submitbutton
npm install redux-form-react-submitbutton
@reduxForm({
form: 'account'
})
class AccountForm extends React.Component {
render(){
<form>
<Field name="email" component={TextInput} />
<SubmitButton />
</form>
}
}
There are no required props
static defaultProps = {
className: 'btn',
disabledClassName: 'btn-outline',
successClassName: 'btn-success',
errorClassName: 'btn-danger',
okClassName: 'btn-primary',
submittingClassName: 'btn-default',
invalidClassName: 'btn-warning',
syncErrorClassName: 'alert alert-danger',
styles: {},
iconStyles: { marginRight: '5px' },
labelErrorAlert: 'Please double-check that these fields are correct and try again',
type: 'Submit',
showIcons: true,
translateKeys: key => key,
// showWarnings: true,
showErrors: true,
timeout: 2000,
labelSubmitting: '...Submitting',
// start OK button messages
labelSubmit: 'Submit',
labelUpdate: 'Save Changes',
labelPost: 'Post',
labelCreate: 'Create',
iconSubmit: 'fa fa-paper-plane-o',
iconUpdate: 'fa fa-floppy-o',
iconPost: 'fa fa-rocket',
iconCreate: 'fa fa-plus',
iconError: 'fa fa-times',
iconWarning: 'fa fa-warning',
iconSubmitting: 'fa fa-spinner fa-pulse fa-fw',
iconSuccess: 'fa fa-check',
// start pristine button messages
labelPristineSubmit: 'Incomplete',
labelPristineUpdate: 'No Changes to Save',
labelPristinePost: 'Incomplete',
labelPristineCreate: 'Fill in required fields',
// end pristine button messages
labelInvalid: 'Invalid',
labelSubmitFailed: 'Submission error',
labelSubmitSucceeded: 'Success!'
}
static propTypes = {
timeout: PropTypes.number,
type: PropTypes.oneOf(['Create', 'Post', 'Update', 'Submit']),
showIcons: PropTypes.bool,
iconSubmit: PropTypes.string,
iconUpdate: PropTypes.string,
iconPost: PropTypes.string,
iconCreate: PropTypes.string,
iconError: PropTypes.string,
iconWarning: PropTypes.string,
iconSubmitting: PropTypes.string,
iconSuccess: PropTypes.string,
// showWarnings: PropTypes.bool,
translateKeys: PropTypes.func,
labelErrorAlert: PropTypes.string,
showErrors: PropTypes.bool,
className: PropTypes.string,
syncErrorClassName: PropTypes.string,
disabledClassName: PropTypes.string,
successClassName: PropTypes.string,
errorClassName: PropTypes.string,
okClassName: PropTypes.string,
invalidClassName: PropTypes.string,
submittingClassName: PropTypes.string,
styles: PropTypes.object,
iconStyles: PropTypes.object,
syncErrors: PropTypes.object.isRequired,
syncWarnings: PropTypes.object.isRequired,
// start Passed in from the redux-form redux state
submitting: PropTypes.bool.isRequired,
submitFailed: PropTypes.bool.isRequired,
submitSucceeded: PropTypes.bool.isRequired,
invalid: PropTypes.bool.isRequired,
pristine: PropTypes.bool.isRequired,
// end
labelSubmitting: PropTypes.string,
labelSubmit: PropTypes.string,
labelUpdate: PropTypes.string,
labelPost: PropTypes.string,
labelCreate: PropTypes.string,
labelPristineSubmit: PropTypes.string,
labelPristineUpdate: PropTypes.string,
labelPristinePost: PropTypes.string,
labelPristineCreate: PropTypes.string,
labelInvalid: PropTypes.string,
labelSubmitFailed: PropTypes.string,
labelSubmitSucceeded: PropTypes.string
}
yarn run test
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.