Skip to content

Commit

Permalink
Merge branch 'trunk' into PRESS4-502
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyakrishnai authored Mar 12, 2024
2 parents f6ca7be + c07cfb7 commit f59bf44
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: bluehost/bluehost-wordpress-plugin
ref: 'develop'
ref: 'main'

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion build/index.asset.php
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' => '9c6e5dcd37ddbb90fb06');
<?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' => '9c6e5dcd37ddbb90fb06');
88 changes: 44 additions & 44 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 41 additions & 44 deletions src/components/OnboardingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function OnboardingScreen({
: Text.Live;

const [hovered, setIsHovered] = useState(false);
const [editUrl, setEditUrl] = useState('');
const [editUrl, setEditUrl] = useState("");

const handleMouseOver = () => {
setIsHovered(true);
Expand All @@ -56,14 +56,19 @@ export function OnboardingScreen({
};

useEffect(() => {
WordPressSdk.settings.get().then(res => {
if(res?.page_on_front && res?.show_on_front === 'page'){
setEditUrl(RuntimeSdk.adminUrl(`post.php?post=${res?.page_on_front}&action=edit`, false))
}else{
setEditUrl(RuntimeSdk.adminUrl('site-editor.php?canvas=edit'));
WordPressSdk.settings.get().then((res) => {
if (res?.page_on_front && res?.show_on_front === "page") {
setEditUrl(
RuntimeSdk.adminUrl(
`post.php?post=${res?.page_on_front}&action=edit`,
false
)
);
} else {
setEditUrl(RuntimeSdk.adminUrl("site-editor.php?canvas=edit"));
}
})
}, [])
});
}, []);

return (
<Section.Container
Expand Down Expand Up @@ -109,43 +114,35 @@ export function OnboardingScreen({
{__("SITE PREVIEW", "wp-module-ecommerce")}
</p>
</div>
{comingSoon ? (
<div className="nfd-flex-col">
<Illustration
className={classNames(
"nfd-h-full",
"nfd-w-full",
"nfd-rounded-b-md"
)}
/>
</div>
) : (
<div className="nfd-flex-col">
<div
className={classNames(
"nfd-h-[216px] nfd-box-content",
"nfd-box-content nfd-z-[2] nfd-opacity-100",
"nfd-flex nfd-flex-col nfd-justify-center nfd-items-center",
"md:nfd-w-[520px] md:min-[783px]:nfd-w-[387px] md:min-[768px]:nfd-w-[670px]",
"lg:min-[1024px]:nfd-w-[486px] lg:nfd-w-[520px] lg:nfd-h-[245px]",
"xl:min-[1280px]:nfd-w-[360px]",
"2xl:nfd-w-[520px]"
)}
>
<iframe
onLoad={iframeOnLoad}
id="iframe-preview"
title="Preview"
className="nfd-w-[400%] nfd-min-h-[400%] nfd-basis-full nfd-scale-[0.25] nfd-overflow-hidden nfd-relative nfd-top-[-9px]"
src={NewfoldRuntime.homeUrl}
scrolling="no"
name="iframe-preview"
sandbox
seamless
></iframe>
</div>
<div className="nfd-flex-col">
<div
className={classNames(
"nfd-h-[216px] nfd-box-content",
"nfd-box-content nfd-z-[2] nfd-opacity-100",
"nfd-flex nfd-flex-col nfd-justify-center nfd-items-center",
"md:nfd-w-[520px] md:min-[783px]:nfd-w-[387px] md:min-[768px]:nfd-w-[670px]",
"lg:min-[1024px]:nfd-w-[486px] lg:nfd-w-[520px] lg:nfd-h-[245px]",
"xl:min-[1280px]:nfd-w-[360px]",
"2xl:nfd-w-[520px]"
)}
>
<iframe
onLoad={iframeOnLoad}
id="iframe-preview"
title="Preview"
className="nfd-w-[400%] nfd-min-h-[400%] nfd-basis-full nfd-scale-[0.25] nfd-overflow-hidden nfd-relative nfd-top-[-9px]"
src={
!comingSoon
? NewfoldRuntime.homeUrl
: NewfoldRuntime.homeUrl + "/?preview=coming_soon"
}
scrolling="no"
name="iframe-preview"
sandbox
seamless
></iframe>
</div>
)}
</div>
<div
className={classNames(
"nfd-absolute nfd-top-0 nfd-left-0 nfd-bottom-0 nfd-right-0 nfd-flex nfd-items-center nfd-justify-center nfd-gap-4 nfd-flex-col ",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Paypal.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Paypal = ({ notify }) => {
"min-[360px]:nfd-m-0"
)}
>
{__("Connect", "wp-module-ecommerce")}
{__("Install", "wp-module-ecommerce")}
</Button>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Shipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Shipping = ({ notify }) => {
"min-[360px]:nfd-m-0"
)}
>
{__("Connect", "wp-module-ecommerce")}
{!integrationStatus?.integration?.plugin?.status ? __("Install", "wp-module-ecommerce") : __("Connect", "wp-module-ecommerce")}
</Button>
)}
</>
Expand Down
Loading

0 comments on commit f59bf44

Please sign in to comment.