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

Gear order form in WCA website #9815

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danieljames-dj
Copy link
Member

In this PR, the gear order form is brought within WCA website so that there will be more options of customizations - for example, the notification emails can be well formatted in a way that it will reduce the workload of WFC, the user can know the total order value while filling the form, etc.

@danieljames-dj danieljames-dj marked this pull request as draft August 26, 2024 02:08
@danieljames-dj
Copy link
Member Author

This form is not 100% complete, currently I'm facing a blocker that if I mark any of the Form.Input as required, it will become 'red' even before user starts inputting any details. The same issue is happening with competition form as well if I give required.

I remember seeing this while working on Sign Up page migration, but iirc I couldn't find a solution during that time.

I request somebody to unblock this issue. Alternative is to use custom validation to check if all the fields are there.

@dunkOnIT
Copy link
Contributor

it will become 'red' even before user starts inputting any details

Currently there is no workaround for this issue - that's how the form behaves in v2 Register as well. I think for now, proceed as if this were not a blocker.

import i18n from '../../lib/i18n';

export default function ContactGearOrder() {
const equipments = [
Copy link
Contributor

Choose a reason for hiding this comment

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

"Equipment" doesn't have a plural form.
And this array could be moved out of the component.

Suggested change
const equipments = [
const equipment = [

quantity: 0,
price: 0,
})));
const [totalPrice, setTotalPrice] = useState(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work? Direct calculation is better than a state and an effect.

Suggested change
const [totalPrice, setTotalPrice] = useState(0);
const totalPrice = _.sumBy(orderDetails, 'price');

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.

3 participants