Skip to content

Instantly share code, notes, and snippets.

@andyfaizan
Created November 26, 2018 20:32
Show Gist options
  • Save andyfaizan/fa45cf810709ab59fad4c4d7b3eb7909 to your computer and use it in GitHub Desktop.
Save andyfaizan/fa45cf810709ab59fad4c4d7b3eb7909 to your computer and use it in GitHub Desktop.
No formatting..look at line 20. Even if we ignore the long text, there are other elements being added at the end which should be on the next line
import React, { Component } from "react";
import { Link } from 'react-router-dom';
import { Field, reduxForm } from "redux-form";
import { customInput } from "./fields";
import { required, email } from "../validation";
import "./RegisterForm.css";
class Newsletter extends Component {
render() {
const { handleSubmit, isButtonActive, buttonText } = this.props;
return (
<form onSubmit={handleSubmit}>
<Field
name="email"
component={customInput}
type="text"
label="E-mail Adresse eintragen"
validate={[required, email]}
/>
<p className="legalText">Wir werden Ihre Kontaktdaten vertraulich behandeln und nur für den Zweck der Kontaktaufnahme über hektor.one verwenden. Sie können der Nutzung jederzeit per E-Mail widersprechen. Durch Absenden Ihrer Anfrage erklären Sie sich mit unseren <Link to={'./datenschutz'} title="Datenschutzbestimmungen"><span className="link">Datenschutzbestimmungen</span></Link> einverstanden</p>
<button
className="modalButton"
type={isButtonActive ? "submit" : "disabled"}
disabled={!isButtonActive}
>
<span className="buttonText">
{isButtonActive ? "Info Erhalten" : buttonText}
</span>
</button>
</form>
);
}
}
Newsletter = reduxForm({
form: "newsletter" /*,validate*/
})(Newsletter);
export default Newsletter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment