-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submission for device donations #161
Conversation
- Added firebase config for instantiating firebase admin object - Added API function for processing the form
Deployment failed with the following error:
|
- Remove default values - Add router redirect - Switch to ISO 3166 country codes - Simple validation - Add divider for non-esstential fields
- Add firebase keys to .env.example - Match variable names between files
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/margaritahumanitarian/helpafamily/juERVBp8LNKHj5zF7nToD3GsZkwD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing the form backend! This is good to merge.
@@ -33,7 +33,7 @@ SelectFormControl.propTypes = { | |||
label: PropTypes.string, | |||
options: PropTypes.arrayOf( | |||
PropTypes.shape({ | |||
id: PropTypes.string.isRequired, | |||
value: PropTypes.string.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just got an explanation from @pydanny about this. He says value
is option-specific whereas id
is for the whole select component.
{ value: 'LV', label: 'Latvia' }, | ||
{ value: 'IN', label: 'India' }, | ||
{ value: 'BD', label: 'Bangladesh' }, | ||
{ value: 'PH', label: 'Philippines' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like the ISO 3166-1 Alpha-2 codes here.
const [valueOfDevice, setValueOfDevice] = React.useState(''); | ||
const [about, setAbout] = React.useState(''); | ||
const [phone, setPhone] = React.useState(''); | ||
const [originalPurchasePrice, setOriginalPurchasePrice] = React.useState(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for changing valueOfDevice
to originalPurchasePrice
. This helps us follow best practices for donation valuation for better tax compliance.
<InputFormControl | ||
id="name" | ||
label="Name" | ||
label="Name *" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to replace the manually-coded * markings with required
attributes later, but this is okay for now. We'll iterate.
I submitted the form and it worked, great! |
This satisfies the requirements for #135.
.env.example
give-device.js
formEmail of receipts will be submitted in #166.