diff --git a/src/components/input/InputWidget.tsx b/src/components/input/InputWidget.tsx index 9f1ec95..1277beb 100644 --- a/src/components/input/InputWidget.tsx +++ b/src/components/input/InputWidget.tsx @@ -1,6 +1,6 @@ import { IonButton, IonIcon } from '@ionic/react'; import { eyeOutline, eyeOffOutline } from 'ionicons/icons'; -import { Component } from 'react'; +import React, { useState } from 'react'; import styles from './InputWidget.module.scss'; type Props = { @@ -10,37 +10,24 @@ type Props = { hideEye?: boolean }; -type OwnState = { - showPassword: boolean, -}; - -class InputWidget extends Component { - constructor( - props: Props - ) { - super(props); - this.state = { - showPassword: false - }; - } +const InputWidget: React.FC = (props) => { + let [showPassword, toggleEye] = useState(false); - render() { - return
- { this.props.icon && } + return (
+ { props.icon && } - { this.props.type === 'TEXT' && } - { this.props.type === 'PASSWORD' && } + { props.type === 'TEXT' && } + { props.type === 'PASSWORD' && } - { this.props.type === 'PHONE' && } + { props.type === 'PHONE' && } - { this.props.type === 'PASSWORD' && !this.props.hideEye && - this.setState({ showPassword: !this.state.showPassword })}> - { this.state.showPassword && } - { !this.state.showPassword && } + { props.type === 'PASSWORD' && !props.hideEye && + { toggleEye(showPassword = !showPassword) } }> + { showPassword && } + { !showPassword && } } -
- }; +
); }; export default InputWidget; diff --git a/src/pages/login/Login.tsx b/src/pages/login/Login.tsx index 176eb60..2e86e7e 100644 --- a/src/pages/login/Login.tsx +++ b/src/pages/login/Login.tsx @@ -1,24 +1,15 @@ import { IonContent, IonPage, IonButton } from '@ionic/react'; import { personOutline, lockOpenOutline } from 'ionicons/icons'; -import { Component } from 'react'; +import React from 'react'; import InputWidget from '../../components/input/InputWidget'; import styles from './Login.module.scss'; import { Link } from "react-router-dom"; type Props = { }; -type OwnState = { }; - -class LoginPage extends Component { - constructor( - props: Props - ) { - super(props); - this.state = {}; - } - - render() { - return +const LoginPage: React.FC = () => { + return ( +
@@ -48,7 +39,7 @@ class LoginPage extends Component {
Don't have an account? Signup
- }; + ); }; export default LoginPage; diff --git a/src/pages/onboarding/Welcome.tsx b/src/pages/onboarding/Welcome.tsx index 69d066f..b44b9bc 100644 --- a/src/pages/onboarding/Welcome.tsx +++ b/src/pages/onboarding/Welcome.tsx @@ -1,45 +1,34 @@ import { IonContent, IonPage, IonButton } from '@ionic/react'; -import { Component } from 'react'; +import React from 'react'; import styles from './Welcome.module.scss'; type Props = { }; -type OwnState = { }; +const WelcomePage: React.FC = () => { + return ( + +
+
+ upfold image +
+
-class WelcomePage extends Component { - constructor( - props: Props - ) { - super(props); - this.state = {}; - } +
+
+

Let's Get Started

+

+ Welcome to WorkX +

- render() { - return - -
-
- upfold image -
-
- -
-
-

Let's Get Started

-

- Welcome to WorkX -

- -
- Create Account - Login -
+
+ Create Account + Login
-
- -
-
- }; +
+
+ +
+
); }; export default WelcomePage; diff --git a/src/pages/signup/AdditionalQuestions.tsx b/src/pages/signup/AdditionalQuestions.tsx index df559e2..9804fc4 100644 --- a/src/pages/signup/AdditionalQuestions.tsx +++ b/src/pages/signup/AdditionalQuestions.tsx @@ -1,20 +1,7 @@ import { IonContent, IonRange, IonButton, IonSlides, IonSlide, IonIcon } from '@ionic/react'; -import { Component } from 'react'; +import React, { useState, useRef, createRef } from 'react'; import styles from './AdditionalQuestions.module.scss'; -type Props = { }; - -type OwnState = { - index: number, - userType: 'INDIVIDUAL' | 'COMPANY' | '', - userSector: { - value: number, - icon: string, - text: string - } | undefined, - showPicker: boolean, -}; - const slideOpts = { initialSlide: 2, speed: 400, @@ -66,124 +53,117 @@ const jobSectors = [{ text: 'Others' }]; +const AdditionalQuestions: React.FC = () => { + let [index, setIndex] = useState(0), + [userType, changeUserType] = useState('INDIVIDUAL'), + [userSector, changeUserSector] = useState(jobSectors[0]), + [showPicker, toggleShowPicker] = useState(false); + const additionalSlides: any = useRef(null); -class AdditionalQuestions extends Component { - constructor( - props: Props - ) { - super(props); - this.state = { - index: 0, - userType: 'INDIVIDUAL', - showPicker: false, - userSector: undefined, - }; - - + const changeIndex = async (event: any) => { + await event.target.getActiveIndex().then((index: number) => setIndex(index = index)); } - getPadding = (digit: number) => { + const getPadding = (digit: number) => { return digit.toString().padStart(2, '0'); } - nextSlide = async () => { - let slides: any = document.querySelector('#slides'); - const swiper: any = await slides?.getSwiper(); + const nextSlide = async () => { + const swiper: any = await additionalSlides.current?.getSwiper(); swiper.slideNext(); } - prevSlide = async () => { - let slides: any = document.querySelector('#slides'); - const swiper: any = await slides?.getSwiper(); + const prevSlide = async () => { + const swiper: any = await additionalSlides.current?.getSwiper(); swiper.slidePrev(); } - render() { - return -
-

- { this.getPadding(this.state.index + 1)}/05 -

- Skip -
- - -
-

Select if you represent a company or if you're an individual

-

Select answer below

-
-
-
- - -
-
-
- - -
-

Which sector - { this.state.userType === 'COMPANY' && does your company below to? } - { this.state.userType === 'INDIVIDUAL' && do you work under? }

-

Select answer below

+ return ( +
+

+ { getPadding(index + 1)}/05 +

+ Skip +
+ + changeIndex(e)}> + +
+

Select if you represent a company or if you're an individual

+

Select answer below

+
+
+
+ +
-
-
- -
+
+ + + +
+

Which sector + { userType === 'COMPANY' && does your company below to? } + { userType === 'INDIVIDUAL' && do you work under? }

+

Select answer below

+
+
+
+
- +
+
- -
-

What is your working team size?

-

Select answer below

-
-
- -
-
+ +
+

What is your working team size?

+

Select answer below

+
+
+ +
+
- -
-

Select the modules that will be used.

-

Select answer below

-
-
+ +
+

Select the modules that will be used.

+

Select answer below

+
+
-
-
- +
+
+ - this.prevSlide() }> - - + prevSlide() }> + + - this.nextSlide() }> - Next - + nextSlide() }> + Next + - { this.state.showPicker &&
-
-
    - { jobSectors.map((sector) =>
  • this.setState({ userSector: sector, showPicker: false })}> - { sector.text } -
  • ) } -
-
-
} + { showPicker &&
+
+
    + { jobSectors.map((sector) =>
  • { toggleShowPicker(showPicker = false); changeUserSector(userSector = sector); } }> + { sector.text } +
  • ) } +
+
+
} - - }; + ); }; export default AdditionalQuestions; \ No newline at end of file diff --git a/src/pages/signup/Signup.module.scss b/src/pages/signup/Signup.module.scss index d93b273..2e78828 100644 --- a/src/pages/signup/Signup.module.scss +++ b/src/pages/signup/Signup.module.scss @@ -134,13 +134,11 @@ } .navigationLink { - position: absolute; - left: 0; width: 100%; - bottom: 10px; text-align: center; font-size: 14px; - color: var(--rock); + color: var(--rock); + margin-top: 30px; span, a { color: var(--shamrock); diff --git a/src/pages/signup/Signup.tsx b/src/pages/signup/Signup.tsx index afddc63..05ad1ed 100644 --- a/src/pages/signup/Signup.tsx +++ b/src/pages/signup/Signup.tsx @@ -1,79 +1,65 @@ import { IonContent, IonPage, IonButton, IonToggle } from '@ionic/react'; import { personOutline, lockOpenOutline, mailOutline, phonePortraitOutline } from 'ionicons/icons'; -import { Component } from 'react'; +import React, { useState } from 'react'; import InputWidget from '../../components/input/InputWidget'; import styles from './Signup.module.scss'; import { Link } from "react-router-dom"; import AdditionalQuestions from '../signup/AdditionalQuestions'; -type Props = { }; -type OwnState = { - signupStep: 'BASIC' | 'ADDITIONAL'; -}; - -class SignupPage extends Component { - constructor( - props: Props - ) { - super(props); - this.state = { - signupStep: 'ADDITIONAL' - }; - } +const SignupPage: React.FC = () => { + let [signupStep, changeStep] = useState('BASIC'); - render() { - return - { this.state.signupStep === 'BASIC' && - -
-
-
- rocket image -
-

Let's Create

-

Please provide few details below.

-
-
+ return ( + { signupStep === 'BASIC' && + +
+
+
+ rocket image +
+

Let's Create

+

Please provide few details below.

+
+
-
-
- -
-
- -
-
- -
- -
+
+
+ +
+
+ +
+
+ +
+ +
-
- -
+
+ +
-
- -
+
+ +
-
- - -
+
+ + +
-
- this.setState({ signupStep: 'ADDITIONAL' })}> Create -
-
+
+ changeStep(signupStep = 'ADDITIONAL')}> Create +
+
-
Already have an account? Login
-
} - - { this.state.signupStep === 'ADDITIONAL' && } -
- }; +
Already have an account? Login
+
} + + { signupStep === 'ADDITIONAL' && } +
); }; export default SignupPage;