-
Notifications
You must be signed in to change notification settings - Fork 8
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
PRESS2-1267-update-fork-new #363
Merged
girish-lokapure
merged 19 commits into
enhance/ai-onboarding
from
PRESS2-1267-update-fork-new
Dec 4, 2023
Merged
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e9545ef
initial commit
girish-lokapure a23773a
refactored code
girish-lokapure e23534f
restructured components
girish-lokapure def8d3c
restructured components
girish-lokapure 7889b70
fixed lint issues
girish-lokapure 0ad3cfc
PR feedbacks
girish-lokapure be5cc48
PR lint fixes
girish-lokapure 9108737
Merged ai onboarding branch
girish-lokapure 3fc3462
fixed lint issues
girish-lokapure faeaf7b
ui changes
girish-lokapure 55ca327
ui changes
girish-lokapure 66dc51f
fixed brand logo issue
girish-lokapure 813787f
fixed brand logo issue
girish-lokapure 46e4126
merged ai onboarding branch
girish-lokapure e2aa6cb
logo related change
girish-lokapure 4486dd0
merged ai-onboaring branch
girish-lokapure e960e12
fixed lint issues
girish-lokapure 52860d8
bg related changes
girish-lokapure 6981720
updated migration url
girish-lokapure File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/OnboardingSPA/components/HeadingWithSubHeading/SiteGen/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Interface Cards with standard design. | ||
* | ||
* @param {Object} root0 | ||
* @param {string} root0.title | ||
* @param {string} root0.subtitle | ||
*/ | ||
|
||
import { useSelect } from '@wordpress/data'; | ||
import { store as nfdOnboardingStore } from '../../../store'; | ||
|
||
const HeadingWithSubHeading = ( { title, subtitle } ) => { | ||
const { brandName } = useSelect( ( select ) => { | ||
return { | ||
brandName: select( nfdOnboardingStore ).getNewfoldBrandName(), | ||
}; | ||
} ); | ||
|
||
return ( | ||
<div className="nfd-onboarding-step__heading"> | ||
<h2 className="nfd-onboarding-step__heading__title">{ title }</h2> | ||
{ subtitle && ( | ||
<h3 className="nfd-onboarding-step__heading__subtitle"> | ||
{ subtitle } | ||
<div | ||
style={ { | ||
display: 'inline-flex', | ||
width: '20px', | ||
height: '20px', | ||
marginBottom: '-2px', | ||
backgroundImage: 'var(--nfd-onboarding-icon)', | ||
backgroundSize: 'contain', | ||
} } | ||
></div> | ||
{ brandName } | ||
</h3> | ||
) } | ||
</div> | ||
); | ||
}; | ||
|
||
export default HeadingWithSubHeading; |
24 changes: 24 additions & 0 deletions
24
src/OnboardingSPA/components/HeadingWithSubHeading/SiteGen/stylesheet.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.nfd-onboarding-step { | ||
|
||
&__heading { | ||
color: var(--nfd-onboarding-primary); | ||
width: 96%; | ||
margin: 50px 0 50px; | ||
line-height: 1; | ||
|
||
&__title { | ||
font-weight: 300; | ||
text-align: center; | ||
color: var(--nfd-onboarding-white); | ||
margin: 35px !important; | ||
font-size: 30px; | ||
} | ||
|
||
&__subtitle { | ||
color: var(--nfd-onboarding-white) !important; | ||
font-weight: 300; | ||
text-align: center; | ||
font-size: 20px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { SITEGEN_FLOW } from '../../data/flows/constants'; | ||
import { resolveGetDataForFlow } from '../../data/flows'; | ||
import { useSelect, useDispatch } from '@wordpress/data'; | ||
import { validateFlow } from '../../data/flows/utils'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { store as nfdOnboardingStore } from '../../store'; | ||
|
||
const StartOptions = ( { questionnaire, oldFlow, options } ) => { | ||
const navigate = useNavigate(); | ||
const { brandConfig, migrationUrl } = useSelect( ( select ) => { | ||
return { | ||
brandConfig: select( nfdOnboardingStore ).getNewfoldBrandConfig(), | ||
migrationUrl: select( nfdOnboardingStore ).getMigrationUrl(), | ||
}; | ||
} ); | ||
const { | ||
updateAllSteps, | ||
updateTopSteps, | ||
updateRoutes, | ||
updateDesignRoutes, | ||
updateInitialize, | ||
} = useDispatch( nfdOnboardingStore ); | ||
|
||
const switchFlow = ( newFlow ) => { | ||
if ( ! validateFlow( brandConfig, newFlow ) ) { | ||
return false; | ||
} | ||
const currentFlow = window.nfdOnboarding.currentFlow; | ||
const getData = resolveGetDataForFlow( newFlow ); | ||
const data = getData(); | ||
updateAllSteps( data.steps ); | ||
updateTopSteps( data?.topSteps ); | ||
updateRoutes( data.routes ); | ||
updateDesignRoutes( data?.designRoutes ); | ||
if ( SITEGEN_FLOW !== currentFlow ) { | ||
window.nfdOnboarding.oldFlow = currentFlow; | ||
} | ||
window.nfdOnboarding.currentFlow = newFlow; | ||
updateInitialize( true ); | ||
navigate( data.steps[ 1 ].path ); | ||
}; | ||
const selectFlow = ( flow ) => { | ||
switch ( flow ) { | ||
case 'onboarding': | ||
return switchFlow( oldFlow ); | ||
case 'ai': | ||
return switchFlow( SITEGEN_FLOW ); | ||
case 'migration': | ||
return window.open( migrationUrl, '_blank' ); | ||
} | ||
}; | ||
return ( | ||
<div className=""> | ||
<p className="nfd-onboarding-sitegen-options__questionnaire"> | ||
{ questionnaire } | ||
</p> | ||
<div className="nfd-onboarding-sitegen-options__container"> | ||
{ options.map( ( tab, idx ) => { | ||
return ( | ||
<div | ||
className="nfd-onboarding-sitegen-options__container__options" | ||
key={ idx } | ||
role="button" | ||
tabIndex={ 0 } | ||
onClick={ () => { | ||
selectFlow( tab.flow ); | ||
} } | ||
onKeyDown={ () => { | ||
{ | ||
selectFlow( tab.flow ); | ||
} | ||
} } | ||
> | ||
<h3 className="nfd-onboarding-sitegen-options__container__heading__title"> | ||
{ tab.span && ( | ||
<span className="nfd-onboarding-sitegen-options__container__options__span"> | ||
{ tab.span } | ||
</span> | ||
) } | ||
{ tab.title } | ||
</h3> | ||
<p className="nfd-onboarding-sitegen-options__container__heading__subtitle"> | ||
{ tab.subtitle } | ||
</p> | ||
</div> | ||
); | ||
} ) } | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StartOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.nfd-onboarding-sitegen-options { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
&__questionnaire { | ||
color: var(--nfd-onboarding-white); | ||
font-weight: 500; | ||
text-align: center; | ||
font-size: 18px; | ||
} | ||
|
||
&__container { | ||
display: flex; | ||
justify-content: center; | ||
flex-wrap: wrap; | ||
|
||
&__options { | ||
flex: 1; | ||
min-width: 310px; | ||
height: 130px; | ||
border: 1px solid #9ca2a7; | ||
text-align: center; | ||
padding: 24px; | ||
padding-top: 50px; | ||
margin: 20px; | ||
border-radius: 16px; | ||
color: var(--nfd-onboarding-white); | ||
font-size: 20px; | ||
|
||
&__span { | ||
background-color: var(--nfd-onboarding-white); | ||
color: rgb(6, 0, 0); | ||
padding-right: 6px; | ||
padding-left: 5px; | ||
margin-right: 5px; | ||
border: 1px solid #fff; | ||
border-radius: 8px; | ||
} | ||
} | ||
|
||
&__options:hover { | ||
background-color: rgba(6, 0, 0, 0.3); | ||
cursor: pointer; | ||
outline: 2px solid #9ca2a7; | ||
transition: 0.1s linear; | ||
} | ||
|
||
&__heading { | ||
color: var(--nfd-onboarding-primary); | ||
width: 96%; | ||
margin: 50px 0 50px; | ||
line-height: 1; | ||
|
||
&__title { | ||
font-weight: 510; | ||
text-align: center; | ||
color: var(--nfd-onboarding-white); | ||
font-size: 20px; | ||
line-height: 20px; | ||
} | ||
|
||
&__subtitle { | ||
color: #e8e8e8 !important; | ||
font-weight: 510; | ||
text-align: center; | ||
font-size: 14px; | ||
line-height: 16.71px; | ||
} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
const getContents = () => { | ||
return { | ||
heading: __( 'Welcome to WordPress', 'wp-module-onboarding' ), | ||
subheading: __( 'powered by ', 'wp-module-onboarding' ), | ||
questionnaire: __( | ||
'Where would you like to start?', | ||
'wp-module-onboarding' | ||
), | ||
options: [ | ||
{ | ||
title: __( 'Build it myself', 'wp-module-onboarding' ), | ||
subtitle: __( | ||
"We'll stay out of your way.", | ||
'wp-module-onboarding' | ||
), | ||
flow: 'onboarding', | ||
}, | ||
{ | ||
title: __( ' Website Creator', 'wp-module-onboarding' ), | ||
subtitle: __( | ||
'Custom Al generated content & design.', | ||
'wp-module-onboarding' | ||
), | ||
span: __( 'AI', 'wp-module-onboarding' ), | ||
flow: 'ai', | ||
}, | ||
{ | ||
title: __( 'Hire a Pro', 'wp-module-onboarding' ), | ||
subtitle: __( | ||
'Leave it to our WordPress experts.', | ||
'wp-module-onboarding' | ||
), | ||
flow: 'migration', | ||
}, | ||
], | ||
|
||
importtext: __( | ||
'Already have a WordPress site you want to import?', | ||
'wp-module-onboarding' | ||
), | ||
importlink: __( 'http://www.google.com', 'wp-module-onboarding' ), | ||
}; | ||
}; | ||
|
||
export default getContents; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the same way of mentioning in
_icons
and not directly reference a static file?