-
Notifications
You must be signed in to change notification settings - Fork 0
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
implement_CSS_for_supply_request resolved #52
Conversation
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.
good work jits. some changes. try to get them done by monday noon so we can merge!
<HStack justify="flex-end" marginEnd={'5%'}> | ||
<Button colorScheme="teal" variant="outline" width="130px"> | ||
Cancel | ||
<Link to="/BusinessDashboard"></Link> |
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.
rather than using a link, make an onclick for the button that uses a useNavigate to change the route
<ModalFooter> | ||
<Button colorScheme="blue" mr={3} onClick={onClose}> | ||
Back to Home | ||
<Link to={'/BusinessDonationTrackingForm'} /> |
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.
Rather than using a link, make the onclick for the button with a useNavigate that takes the user back to the home page
Cancel | ||
<Link to="/BusinessDashboard"></Link> | ||
</Button> | ||
<Button {...buttonStyles} disabled={isFormValid} width="130px" onClick={SubmitForm}> |
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.
the button is still clickable even when form is not valid. this is because the prop should be isDisabled not disabled.
const newText = e.target.value; | ||
setText(newText); | ||
isFormFilled(); | ||
setIsFormValid(checkedItems.some(value => value !== 0) && text.length > 0); |
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.
make this an or so that businesses can request supplies without a message or send a message without requesting supplies
// Update the state with the new array | ||
setCheckedItems(checkedItems); | ||
isFormFilled(); | ||
setIsFormValid(checkedItems.some(value => value !== 0) && text.length > 0); |
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.
make this an or so that businesses can request supplies without a message or send a message without requesting supplies
@@ -33,38 +94,226 @@ const ContactUs = () => { | |||
been_dismissed: false, | |||
}; | |||
const result = await backend.post('/notification/', updatedFormData); | |||
console.log(result); |
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.
remove unnecessary console log
const setMessage = text => { | ||
const textCopy = text; | ||
const checkedThingies = ['Stickers', 'Posters', 'Business Cards', 'Something', 'Joshua Lipton']; | ||
const preMessage = `${name} is requesting: \n`; // business name... hard-coded right now | ||
const checkedThingies = [ | ||
'DS Decals', | ||
'Rack Cards', | ||
'Donation Envelopes', | ||
'Business Cards', | ||
'Stickers', | ||
'Bin Decals', | ||
'DS Decals', | ||
]; | ||
const preMessage = `Business is requesting: \n`; // business name... hard-coded right now | ||
const updatedMessage = checkedThingies.filter((_, index) => checkedItems[index]).join('\n-'); | ||
return `${preMessage}-${updatedMessage}\nNotes:\n${textCopy}`; | ||
}; |
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.
FPH needs to know how many of each thing that businesses need so you should add a useState array to count the values of each supply the businesses are requesting
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.
@@ -78,7 +327,7 @@ const ContactUs = () => { | |||
<Text>Email</Text> | |||
<Text>[email protected]</Text> | |||
</Box> | |||
</Box> | |||
</Box> */} |
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.
delete unnecessary commented code
// const handleCheck = (index, newValue) => { | ||
// setCheckedItems(checkedItems => { | ||
// const newArray = [...checkedItems]; | ||
// newArray[index] = newValue; | ||
// return newArray; | ||
// }); | ||
// }; |
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.
delete if not necessary
|
||
const ContactUs = () => { | ||
const business_ID = 0; | ||
const { backend } = useBackend(); | ||
const [name, setName] = useState('business?'); // name of business | ||
// const [name, setName] = useState('business?'); // name of business |
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.
delete if not necessary
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.
Check comments below jits, one more thing to change.
const setMessage = text => { | ||
const textCopy = text; | ||
const checkedThingies = ['Stickers', 'Posters', 'Business Cards', 'Something', 'Joshua Lipton']; | ||
const preMessage = `${name} is requesting: \n`; // business name... hard-coded right now | ||
const checkedThingies = [ | ||
'DS Decals', | ||
'Rack Cards', | ||
'Donation Envelopes', | ||
'Business Cards', | ||
'Stickers', | ||
'Bin Decals', | ||
'DS Decals', | ||
]; | ||
const preMessage = `Business is requesting: \n`; // business name... hard-coded right now | ||
const updatedMessage = checkedThingies.filter((_, index) => checkedItems[index]).join('\n-'); | ||
return `${preMessage}-${updatedMessage}\nNotes:\n${textCopy}`; | ||
}; |
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.
Check the comment above ^^, make sure to add the number of items and insert it into the string.
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.
Resolves #43