Skip to content

Commit

Permalink
Use Newfold UI Page/Container components
Browse files Browse the repository at this point in the history
  • Loading branch information
wpalani committed Dec 4, 2023
1 parent dbcbf8e commit 5aec6fd
Show file tree
Hide file tree
Showing 18 changed files with 125 additions and 257 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@heroicons/react": "^2.0.18",
"@newfold-labs/wp-module-ecommerce": "^1.3.9",
"@newfold-labs/wp-module-runtime": "^1.0.7",
"@newfold/ui-component-library": "^1.0.0",
"@newfold/ui-component-library": "^1.0.1",
"@reduxjs/toolkit": "^1.9.6",
"@wordpress/compose": "^6.22.0",
"@wordpress/dom-ready": "^3.45.0",
Expand Down
11 changes: 5 additions & 6 deletions src/app/components/webinars-banner/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useState, useEffect } from '@wordpress/element';
import { Button, Title } from '@newfold/ui-component-library';
import { Button, Container, Title } from '@newfold/ui-component-library';
import {
ArrowRightIcon,
CalendarIcon,
ClockIcon,
} from '@heroicons/react/24/outline';
import { ReactComponent as WebinarsVector } from 'App/images/webinars-vector.svg';
import { SectionContainer, SectionContent } from 'App/components/section';

