From 44509b066b00eed433e0bbd28763100a2b85b6ef Mon Sep 17 00:00:00 2001 From: trechriron Date: Thu, 7 Dec 2023 19:01:59 -0800 Subject: [PATCH] Setup pull downs, confirmed props available on child widgets. --- src/App/DevFormComponent.jsx | 82 +++++++++++++++++++++++------------- src/App/DevResultPage.jsx | 14 +++++- src/App/DevResultText.jsx | 31 ++++---------- 3 files changed, 73 insertions(+), 54 deletions(-) diff --git a/src/App/DevFormComponent.jsx b/src/App/DevFormComponent.jsx index fcd157c..831b8ab 100644 --- a/src/App/DevFormComponent.jsx +++ b/src/App/DevFormComponent.jsx @@ -75,11 +75,11 @@ }; const [formData, setFormData] = useState({ - textField1: '', - textField2: '', - textField3: '', - textField4: '', - textField5: '', + phase1: '', + phase2: '', + phase3: '', + phase4: '', + phase5: '', checkbox1: false, checkbox2: false, checkbox3: false, @@ -92,27 +92,43 @@ label5: 'Use Fast Auth Onboarding', }); - const handleChange = (e) => { + const dropDownItems = [ + { value: "0", label: "Please select..." }, + { value: "100", label: "100 calls per month" }, + { value: "250", label: "250 calls per month" }, + { value: "500", label: "500 calls per month" }, + { value: "1k", label: "1k calls per month" }, + { value: "5k", label: "5k calls per month" }, + { value: "10k", label: "10k calls per month" }, + { value: "20k", label: "20k calls per month" }, + { value: "40k", label: "40k calls per month" }, + { value: "60k", label: "60k calls per month" }, + { value: "80k", label: "80k calls per month" }, + { value: "100k", label: "100k calls per month" }, + { value: "150k", label: "150k calls per month" }, + { value: "200k", label: "200k calls per month" }, + { value: "250k", label: "250k calls per month" }, + ]; + + const [callValue, setCallValue] = useState(""); + +const handleChange = (e) => { const { name, value, type, checked } = e.target; + if (type === 'select') { + setCallValue(value); + } setFormData((prevData) => ({ - ...prevData, - [name]: type === 'checkbox' ? checked : value, + ...prevData, + [name]: type === 'checkbox' ? checked : value, })); - }; +}; const handleSubmit = (e) => { props.submitDeveloperProfile(formData); - - // Basic form validation - check if all text fields are filled - /*const isFormValid = Object.values(formData).every((value) => value !== ''); - - if (isFormValid) { - props.setDeveloperProfile(formData); - } else { - console.warn('The form was not submitted. Please fill in all fields.'); - }*/ }; + console.log(formData); + console.log(callValue); return (
@@ -129,7 +145,7 @@
-

The number provided = the number of active users per minute. For example, if you expect 100 users to be using your app per minute, enter 100. You can break down your estimate into 5 phases. Leave any unused fields blank. +

The number provided = the number of active users per minute. The pulldown lists have generic thresholds you can choose to get a close idea of what your expendentitures will be at common thresholds. You can break down your estimate into 5 phases.

Please check the boxes that apply to your project. If you are unsure, leave the box unchecked. @@ -138,20 +154,26 @@

- {/* Text Fields */} + {/* Dropdown per phase */}
{Array.from({ length: 5 }, (_, index) => (
- - + +
))}
diff --git a/src/App/DevResultPage.jsx b/src/App/DevResultPage.jsx index 9984323..4ae8927 100644 --- a/src/App/DevResultPage.jsx +++ b/src/App/DevResultPage.jsx @@ -24,12 +24,22 @@ return (
- +
- +
diff --git a/src/App/DevResultText.jsx b/src/App/DevResultText.jsx index 75d2f6c..17b44a0 100644 --- a/src/App/DevResultText.jsx +++ b/src/App/DevResultText.jsx @@ -12,27 +12,14 @@ const devTextStyles = { margin: "10px", padding: "10px", }, - freeTierBack: { - fill: "lightgreen", - stroke: "none", - opacity: ".5", - width: "700px", - height: "145px", - }, - tierOneBack: { - fill: "lightblue", - stroke: "none", - opacity: ".5", - width: "700px", - height: "80px", - }, - tiertwoBack: { - fill: "red", - stroke: "none", - opacity: ".3", - width: "700px", - height: "60px", - }, }; -

Here are the results of your cost estimate...

\ No newline at end of file +const basicText = (

Please enter the following information to estimate the cost of your project...

); + +return ( +
+
+ {basicText} +
+
+); \ No newline at end of file