Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@reichert621
Last active July 1, 2019 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reichert621/aa3335c2ec17e2f261950ee368b37e7c to your computer and use it in GitHub Desktop.
Save reichert621/aa3335c2ec17e2f261950ee368b37e7c to your computer and use it in GitHub Desktop.
// 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