/**
* A component that displays the next monthly webinar.
Expand Down Expand Up @@ -106,8 +105,8 @@ const WebinarsBanner = () => {
}

return (
<SectionContainer className="wppbh-webinars-banner-section nfd-bg-[#E5F6FE]">
<SectionContent>
<Container className="wppbh-webinars-banner-section nfd-bg-[#E5F6FE]">
<Container.Block>
<div className="nfd-flex nfd-flex-col nfd-gap-8 xl:nfd-flex-row xl:nfd-items-center">
<div className="max-[1378px]:nfd-hidden">
<WebinarsVector />
Expand Down Expand Up @@ -173,8 +172,8 @@ const WebinarsBanner = () => {
</Button>
</div>
</div>
</SectionContent>
</SectionContainer>
</Container.Block>
</Container>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/ecommerce/page.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import './styles.scss';
import { useContext } from '@wordpress/element';
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
import { Page } from '@newfold/ui-component-library';
import { NewfoldECommerce } from '@newfold-labs/wp-module-ecommerce';
import '@newfold-labs/wp-module-ecommerce/bluehost.css';
import AppStore from 'App/data/store';
import { bluehostSettingsApiFetch } from 'App/util/helpers';
import { Page } from 'App/components/page';
import { useNotification } from 'App/components/notifications';

const ECommerce = () => {
Expand Down
22 changes: 11 additions & 11 deletions src/app/pages/help/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button, Card, Title } from '@newfold/ui-component-library';
import { Page } from 'App/components/page';
import {
SectionContainer,
SectionContent,
SectionHeader,
} from 'App/components/section';
Button,
Card,
Container,
Page,
Title,
} from '@newfold/ui-component-library';
import help from 'App/data/help';

const HelpCard = ( { item } ) => {
Expand Down Expand Up @@ -46,17 +46,17 @@ const Help = () => {
};
return (
<Page className={ 'wppbh-app-help-page' }>
<SectionContainer className={ 'wppbh-app-help-container' }>
<SectionHeader
<Container className={ 'wppbh-app-help-container' }>
<Container.Header
title={ __( 'Help', 'wp-plugin-bluehost' ) }
subTitle={ __(
description={ __(
'We are available 24/7 to help answer questions and solve your problems.',
'wp-plugin-bluehost'
) }
/>

<SectionContent>{ renderHelpCards() }</SectionContent>
</SectionContainer>
<Container.Block>{ renderHelpCards() }</Container.Block>
</Container>
</Page>
);
};
Expand Down
17 changes: 0 additions & 17 deletions src/app/pages/help/stylesheet.scss

This file was deleted.

12 changes: 5 additions & 7 deletions src/app/pages/home/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import './stylesheet.scss';
import { Page } from 'App/components/page';
import { SectionContainer, SectionContent } from 'App/components/section';
import { Container, Page } from '@newfold/ui-component-library';
import WebinarsBanner from 'App/components/webinars-banner';
import AccountCard from './accountCard';
import HelpCard from './helpCard';
Expand All @@ -11,14 +9,14 @@ const Home = () => {
<Page className="wppbh-home">
<WelcomeSection />
<WebinarsBanner />
<SectionContainer className="wppbh-account-help-section">
<SectionContent>
<Container className="wppbh-account-help-section">
<Container.Block>
<div className="nfd-grid nfd-grid-cols-2 nfd-gap-6">
<AccountCard />
<HelpCard />
</div>
</SectionContent>
</SectionContainer>
</Container.Block>
</Container>
</Page>
);
};
Expand Down
123 changes: 0 additions & 123 deletions src/app/pages/home/stylesheet.scss

This file was deleted.

17 changes: 3 additions & 14 deletions src/app/pages/marketplace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import apiFetch from '@wordpress/api-fetch';
import { useState, useEffect } from '@wordpress/element';
import { useLocation } from 'react-router-dom';
import classnames from 'classnames';
import { Page } from 'App/components/page';
import {
SectionContainer,
SectionHeader,
SectionContent,
} from 'App/components/section';
import { Container, Page } from '@newfold/ui-component-library';
import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime';
// component sourced from marketplace module
import { default as NewfoldMarketplace } from '@modules/wp-module-marketplace/components/marketplace/';
Expand Down Expand Up @@ -44,20 +39,14 @@ const MarketplacePage = () => {
NewfoldRuntime,
};

const moduleComponents = {
SectionHeader,
SectionContent,
};

return (
<Page className={ 'wppbh-app-marketplace-page' }>
<SectionContainer className={ 'wppbh-app-marketplace-container' }>
<Container className={ 'wppbh-app-marketplace-container' }>
<NewfoldMarketplace
methods={ moduleMethods }
constants={ moduleConstants }
Components={ moduleComponents }
/>
</SectionContainer>
</Container>
</Page>
);
};
Expand Down
27 changes: 8 additions & 19 deletions src/app/pages/performance/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import AppStore from '../../data/store';
import { Page } from '../../components/page';
import { useState, useEffect, useContext, Fragment } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';
import classnames from 'classnames';
import { useState, useEffect, useContext, Fragment } from '@wordpress/element';
import { useUpdateEffect } from 'react-use';
import classnames from 'classnames';
import { Container, Page } from '@newfold/ui-component-library';
import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime';
import {
SectionContainer,
SectionHeader,
SectionContent,
SectionSettings,
} from 'App/components/section';
import { useNotification } from 'App/components/notifications';
import AppStore from '../../data/store';
import {
bluehostSettingsApiFetch as newfoldSettingsApiFetch,
bluehostPurgeCacheApiFetch as newfoldPurgeCacheApiFetch,
} from 'App/util/helpers';
import { useNotification } from 'App/components/notifications';

import { default as NewfoldPerformance } from '@modules/wp-module-performance/components/performance/';

Expand All @@ -39,18 +33,13 @@ const PerformancePage = () => {
};

const moduleComponents = {
Page,
SectionHeader,
SectionContent,
SectionSettings,
SectionContainer,
Fragment,
};

return (
<Page title="Performance" className={ 'wppbh-app-settings-page' }>
<SectionContainer className={ 'wppbh-app-settings-container' }>
<SectionHeader
<Container className={ 'wppbh-app-settings-container' }>
<Container.Header
title={ __( 'Performance', 'wp-plugin-bluehost' ) }
subTitle={ __(
'This is where you can manage cache settings for your website.',
Expand All @@ -63,7 +52,7 @@ const PerformancePage = () => {
methods={ moduleMethods }
Components={ moduleComponents }
/>
</SectionContainer>
</Container>
</Page>
);
};
Expand Down
Loading

0 comments on commit 5aec6fd

Please sign in to comment.