diff --git a/build/index.asset.php b/build/index.asset.php index 21eebebf..efba3b15 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '6307329585bdd0c557f9'); + array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '2594edd0d7eff5838e6c'); diff --git a/src/components/OnboardingScreen.js b/src/components/OnboardingScreen.js index dbb70907..cd4c7119 100644 --- a/src/components/OnboardingScreen.js +++ b/src/components/OnboardingScreen.js @@ -1,5 +1,5 @@ import { Alert, Button, Title } from "@newfold/ui-component-library"; -import { useState } from "@wordpress/element"; +import { useEffect, useState } from "@wordpress/element"; import { __ } from "@wordpress/i18n"; import classNames from "classnames"; import { ReactComponent as ComingSoonIllustration } from "../icons/coming-soon.svg"; @@ -9,6 +9,7 @@ import { RuntimeSdk } from "../sdk/runtime"; import { OnboardingList } from "./OnboardingList"; import { Section } from "./Section"; import { SiteStatus } from "./SiteStatus"; +import { WordPressSdk } from "../sdk/wordpress"; const Text = { Pending: { @@ -39,6 +40,7 @@ export function OnboardingScreen({ : Text.Live; const [hovered, setIsHovered] = useState(false); + const [editUrl, setEditUrl] = useState(''); const handleMouseOver = () => { setIsHovered(true); @@ -52,6 +54,17 @@ export function OnboardingScreen({ "wpadminbar" ).style.display = "none"; }; + + 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')); + } + }) + }, []) + return (