Skip to content

Commit

Permalink
local view on no-site
Browse files Browse the repository at this point in the history
  • Loading branch information
manikantakailasa committed Nov 29, 2023
1 parent 5eef2d6 commit f933ddc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 38 deletions.
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' => 'b0da7018c69582662c24');
<?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' => '590c7bd6d4eda520d356');
78 changes: 41 additions & 37 deletions src/components/OnboardingScreen.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import { Alert, Button, Title } from '@newfold/ui-component-library';
import { useEffect, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import classNames from 'classnames';
import { ReactComponent as ComingSoonIllustration } from '../icons/coming-soon.svg';
import { ReactComponent as WelcomeIllustration } from '../icons/store-live.svg';
import { NewfoldRuntime } from '../sdk/NewfoldRuntime';
import { OnboardingList } from './OnboardingList';
import { Section } from './Section';
import { SiteStatus } from './SiteStatus';
import useThumbnail from './useThumbnail';
import { Alert, Button, Title } from "@newfold/ui-component-library";
import { useEffect, useState } from "@wordpress/element";
import { __ } from "@wordpress/i18n";
import classNames from "classnames";
import { ReactComponent as ComingSoonIllustration } from "../icons/coming-soon.svg";
import { ReactComponent as WelcomeIllustration } from "../icons/store-live.svg";
import { NewfoldRuntime } from "../sdk/NewfoldRuntime";
import { OnboardingList } from "./OnboardingList";
import { Section } from "./Section";
import { SiteStatus } from "./SiteStatus";
import useThumbnail from "./useThumbnail";

const Text = {
Pending: {
title: NewfoldRuntime.hasCapability('isEcommerce')
? __('Congrats on your new store!', 'wp-module-ecommerce')
: __('Congrats on your new site!', 'wp-module-ecommerce'),
title: NewfoldRuntime.hasCapability("isEcommerce")
? __("Congrats on your new store!", "wp-module-ecommerce")
: __("Congrats on your new site!", "wp-module-ecommerce"),
description: __(
'Your site is currently displaying a "Coming Soon" page.',
'wp-module-ecommerce'
"wp-module-ecommerce"
),
Illustration: ComingSoonIllustration,
},
Live: {
title: __('Ready to go to the next level?', 'wp-module-ecommerce'),
description: __('Your site is live to the world!', 'wp-module-ecommerce'),
title: __("Ready to go to the next level?", "wp-module-ecommerce"),
description: __("Your site is live to the world!", "wp-module-ecommerce"),
Illustration: WelcomeIllustration,
},
};
Expand Down Expand Up @@ -59,14 +59,14 @@ export function OnboardingScreen({
className="nfd-welcome-section"
showShadowBox={showShadowBox}
>
<Section.Header title={__('Home', 'wp-module-ecommerce')} />
<Section.Header title={__("Home", "wp-module-ecommerce")} />
<Section.Content className="nfd-app-section-home">
<div className="nfd-flex nfd-flex-col nfd-gap-6">
<div
className={classNames(
'nfd-grid nfd-gap-6 nfd-min-h-[350px]',
'sm:nfd-grid-cols-1',
'xl:nfd-grid-cols-2'
"nfd-grid nfd-gap-6 nfd-min-h-[350px]",
"sm:nfd-grid-cols-1",
"xl:nfd-grid-cols-2"
)}
>
<div className="nfd-flex nfd-flex-col nfd-justify-start nfd-items-start nfd-gap-4">
Expand All @@ -89,61 +89,65 @@ export function OnboardingScreen({
onMouseOver={handleMouseOver}
onMouseOut={handleMouseLeave}
className={classNames(
'nfd-relative nfd-flex-col nfd-justify-center nfd-items-center',
'nfd-border-[#CBD5E1] nfd-border-[1px] nfd-border-solid nfd-rounded-md'
"nfd-relative nfd-flex-col nfd-justify-center nfd-items-center",
"nfd-border-[#CBD5E1] nfd-border-[1px] nfd-border-solid nfd-rounded-md"
)}
>
<div className="nfd-flex nfd-justify-center nfd-items-center nfd-bg-gray-200 nfd-border-b nfd-border-[#dbd1d1] nfd-relative nfd-z-10">
<p className="nfd-font-bold">
{__('SITE PREVIEW', 'wp-module-ecommerce')}
{__("SITE PREVIEW", "wp-module-ecommerce")}
</p>
</div>
{comingSoon ? (
<div className="nfd-flex-col">
<Illustration
className={classNames('nfd-h-full', 'nfd-w-full')}
className={classNames("nfd-h-full", "nfd-w-full")}
/>
</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]'
"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]"
)}
>
{thumbnail && (
{thumbnail ? (
<img
className="nfd-w-full nfd-h-full"
src={thumbnail}
alt="image not available"
/>
) : (
<Illustration
className={classNames("nfd-h-full", "nfd-w-full")}
/>
)}
</div>
</div>
)}
<div
className={classNames(
'nfd-absolute nfd-top-0 nfd-left-0 nfd-bottom-0 nfd-right-0 nfd-place-content-center nfd-grid',
'hover:nfd-animate-[wiggle_1s_ease-in-out_infinite]'
"nfd-absolute nfd-top-0 nfd-left-0 nfd-bottom-0 nfd-right-0 nfd-place-content-center nfd-grid",
"hover:nfd-animate-[wiggle_1s_ease-in-out_infinite]"
)}
>
<Button
style={{
display: hovered ? 'block' : 'none',
display: hovered ? "block" : "none",
}}
as="a"
className="nfd-bg-canvas "
href={NewfoldRuntime.siteDetails.url}
target="_blank"
variant="secondary"
>
{__('View your site', 'wp-module-ecommerce')}
{__("View your site", "wp-module-ecommerce")}
</Button>
</div>
</div>
Expand Down

0 comments on commit f933ddc

Please sign in to comment.