Last active
July 1, 2019 03:20
-
-
Save reichert621/aa3335c2ec17e2f261950ee368b37e7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import ... | |
import './App.css'; // Import our new CSS | |
const STRIPE_API_KEY = 'pk_test_...'; | |
const createCharge = token => { | |
// ... | |
}; | |
const Form = props => { | |
// Define our custom styles | |
const style = { | |
base: { | |
color: '#32325d', | |
fontFamily: '"Open Sans", "Helvetica Neue", Arial, san-serif', | |
fontSmoothing: 'antialiased', | |
fontSize: '16px', | |
'::placeholder': { | |
color: '#aab7c4' | |
} | |
}, | |
invalid: { | |
color: '#fa755a', | |
iconColor: '#fa755a' | |
} | |
}; | |
const handleCreateCharge = e => { | |
// ... | |
}; | |
// Add a `.StripeForm` class to the <form> element | |
return ( | |
<form className="StripeForm" onSubmit={handleCreateCharge}> | |
{/* Add our style to the <CardElement /> */} | |
<CardElement style={style} /> | |
<button type="submit">Create Charge</button> | |
</form> | |
); | |
}; | |
const StripeForm = injectStripe(Form); | |
const App = () => { | |
// ... | |
}; | |
ReactDOM.render(<App />, document.getElementById('app')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment