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

Havre loic/first time user interests next page 965 #991

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions apps/app/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ThemeProvider } from 'styled-components';
import theme from '../styles/theme';
import Script from 'next/script';
import iubendaScript from '../scripts/iubendaScript';
import { OnboardingProvider } from '../../website/src/context/OnboardingContext'
Copy link
Contributor

Choose a reason for hiding this comment

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

I will double-check to see if this is the right _app.js file to import context api



const hashRedirect = (router) => {
Expand Down Expand Up @@ -49,31 +50,33 @@ function MyApp({ Component, pageProps }) {
<>
<UserDataProvider>
<ThemeProvider theme={theme}>
<div>
<script
type="text/partytown"
dangerouslySetInnerHTML={{ __html: iubendaScript }}
/>
<Script
strategy="worker"
async
src="//cdn.iubenda.com/cs/iubenda_cs.js"
></Script>
<Head>
<OnboardingProvider>
<div>
<script
type="text/partytown"
dangerouslySetInnerHTML={{ __html: iubendaScript }}
/>
<Script
strategy="worker"
async
src="https://www.googletagmanager.com/gtag/js?id=AW-599284852"
></script>
</Head>
src="//cdn.iubenda.com/cs/iubenda_cs.js"
></Script>
<Head>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=AW-599284852"
></script>
</Head>

<div className="App">
<div className="App">
</div>
<Navigation />

<Component {...pageProps} />
{/* {props.children} */}
<Footer />
</div>
<Navigation />

<Component {...pageProps} />
{/* {props.children} */}
<Footer />
</div>
</OnboardingProvider>
</ThemeProvider>
</UserDataProvider>
</>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/pages/onboarding.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Page from '@devlaunchers/website/src/pages/onboarding';
import Page from '@devlaunchers/website/src/pages/userOnboardingPage.js';
import App from '@devlaunchers/website/src/pages/_app';
export { getStaticProps } from '@devlaunchers/website/src/pages/index';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import React, { useState } from 'react'
import FormField from '@devlaunchers/components/src/components/organisms/FormField'
import OpenResponse from '@devlaunchers/components/components/organisms/OpenResponse'
import { Checkbox } from '@devlaunchers/components/components/atoms'
import { Link } from '@devlaunchers/components/components/atoms'
import OnboardingForm from './OnboardingForm'
import Button from '@devlaunchers/components/components/atoms/Button'
import FormFieldMargin, { ConfirmationSection, CheckboxSpacing } from './StyledUserOnboarding'
import { useRouter } from 'next/router'

const initialValue = {
firstName: '',
lastName: '',
bio: ''
}

export default function BasicInformationPage() {
const [person, setPerson] = useState(initialValue)
const router = useRouter()

const handleFirstNameChange = (e) => {
setPerson({
...person,
firstName: e.target.value
})
}

const handleLastNameChange = (e) => {
setPerson({
...person,
lastName: e.target.value
})
}

const handleBioChange = (e) => {
setPerson({
...person,
bio: e.target.value
})
}

const handleContinueClick = (e) => {
router.push('/users/profiles')
e.preventDefault()
}

return (
<OnboardingForm>
<form>
<FormFieldMargin>
<FormField
error=""
label="FIRST NAME"
value={person.firstName}
onChange={handleFirstNameChange}
placeholder="Placeholder"
/>
</FormFieldMargin>

<FormFieldMargin>
<FormField
error=""
name=''
label="LAST NAME"
value={person.lastName}
onChange={handleLastNameChange}
placeholder="Placeholder"
/>
</FormFieldMargin>

<FormFieldMargin mb>
<OpenResponse
cols={50}
error=""
label="BIO"
value={person.bio}
onChange={handleBioChange}
placeholder="Placeholder"
rows={5}
/>
</FormFieldMargin>

<FormFieldMargin>
<ConfirmationSection>

<CheckboxSpacing>
<Checkbox
required
onChange={function noRefCheck() { }}
/>
</CheckboxSpacing>

<div>
<>I have read and agree to the</>
<br />
<Link
href="https://devlaunchers.org/page/terms-and-conditions"
text="Terms of Service"
/>
&nbsp;<b>&</b>&nbsp;
<Link
href="https://devlaunchers.org/page/privacy-policy"
text="Privacy Policy"
/>
. <b className='red'>*</b>
</div>
</ConfirmationSection>
</FormFieldMargin>

<div className='separator'></div>

<Button
className='continue-btn'
buttonSize="standard"
buttonType="primary"
onClick={handleContinueClick}
>
Continue
</Button>
</form>
</OnboardingForm>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./BasicInformationPage";
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,3 @@ const UserOnboarding = () => {
</OnboardingForm>
)
}

export default UserOnboarding

This file was deleted.

14 changes: 14 additions & 0 deletions apps/website/src/context/OnboardingContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createContext, useContext, useState } from "react";

const OnboardingContext = createContext()

export const OnboardingProvider = ({ children }) => {

return (
<OnboardingContext.Provider value={{}}>
{children}
</OnboardingContext.Provider>
)
}

export const useOnboarding = () => useContext(OnboardingContext)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head';
import UserOnboarding from '../components/modules/UserOnboardingProcess/UserOnboarding';
import BasicInformationPage from '../components/modules/BasicInformationPage/UserOnboarding/BasicInformationPage';

export default function UserOnboardingRoute() {
return (
Expand All @@ -8,7 +8,7 @@ export default function UserOnboardingRoute() {
<title>User Onboarding</title>
</Head>
<div>
<UserOnboarding />
<BasicInformationPage />
</div>
</>
);
Expand Down