Skip to content
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

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

ShawnnnLiu
Copy link
Contributor

Resolves #43

Copy link
Contributor

@srukelman srukelman left a 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>
Copy link
Contributor

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'} />
Copy link
Contributor

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}>
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary console log

Comment on lines 117 to 131
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}`;
};
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

In between the linebreak and the hyphen, there needs to be a number for the item requests.

@@ -78,7 +327,7 @@ const ContactUs = () => {
<Text>Email</Text>
<Text>[email protected]</Text>
</Box>
</Box>
</Box> */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete unnecessary commented code

Comment on lines 46 to 52
// const handleCheck = (index, newValue) => {
// setCheckedItems(checkedItems => {
// const newArray = [...checkedItems];
// newArray[index] = newValue;
// return newArray;
// });
// };
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete if not necessary

@ShawnnnLiu ShawnnnLiu requested a review from srukelman March 4, 2024 21:35
Copy link
Contributor

@Xire7 Xire7 left a 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.

Comment on lines 105 to 119
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}`;
};
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@ShawnnnLiu ShawnnnLiu requested a review from Xire7 March 4, 2024 22:26
@Xire7 Xire7 merged commit 13a1473 into main Mar 4, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement CSS for Supply Request + Small Edits
4 participants