diff --git a/apps/open-spark/components/header/index.tsx b/apps/open-spark/components/header/index.tsx
index 82129eb71..4ab51a56e 100644
--- a/apps/open-spark/components/header/index.tsx
+++ b/apps/open-spark/components/header/index.tsx
@@ -27,7 +27,7 @@ const Header = () => {
{renderTopHeader && (
t[key]}
headerConstants={{
blackList: {
diff --git a/apps/open-spark/components/signIn/SignIn.tsx b/apps/open-spark/components/signIn/SignIn.tsx
index fd1649da6..34a755eac 100644
--- a/apps/open-spark/components/signIn/SignIn.tsx
+++ b/apps/open-spark/components/signIn/SignIn.tsx
@@ -2,12 +2,11 @@ import React, { useState, useMemo } from 'react'
import { BecknAuth } from '@beckn-ui/becknified-components'
import { FormErrors, SignInFormProps } from '@beckn-ui/common/lib/types'
import { signInValidateForm } from '@beckn-ui/common'
-import energyIcon from '@public/images/energy-icon.svg'
+import openSpark from '@public/images/openSparkLogo.svg'
import { useLanguage } from '@hooks/useLanguage'
import { Box } from '@chakra-ui/react'
import Router from 'next/router'
import { useBapTradeLoginMutation, useBppTradeLoginMutation } from '@services/UserService'
-import { accountType } from '@utils/auth'
const SignIn = ({ initialFormData = { email: '', password: '' } }) => {
const [formData, setFormData] = useState(initialFormData)
@@ -16,7 +15,6 @@ const SignIn = ({ initialFormData = { email: '', password: '' } }) => {
const [bppLogin, { isLoading: bppLoading }] = useBppTradeLoginMutation()
const { t } = useLanguage()
- // Handle input change and validation
const handleInputChange = (e: React.ChangeEvent) => {
const { name, value } = e.target
@@ -37,14 +35,12 @@ const SignIn = ({ initialFormData = { email: '', password: '' } }) => {
}))
}
- // Check if form is filled
const isFormFilled = useMemo(() => {
return (
Object.values(formData).every(value => value !== '') && Object.values(formErrors).every(value => value === '')
)
}, [formData, formErrors])
- // Handle sign-in action
const handleSignIn = async () => {
const signInData = {
email: formData.email,
@@ -56,7 +52,6 @@ const SignIn = ({ initialFormData = { email: '', password: '' } }) => {
Router.push('/')
} catch (error) {
console.error('An error occurred:', error)
- // Handle error state or display error message
}
}
@@ -64,18 +59,18 @@ const SignIn = ({ initialFormData = { email: '', password: '' } }) => {
Router.push('/signUp')
}
- const handleChooseAuthType = (id: string) => {}
+ const handleProducer = () => {
+ Router.push('/producerLogin')
+ }
return (
{
error: formErrors.password,
dataTest: 'input-password'
}
+ ],
+ socialButtons: [
+ {
+ text: 'Sign In as Producer',
+ handleClick: handleProducer,
+ variant: 'outline',
+ colorScheme: 'primary',
+ dataTest: 'producer-button'
+ }
]
}}
/>
diff --git a/apps/open-spark/components/signUp/signUp.tsx b/apps/open-spark/components/signUp/signUp.tsx
index b0a416283..d389e90d7 100644
--- a/apps/open-spark/components/signUp/signUp.tsx
+++ b/apps/open-spark/components/signUp/signUp.tsx
@@ -1,17 +1,18 @@
import React, { useMemo, useState } from 'react'
import { BecknAuth } from '@beckn-ui/becknified-components'
-import { Box, useBreakpoint } from '@chakra-ui/react'
+import { Box, useBreakpoint, theme } from '@chakra-ui/react'
import { FetchBaseQueryError } from '@reduxjs/toolkit/query'
import Router from 'next/router'
import { FormErrors, SignInResponse, SignUpFormProps } from '@beckn-ui/common/lib/types'
import { useBapTradeRegisterMutation, useBppTradeRegisterMutation } from '@services/UserService'
-import energyIcon from '@public/images/energy-icon.svg'
+import openSpark from '@public/images/openSparkLogo.svg'
import { useLanguage } from '@hooks/useLanguage'
import { CustomFormErrorProps, signUpValidateForm } from '@utils/form-utils'
import { accountType } from '@utils/auth'
interface RegisterFormProps extends SignUpFormProps {
utilityCompany: string
+ address: string
}
const baseUrl = process.env.NEXT_PUBLIC_STRAPI_URL
@@ -20,6 +21,7 @@ const SignUp = () => {
const [formData, setFormData] = useState({
email: '',
password: '',
+ address: '',
mobileNumber: '',
name: '',
utilityCompany: ''
@@ -36,6 +38,7 @@ const SignUp = () => {
const [bapTradeRegister, { isLoading: bapLoading }] = useBapTradeRegisterMutation()
const [bppTradeRegister, { isLoading: bppLoading }] = useBppTradeRegisterMutation()
const { t } = useLanguage()
+ const [termsAccepted, setTermsAccepted] = useState(false)
// Handle input change and validation
const handleInputChange = (e: React.ChangeEvent) => {
@@ -141,8 +144,6 @@ const SignUp = () => {
Router.push('/signIn')
}
- const handleChooseAuthType = (id: string) => {}
-
return (
{
{
error: formErrors.email
},
{
- type: 'password',
- name: 'password',
- value: formData.password,
+ type: 'text',
+ name: 'address',
+ value: formData.address,
handleChange: handleInputChange,
- label: t.enterPassword,
- error: formErrors.password
+ label: t.enterAddrees
},
{
type: 'number',
@@ -220,8 +218,27 @@ const SignUp = () => {
handleChange: handleSelectChange,
label: t.selectUtilityCompany,
error: formErrors.utilityCompany
+ },
+ {
+ type: 'password',
+ name: 'password',
+ value: formData.password,
+ handleChange: handleInputChange,
+ label: t.enterPassword,
+ error: formErrors.password
+ }
+ ],
+ showTermsCheckbox: true,
+ termsCheckboxProps: {
+ isChecked: termsAccepted,
+ color: '#4498E8',
+ onChange: e => setTermsAccepted(e.target.checked),
+ termsText: {
+ serviceName: 'Open Spark',
+ termsLink: '/terms',
+ privacyLink: '/privacy'
}
- ]
+ }
}}
/>
diff --git a/apps/open-spark/locales/en.ts b/apps/open-spark/locales/en.ts
index 3a5a23c89..078aadd88 100644
--- a/apps/open-spark/locales/en.ts
+++ b/apps/open-spark/locales/en.ts
@@ -29,11 +29,12 @@ const en: { [key: string]: string } = {
formAddress: 'Complete Address',
formZipCode: 'Zip Code',
name: 'Name',
- fullName: 'Enter Your Full Name',
+ fullName: 'Enter Your Full Name / Company Name',
password: 'Password',
enterPassword: 'Enter Password',
email: 'Email',
enterEmailID: 'Enter Email ID',
+ enterAddrees: 'Enter Address',
enterYourPassword: 'Please Enter Your Password',
enterYourEmail: 'Please Enter Your Email',
doHaveAnAccount: "Don't You Have An Account? ",
diff --git a/apps/open-spark/pages/_app.tsx b/apps/open-spark/pages/_app.tsx
index 6ec03d103..084df67d4 100644
--- a/apps/open-spark/pages/_app.tsx
+++ b/apps/open-spark/pages/_app.tsx
@@ -21,7 +21,7 @@ function MyApp({ Component, pageProps }: AppProps) {
{
+ const router = useRouter()
+ return (
+
+
+
+
+ Hello,
+
+
+ Welcome to Open Spark
+
+
+
+ router.push('/consumer')}
+ variant="solid"
+ />
+ router.push('/producer')}
+ variant="outline"
+ />
+
+
+ )
+}
+
+export default welcome
diff --git a/apps/open-spark/public/images/CabImg.svg b/apps/open-spark/public/images/CabImg.svg
deleted file mode 100644
index 9cacef4c8..000000000
--- a/apps/open-spark/public/images/CabImg.svg
+++ /dev/null
@@ -1,20 +0,0 @@
-
diff --git a/apps/open-spark/public/images/Call.svg b/apps/open-spark/public/images/Call.svg
deleted file mode 100644
index 6dfc69832..000000000
--- a/apps/open-spark/public/images/Call.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/Frame.svg b/apps/open-spark/public/images/Frame.svg
deleted file mode 100644
index e068f0de2..000000000
--- a/apps/open-spark/public/images/Frame.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/Indicator.svg b/apps/open-spark/public/images/Indicator.svg
deleted file mode 100644
index 59c5a3233..000000000
--- a/apps/open-spark/public/images/Indicator.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/OpenSparkTopLogo.svg b/apps/open-spark/public/images/OpenSparkTopLogo.svg
new file mode 100644
index 000000000..14e3c5611
--- /dev/null
+++ b/apps/open-spark/public/images/OpenSparkTopLogo.svg
@@ -0,0 +1,3 @@
+
diff --git a/apps/open-spark/public/images/Profile.svg b/apps/open-spark/public/images/Profile.svg
deleted file mode 100644
index f39af2803..000000000
--- a/apps/open-spark/public/images/Profile.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/Star.svg b/apps/open-spark/public/images/Star.svg
deleted file mode 100644
index 488001517..000000000
--- a/apps/open-spark/public/images/Star.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/blankImg.svg b/apps/open-spark/public/images/blankImg.svg
deleted file mode 100644
index d3cfc4a4d..000000000
--- a/apps/open-spark/public/images/blankImg.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/buyer-icon.svg b/apps/open-spark/public/images/buyer-icon.svg
deleted file mode 100644
index f0aac8507..000000000
--- a/apps/open-spark/public/images/buyer-icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/open-spark/public/images/cabIcon.svg b/apps/open-spark/public/images/cabIcon.svg
deleted file mode 100644
index 3d06c6b77..000000000
--- a/apps/open-spark/public/images/cabIcon.svg
+++ /dev/null
@@ -1,20 +0,0 @@
-
diff --git a/apps/open-spark/public/images/callIcon.svg b/apps/open-spark/public/images/callIcon.svg
deleted file mode 100644
index 05ec633e5..000000000
--- a/apps/open-spark/public/images/callIcon.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/apps/open-spark/public/images/car.svg b/apps/open-spark/public/images/car.svg
deleted file mode 100644
index b83636386..000000000
--- a/apps/open-spark/public/images/car.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-
diff --git a/apps/open-spark/public/images/carImage.svg b/apps/open-spark/public/images/carImage.svg
deleted file mode 100644
index 468211ec5..000000000
--- a/apps/open-spark/public/images/carImage.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
diff --git a/apps/open-spark/public/images/contactSupport.svg b/apps/open-spark/public/images/contactSupport.svg
deleted file mode 100644
index e46f87edf..000000000
--- a/apps/open-spark/public/images/contactSupport.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/apps/open-spark/public/images/description.svg b/apps/open-spark/public/images/description.svg
deleted file mode 100644
index ec00d2b18..000000000
--- a/apps/open-spark/public/images/description.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/apps/open-spark/public/images/destinationIcon.svg b/apps/open-spark/public/images/destinationIcon.svg
deleted file mode 100644
index dfc383029..000000000
--- a/apps/open-spark/public/images/destinationIcon.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/directions_car.svg b/apps/open-spark/public/images/directions_car.svg
deleted file mode 100644
index 9b9ca02fb..000000000
--- a/apps/open-spark/public/images/directions_car.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/open-spark/public/images/driverImage.svg b/apps/open-spark/public/images/driverImage.svg
deleted file mode 100644
index e54ff58e1..000000000
--- a/apps/open-spark/public/images/driverImage.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/open-spark/public/images/ellipse.png b/apps/open-spark/public/images/ellipse.png
deleted file mode 100644
index a0090e1fe..000000000
Binary files a/apps/open-spark/public/images/ellipse.png and /dev/null differ
diff --git a/apps/open-spark/public/images/enable_location.svg b/apps/open-spark/public/images/enable_location.svg
deleted file mode 100644
index 87f5efd88..000000000
--- a/apps/open-spark/public/images/enable_location.svg
+++ /dev/null
@@ -1,11 +0,0 @@
-
diff --git a/apps/open-spark/public/images/energy-icon.svg b/apps/open-spark/public/images/energy-icon.svg
deleted file mode 100644
index 633e65182..000000000
--- a/apps/open-spark/public/images/energy-icon.svg
+++ /dev/null
@@ -1,187 +0,0 @@
-
-
diff --git a/apps/open-spark/public/images/green-tick.svg b/apps/open-spark/public/images/green-tick.svg
deleted file mode 100644
index e3d6c15a9..000000000
--- a/apps/open-spark/public/images/green-tick.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/open-spark/public/images/local_taxi.svg b/apps/open-spark/public/images/local_taxi.svg
deleted file mode 100644
index 39c1f8d21..000000000
--- a/apps/open-spark/public/images/local_taxi.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/open-spark/public/images/logOutIcon.svg b/apps/open-spark/public/images/logOutIcon.svg
deleted file mode 100644
index dc0f1a26d..000000000
--- a/apps/open-spark/public/images/logOutIcon.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/apps/open-spark/public/images/mail.svg b/apps/open-spark/public/images/mail.svg
deleted file mode 100644
index 7ca733b59..000000000
--- a/apps/open-spark/public/images/mail.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/open-spark/public/images/manufacturing.svg b/apps/open-spark/public/images/manufacturing.svg
deleted file mode 100644
index 683919470..000000000
--- a/apps/open-spark/public/images/manufacturing.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/open-spark/public/images/map_car.svg b/apps/open-spark/public/images/map_car.svg
deleted file mode 100644
index 8fca4183b..000000000
--- a/apps/open-spark/public/images/map_car.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/open-spark/public/images/map_pin.svg b/apps/open-spark/public/images/map_pin.svg
deleted file mode 100644
index a49bbea6d..000000000
--- a/apps/open-spark/public/images/map_pin.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-
diff --git a/apps/open-spark/public/images/my_location.svg b/apps/open-spark/public/images/my_location.svg
deleted file mode 100644
index baed127fc..000000000
--- a/apps/open-spark/public/images/my_location.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/open-spark/public/images/near_me.svg b/apps/open-spark/public/images/near_me.svg
deleted file mode 100644
index c2ca9b285..000000000
--- a/apps/open-spark/public/images/near_me.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/offline.svg b/apps/open-spark/public/images/offline.svg
deleted file mode 100644
index 268a894f6..000000000
--- a/apps/open-spark/public/images/offline.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/apps/open-spark/public/images/oil_barrel.svg b/apps/open-spark/public/images/oil_barrel.svg
deleted file mode 100644
index e7c0d0f30..000000000
--- a/apps/open-spark/public/images/oil_barrel.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/apps/open-spark/public/images/olaCab.svg b/apps/open-spark/public/images/olaCab.svg
deleted file mode 100644
index bb091ecb9..000000000
--- a/apps/open-spark/public/images/olaCab.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/open-spark/public/images/openSparkLogo.svg b/apps/open-spark/public/images/openSparkLogo.svg
new file mode 100644
index 000000000..a1f0502cc
--- /dev/null
+++ b/apps/open-spark/public/images/openSparkLogo.svg
@@ -0,0 +1,10 @@
+
diff --git a/apps/open-spark/public/images/orderConfirm.svg b/apps/open-spark/public/images/orderConfirm.svg
deleted file mode 100644
index a85bab165..000000000
--- a/apps/open-spark/public/images/orderConfirm.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/open-spark/public/images/orderHistoryIcon.svg b/apps/open-spark/public/images/orderHistoryIcon.svg
deleted file mode 100644
index 745a21d08..000000000
--- a/apps/open-spark/public/images/orderHistoryIcon.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/open-spark/public/images/origin_icon.svg b/apps/open-spark/public/images/origin_icon.svg
deleted file mode 100644
index 263e43595..000000000
--- a/apps/open-spark/public/images/origin_icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/open-spark/public/images/pickUpIcon.svg b/apps/open-spark/public/images/pickUpIcon.svg
deleted file mode 100644
index bd063df05..000000000
--- a/apps/open-spark/public/images/pickUpIcon.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/ripple.svg b/apps/open-spark/public/images/ripple.svg
deleted file mode 100644
index c7dc50253..000000000
--- a/apps/open-spark/public/images/ripple.svg
+++ /dev/null
@@ -1,29 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/open-spark/public/images/rupees.svg b/apps/open-spark/public/images/rupees.svg
deleted file mode 100644
index 97e777cc1..000000000
--- a/apps/open-spark/public/images/rupees.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/apps/open-spark/public/images/seller-icon.svg b/apps/open-spark/public/images/seller-icon.svg
deleted file mode 100644
index 91d1594e7..000000000
--- a/apps/open-spark/public/images/seller-icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/open-spark/public/images/taxi-bap-logo.svg b/apps/open-spark/public/images/taxi-bap-logo.svg
deleted file mode 100644
index 3adfdc716..000000000
--- a/apps/open-spark/public/images/taxi-bap-logo.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/apps/open-spark/public/images/taxiIcon.svg b/apps/open-spark/public/images/taxiIcon.svg
deleted file mode 100644
index 22cff821a..000000000
--- a/apps/open-spark/public/images/taxiIcon.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-
diff --git a/apps/open-spark/public/images/taxi_hub.svg b/apps/open-spark/public/images/taxi_hub.svg
deleted file mode 100644
index 15343577f..000000000
--- a/apps/open-spark/public/images/taxi_hub.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-
diff --git a/apps/open-spark/public/images/travelbuddy_icon.svg b/apps/open-spark/public/images/travelbuddy_icon.svg
deleted file mode 100644
index c62d752c8..000000000
--- a/apps/open-spark/public/images/travelbuddy_icon.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-
diff --git a/apps/open-spark/public/images/userProfile.svg b/apps/open-spark/public/images/userProfile.svg
deleted file mode 100644
index 55e94f9e6..000000000
--- a/apps/open-spark/public/images/userProfile.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/apps/open-spark/public/images/welcome.svg b/apps/open-spark/public/images/welcome.svg
new file mode 100644
index 000000000..a3dbd7216
--- /dev/null
+++ b/apps/open-spark/public/images/welcome.svg
@@ -0,0 +1,19 @@
+
diff --git a/packages/becknified-components/src/pages/auth/auth.module.css b/packages/becknified-components/src/pages/auth/auth.module.css
index da408618a..e0a087475 100644
--- a/packages/becknified-components/src/pages/auth/auth.module.css
+++ b/packages/becknified-components/src/pages/auth/auth.module.css
@@ -30,6 +30,9 @@
Button.auth_btn {
border: 1px solid;
}
+.auth_checkbox_container label {
+ align-items: baseline;
+}
@media (min-width: 1280px) {
.main_container {
diff --git a/packages/becknified-components/src/pages/auth/auth.tsx b/packages/becknified-components/src/pages/auth/auth.tsx
index 7492770aa..ced5b1133 100644
--- a/packages/becknified-components/src/pages/auth/auth.tsx
+++ b/packages/becknified-components/src/pages/auth/auth.tsx
@@ -1,7 +1,5 @@
import React, { useState } from 'react'
-import { Box, Flex, Image } from '@chakra-ui/react'
-
-// Custom
+import { Box, Checkbox, Flex, Text, Image, Link, border } from '@chakra-ui/react'
import { Button, GenericDropdown, Input, Loader, Typography } from '@beckn-ui/molecules'
import Styles from './auth.module.css'
import { AuthProps } from './auth.types'
@@ -9,7 +7,17 @@ import AuthDivider from './authDivider'
import greenTick from '../../../public/images/green-tick.svg'
const Auth: React.FC = ({ schema, isLoading, dataTestForm }) => {
- const { logo, inputs, buttons, socialButtons, loader, chooseAuthType, handleAccountType } = schema
+ const {
+ logo,
+ inputs,
+ buttons,
+ socialButtons,
+ loader,
+ chooseAuthType,
+ handleAccountType,
+ showTermsCheckbox = false,
+ termsCheckboxProps
+ } = schema
const [accountType, setAccountType] = useState('')
@@ -67,8 +75,9 @@ const Auth: React.FC = ({ schema, isLoading, dataTestForm }) => {
gap="2rem"
alignSelf={'center'}
>
- {chooseAuthType.map(authType => (
+ {chooseAuthType.map((authType, index) => (
= ({ schema, isLoading, dataTestForm }) => {
}}
/>
)}
- {/* {accountType.label && } */}
))}
@@ -120,9 +128,7 @@ const Auth: React.FC = ({ schema, isLoading, dataTestForm }) => {
placeholder={singleInput.label}
selectedValue={singleInput?.value || ''}
handleChange={singleInput.handleChange as any}
- buttonStyles={{
- marginBottom: '35px'
- }}
+ buttonStyles={{ marginBottom: '35px' }}
/>
)
}
@@ -136,6 +142,73 @@ const Auth: React.FC = ({ schema, isLoading, dataTestForm }) => {
})}
+ {showTermsCheckbox && termsCheckboxProps && (
+
+
+
+ I agree to the {termsCheckboxProps.termsText.serviceName}
+
+ Terms of Service
+
+
+ and
+
+
+
+ Privacy Policy
+
+
+
+ )}
+
{buttons.map(singleButton => {
return (