From c53c92a811d22ce50f470548aa44565c1d302d19 Mon Sep 17 00:00:00 2001 From: Nate Sawant Date: Tue, 16 Apr 2024 23:07:07 -0400 Subject: [PATCH] Cleanup onboarding page --- frontend/src/components/BendSidebar.tsx | 2 +- frontend/src/components/FileUploader.tsx | 4 +- frontend/src/components/Onboarding/Button.tsx | 2 +- .../src/components/Onboarding/PrepareTube.tsx | 48 +- .../Onboarding/QuickStartEndScreen.tsx | 4 +- .../Onboarding/QuickStartTitleScreen.tsx | 2 +- .../components/Onboarding/SplashScreen.tsx | 2 +- .../components/Onboarding/StartMachine.tsx | 14 +- frontend/src/images/HifiLogo.tsx | 16 +- frontend/src/pages/CreateDesign.tsx | 32 +- frontend/src/pages/InputForm.tsx | 438 +++++++++--------- frontend/src/pages/Onboarding.tsx | 12 +- frontend/tailwind.config.js | 2 +- website/src/App.css | 54 +-- website/src/Button.tsx | 6 +- website/src/PersonalInfoForm.tsx | 166 +++---- website/tailwind.config.js | 2 +- 17 files changed, 397 insertions(+), 409 deletions(-) diff --git a/frontend/src/components/BendSidebar.tsx b/frontend/src/components/BendSidebar.tsx index 5e5c0c8..ff99003 100644 --- a/frontend/src/components/BendSidebar.tsx +++ b/frontend/src/components/BendSidebar.tsx @@ -27,7 +27,7 @@ const BendSidebar: React.FC = ({ ))} + + -
-
- -
- {fields.map(value => -
- -
-

{value.label}

-
- ( - { - const newValue = value.key === BendFields.direction ? event.target.value : +event.target.value; - field.onChange(newValue); - }} - InputProps={{ - style: customInputStyle, - }} - > - )} - />
-
- )} -
-
-
-
} @@ -291,65 +291,65 @@ function InputForm() { else if (pageNumber < pages.length + getValues('bendCount')) return bendConfig() else return + type='submit' + handleClick={() => console.log('button')} + customColors='bg-brand-teal text-brand-white hover:bg-opacity-75'> + handleClick={() => console.log('button')} + customColors='bg-brand-teal text-brand-white hover:bg-opacity-75'> } return ( <> - + -
-
- {pageManager()} -
- {pageNumber !== 0 && - Back to - {pageNumber === 1 - ? " material" - : pageNumber === 2 - ? " length" - : pageNumber === 3 - ? " number of bends" - : pageNumber < pages.length + getValues('bendCount') - ? ` bend ${pageNumber - 2}` - : " bends"} } -
- {pageNumber < pages.length + getValues('bendCount') && ( -
+
+
- - -
); - + } export default InputForm; diff --git a/frontend/src/pages/Onboarding.tsx b/frontend/src/pages/Onboarding.tsx index e3201b9..38bc5b1 100644 --- a/frontend/src/pages/Onboarding.tsx +++ b/frontend/src/pages/Onboarding.tsx @@ -9,12 +9,14 @@ import PrepareTube from '../components/Onboarding/PrepareTube'; function Onboarding() { const [currentPage, setCurrentPage] = useState(0) + const incrementPage = () => setCurrentPage(currentPage + 1) + const pages = [ - setCurrentPage(currentPage + 1)} />, - setCurrentPage(currentPage + 1)} />, - setCurrentPage(currentPage + 1)} />, - setCurrentPage(currentPage + 1)} />, - setCurrentPage(currentPage + 1)} />, + , + , + , + , + , ] return ( diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index 461acca..3530e26 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -15,7 +15,7 @@ module.exports = { 'orange': '#EB5E28', 'white': '#FFFFFF', 'light-grey': '#C4C4C4', - 'temp-teal': '#00ADB5', + 'teal': '#00ADB5', }, 'error': { 'red': '#CA0707' diff --git a/website/src/App.css b/website/src/App.css index 6551596..575e2d9 100644 --- a/website/src/App.css +++ b/website/src/App.css @@ -1,6 +1,6 @@ .App { text-align: center; - font-family: 'Inter', sans-serif; + font-family: "Inter", sans-serif; } .App-logo { @@ -30,23 +30,21 @@ } :root { - --brand-temp-teal: #00ADB5; - --white-hover: #DBE4EF; + --brand-teal: #00adb5; + --white-hover: #dbe4ef; } - .bgAnvil { position: relative; width: 100%; height: 100%; background-color: var(--white-hover); - background-image: url('AnvilClose3Flipped.png'); + background-image: url("AnvilClose3Flipped.png"); background-size: contain; - background-position:100% 50px; + background-position: 100% 50px; background-repeat: no-repeat; } - .bigWordmark { margin-bottom: 10%; } @@ -64,7 +62,6 @@ justify-content: center; width: 100%; height: 100%; - } .textbox-col { display: flex; @@ -72,19 +69,18 @@ align-items: flex-start; width: 100%; padding-top: 2%; - padding-bottom: 5%; - padding-left: 5%; - padding-right: 5%; + padding-bottom: 5%; + padding-left: 5%; + padding-right: 5%; box-sizing: border-box; /* Include padding in the width calculation */ - } .formContainer { - display: flex; - flex-direction: column; - max-width: 30%; - align-items: center; - justify-content: center; - padding-left: 5%; + display: flex; + flex-direction: column; + max-width: 30%; + align-items: center; + justify-content: center; + padding-left: 5%; } .text-left-align { text-align: left; @@ -93,7 +89,6 @@ font-size: 48px; font-weight: 400; margin-bottom: 5%; - } .text-par { font-size: 32px; @@ -103,9 +98,9 @@ background-color: var(--white-hover); border-radius: 20px; padding-top: 2%; - padding-bottom: 5%; - padding-left: 5%; - padding-right: 5%; + padding-bottom: 5%; + padding-left: 5%; + padding-right: 5%; margin: 2%; flex: 1; } @@ -115,26 +110,23 @@ width: 100%; height: 100%; } -.button-brand-temp-teal { - background-color: var(--brand-temp-teal); - color: white; - border-radius: 16px; +.button-brand-teal { + background-color: var(--brand-teal); + color: white; + border-radius: 16px; width: 100%; border: none; - padding: 16px 24px; - font-size: 20px; + padding: 16px 24px; + font-size: 20px; font-weight: 600; cursor: pointer; transition: background-color 0.3s ease; - - } .button:hover { opacity: 0.75; } - @keyframes App-logo-spin { from { transform: rotate(0deg); diff --git a/website/src/Button.tsx b/website/src/Button.tsx index a13ab54..1ed1b67 100644 --- a/website/src/Button.tsx +++ b/website/src/Button.tsx @@ -1,9 +1,11 @@ -function Button(props: { label: string, handleClick: () => void, customClassName?:string }) { +import React from 'react' + +function Button(props: { label: string, handleClick: () => void, customClassName?: string }) { const className = props.customClassName || ''; return ( ); - } +} export default Button; diff --git a/website/src/PersonalInfoForm.tsx b/website/src/PersonalInfoForm.tsx index 7420f82..45e9903 100644 --- a/website/src/PersonalInfoForm.tsx +++ b/website/src/PersonalInfoForm.tsx @@ -3,96 +3,96 @@ import TextField from '@mui/material/TextField'; import Grid from '@mui/material/Grid'; import Button from './Button'; -function PersonalInfoForm(){ - const [formData, setFormData] = useState({ - firstName: '', - lastName: '', - email: '', - phone: '', - }); +function PersonalInfoForm() { + const [formData, setFormData] = useState({ + firstName: '', + lastName: '', + email: '', + phone: '', + }); - const handleChange = (e: React.ChangeEvent) => { - const { name, value } = e.target; - setFormData({ - ...formData, - [name]: value - }); - } + const handleChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setFormData({ + ...formData, + [name]: value + }); + } - const handleSubmit = (e: React.FormEvent) => { - console.log(formData); + const handleSubmit = (e: React.FormEvent) => { + console.log(formData); + } + const customInputStyle = { + backgroundColor: 'white', + borderRadius: '16px', + '& .MuiOutlinedInput-notchedOutline': { + borderColor: 'transparent', + }, + '&:hover .MuiOutlinedInput-notchedOutline': { + borderColor: 'transparent', + }, + '&.MuiFocused .MuiOutlinedInput-notchedOutline': { + borderColor: 'transparent', + }, + '& .MuiInputLabel-root': { + color: '#C4C4C4', } - const customInputStyle = { - backgroundColor: 'white', - borderRadius: '16px', - '& .MuiOutlinedInput-notchedOutline': { - borderColor: 'transparent', - }, - '&:hover .MuiOutlinedInput-notchedOutline': { - borderColor: 'transparent', - }, - '&.MuiFocused .MuiOutlinedInput-notchedOutline': { - borderColor: 'transparent', - }, - '& .MuiInputLabel-root': { - color:'#C4C4C4', - } - }; + }; - return ( -
- - - - - - + + + + + + - - - + + + - - - + + + - - - - - - - ); + /> + + + + +
+ + ); } export default PersonalInfoForm; diff --git a/website/tailwind.config.js b/website/tailwind.config.js index 48d29f6..117a4e6 100644 --- a/website/tailwind.config.js +++ b/website/tailwind.config.js @@ -20,7 +20,7 @@ module.exports = { 'hover': '#DBE4EF' }, 'light-grey': '#C4C4C4', - 'temp-teal': '#00ADB5', + 'teal': '#00ADB5', }, 'error': { 'red': '#CA0707'