-
Notifications
You must be signed in to change notification settings - Fork 4
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
post migration changes #284
Changes from 18 commits
ff2b7a8
1eabecf
ba0e212
992906d
46cc423
46c647a
df576d2
68455e4
a684936
f7a9382
00b1766
f7e7d22
59a266d
0c318e7
60f3b2c
bbea715
20cd20b
a1c2fa2
ee0d8a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '75ee6dfacce73eb32cea'); | ||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '71d3ad3ac78432fb6a1b'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,10 @@ const Text = { | |
description: __("Your site is live to the world!", "wp-module-ecommerce"), | ||
Illustration: WelcomeIllustration, | ||
}, | ||
isMigrated: { | ||
title: __("Welcome home!", "wp-module-ecommerce"), | ||
description: __("Your site has been successfully migrated.", "wp-module-ecommerce"), | ||
} | ||
}; | ||
|
||
export function OnboardingScreen({ | ||
|
@@ -41,6 +45,8 @@ export function OnboardingScreen({ | |
|
||
const [hovered, setIsHovered] = useState(false); | ||
const [editUrl, setEditUrl] = useState(""); | ||
const [isMigrationCompleted, setIsMigrationCompleted] = useState(false); | ||
const [ webServersUpdated, setWebServersUpdated ] = useState(false); | ||
|
||
const handleMouseOver = () => { | ||
setIsHovered(true); | ||
|
@@ -59,6 +65,8 @@ export function OnboardingScreen({ | |
|
||
useEffect(() => { | ||
WordPressSdk.settings.get().then((res) => { | ||
setIsMigrationCompleted( res.showMigrationSteps || false ); | ||
setWebServersUpdated( res.update_site_server_clicked ); | ||
if (res?.page_on_front && res?.show_on_front === "page") { | ||
setEditUrl( | ||
RuntimeSdk.adminUrl( | ||
|
@@ -88,18 +96,18 @@ export function OnboardingScreen({ | |
)} | ||
> | ||
<div className="nfd-flex nfd-flex-col nfd-justify-start nfd-items-start nfd-gap-4"> | ||
<Title size="2">{title}</Title> | ||
<Title size="2">{isMigrationCompleted ? Text.isMigrated.title : title}</Title> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Translations need to be added when displaying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. translations are added in the variable which is being used here |
||
<div> | ||
{comingSoon ? ( | ||
<Alert | ||
variant="warning" | ||
className="nfd-text-sm nfd-bg-transparent nfd-p-0 " | ||
> | ||
<span className="nfd-text-red-700">{description}</span> | ||
<span className="nfd-text-red-700">{isMigrationCompleted ? Text.isMigrated.description : description}</span> | ||
</Alert> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Translations need to be added when only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. translations are added in the variable which is being used here |
||
) : ( | ||
<span className="nfd-text-[--nfd-ecommerce-text-info] nfd-text-sm"> | ||
{description} | ||
{isMigrationCompleted ? Text.isMigrated.description : description} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Translations need to be added There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. translations are added in the variable which is being used here |
||
</span> | ||
)} | ||
</div> | ||
|
@@ -180,7 +188,12 @@ export function OnboardingScreen({ | |
</div> | ||
</div> | ||
</div> | ||
<OnboardingList notify={notify} /> | ||
<OnboardingList notify={notify} | ||
isMigrationCompleted={isMigrationCompleted} | ||
setIsMigrationCompleted={setIsMigrationCompleted} | ||
setWebServersUpdated={setWebServersUpdated} | ||
webServersUpdated={webServersUpdated} | ||
/> | ||
</div> | ||
<SiteStatus | ||
comingSoon={comingSoon} | ||
|
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 you pass
className
as propsThere 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.
I'm passing classname as prop which is being destructed as state from props, these values are coming from onboarding.config.js