-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [#508] Adds additional admin styles - [#508] Adds typography and link components - [#508] Adds site set up card, headings, and multi-step components - [#510] Adds nonprofit set up cards - [#510] Disables site warnings in nonprofit set up
- Loading branch information
1 parent
7931009
commit 52b117c
Showing
28 changed files
with
774 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type LinkProps = Omit< | ||
React.AnchorHTMLAttributes<HTMLAnchorElement>, | ||
'className' | ||
>; | ||
|
||
export function Link(props: LinkProps) { | ||
return <a {...props} className="text-admin-content" />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
type TypographyProps = { | ||
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div'; | ||
children: React.ReactNode; | ||
}; | ||
|
||
export const H1 = ({ as = 'h1', children }: TypographyProps) => { | ||
const Component = as; | ||
|
||
return ( | ||
<Component className="!text-admin-extra-large !font-bold m-0 !p-0"> | ||
{children} | ||
</Component> | ||
); | ||
}; | ||
|
||
export const H2 = ({ as = 'h2', children }: TypographyProps) => { | ||
const Component = as; | ||
|
||
return ( | ||
<Component className="!text-admin-large !font-bold m-0"> | ||
{children} | ||
</Component> | ||
); | ||
}; | ||
|
||
export const H3 = ({ as = 'h3', children }: TypographyProps) => { | ||
const Component = as; | ||
|
||
return ( | ||
<Component className="!text-admin-medium !font-bold m-0"> | ||
{children} | ||
</Component> | ||
); | ||
}; | ||
|
||
export const P = ({ as = 'p', children }: TypographyProps) => { | ||
const Component = as; | ||
|
||
return <Component className="text-admin-content m-0">{children}</Component>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Returns the base URL of the admin section. | ||
* Used to create links in both the subdomain and subdirectory setups. | ||
* | ||
* @returns {string} The base URL of the admin section. | ||
*/ | ||
|
||
export function getBaseAdminUrl() { | ||
return window.location.href.replace(/\/wp-admin\/.*/g, ''); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
client-mu-plugins/goodbids/src/views/nonprofit-setup/complete-set-up/activate-extensions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import { getBaseAdminUrl } from '../../../utils/get-base-url'; | ||
import { MultiStepExpansion } from '../components/multi-step-expansion'; | ||
import { MultiStepHeading } from '../components/multi-step-heading'; | ||
import { Link } from '../../../components/link'; | ||
|
||
const JETPACK_URL = '/wp-admin/admin.php?page=jetpack#/dashboard'; | ||
const WOO_SHIPPING_AND_TAX_URL = '#'; | ||
|
||
export function ActivateExtensions() { | ||
const baseUrl = getBaseAdminUrl(); | ||
|
||
return ( | ||
<> | ||
<MultiStepHeading | ||
title={__('Activate Extensions', 'goodbids')} | ||
content={__( | ||
'We commending activating these plugins to get the most out of your GOODBIDS Nonprofit site.', | ||
'goodbids', | ||
)} | ||
/> | ||
|
||
<MultiStepExpansion | ||
items={[ | ||
{ | ||
title: __('Jetpack', 'goodbids'), | ||
content: __( | ||
'Jetpack is a plugin that provides security, performance, and site management tools.', | ||
'goodbids', | ||
), | ||
component: ( | ||
<Link href={`${baseUrl}${JETPACK_URL}`}> | ||
Connect Jetpack | ||
</Link> | ||
), | ||
}, | ||
{ | ||
title: __('Woo Shipping and Tax', 'goodbids'), | ||
content: __( | ||
'Woo Shipping and Tax is a plugin that provides shipping and tax calculation tools.', | ||
'goodbids', | ||
), | ||
component: ( | ||
<Link | ||
href={`${baseUrl}${WOO_SHIPPING_AND_TAX_URL}`} | ||
> | ||
Install Woo Shipping and Tax | ||
</Link> | ||
), | ||
}, | ||
]} | ||
/> | ||
</> | ||
); | ||
} |
28 changes: 28 additions & 0 deletions
28
client-mu-plugins/goodbids/src/views/nonprofit-setup/complete-set-up/advanced.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import { ButtonLink } from '../../../components/button-link'; | ||
import { getBaseAdminUrl } from '../../../utils/get-base-url'; | ||
import { MultiStepHeading } from '../components/multi-step-heading'; | ||
|
||
// TODO: Update this URL | ||
const EXTENSIONS_URL = '#'; | ||
|
||
export function Advanced() { | ||
const baseUrl = getBaseAdminUrl(); | ||
|
||
return ( | ||
<MultiStepHeading | ||
title={__('Advanced', 'goodbids')} | ||
content={__('Do some advanced stuff here.', 'goodbids')} | ||
> | ||
<div className="w-full max-w-60"> | ||
<ButtonLink | ||
target="_blank" | ||
variant="solid" | ||
href={`${baseUrl}${EXTENSIONS_URL}`} | ||
> | ||
{__('Advanced', 'goodbids')} | ||
</ButtonLink> | ||
</div> | ||
</MultiStepHeading> | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
client-mu-plugins/goodbids/src/views/nonprofit-setup/complete-set-up/finalize-details.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import { ButtonLink } from '../../../components/button-link'; | ||
import { getBaseAdminUrl } from '../../../utils/get-base-url'; | ||
import { MultiStepHeading } from '../components/multi-step-heading'; | ||
|
||
const SITE_SETTINGS_URL = '/wp-admin/options-general.php'; | ||
|
||
export function FinalizeDetails() { | ||
const baseUrl = getBaseAdminUrl(); | ||
|
||
return ( | ||
<MultiStepHeading | ||
title={__('Finalize Details', 'goodbids')} | ||
content={__( | ||
'Click the button below to review and update your site name, tagline, and timezone. You can revisit these post-launch on the Settings > General page in the WordPress Admin.', | ||
'goodbids', | ||
)} | ||
> | ||
<div className="w-full max-w-60"> | ||
<ButtonLink | ||
target="_blank" | ||
variant="solid" | ||
href={`${baseUrl}${SITE_SETTINGS_URL}`} | ||
> | ||
{__('Update Site Settings', 'goodbids')} | ||
</ButtonLink> | ||
</div> | ||
</MultiStepHeading> | ||
); | ||
} |
50 changes: 50 additions & 0 deletions
50
client-mu-plugins/goodbids/src/views/nonprofit-setup/complete-set-up/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import { Card } from '../components/card'; | ||
import { FinalizeDetails } from './finalize-details'; | ||
import { SetUpPayments } from './set-up-payments'; | ||
import { MultiStep } from '../components/multi-step'; | ||
import { UpdateShipping } from './update-shipping'; | ||
import { ActivateExtensions } from './activate-extensions'; | ||
import { Advanced } from './advanced'; | ||
import { CardHeading } from '../components/card-heading'; | ||
|
||
export function CompleteSetUp() { | ||
return ( | ||
<Card> | ||
<CardHeading | ||
title={__('Complete Setup', 'goodbids')} | ||
content={__( | ||
"Before you can launch your GOODBIDS site, you'll need to complete the steps below.", | ||
'goodbids', | ||
)} | ||
/> | ||
|
||
<MultiStep | ||
defaultStep="finalize-details" | ||
steps={{ | ||
'finalize-details': { | ||
label: __('1 Finalize Details', 'goodbids'), | ||
component: <FinalizeDetails />, | ||
}, | ||
'set-up-payments': { | ||
label: __('2 Set Up Payments', 'goodbids'), | ||
component: <SetUpPayments />, | ||
}, | ||
'update-shipping': { | ||
label: __('3 Update Shipping', 'goodbids'), | ||
component: <UpdateShipping />, | ||
}, | ||
'activate-extensions': { | ||
label: __('4 Activate Extensions', 'goodbids'), | ||
component: <ActivateExtensions />, | ||
}, | ||
advanced: { | ||
label: __('Advanced', 'goodbids'), | ||
component: <Advanced />, | ||
fade: true, | ||
}, | ||
}} | ||
/> | ||
</Card> | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
client-mu-plugins/goodbids/src/views/nonprofit-setup/complete-set-up/set-up-payments.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import { ButtonLink } from '../../../components/button-link'; | ||
import { getBaseAdminUrl } from '../../../utils/get-base-url'; | ||
import { MultiStepHeading } from '../components/multi-step-heading'; | ||
|
||
const WOOCOMMERCE_PAYMENTS_URL = | ||
'/wp-admin/admin.php?page=wc-settings&tab=checkout'; | ||
|
||
export function SetUpPayments() { | ||
const baseUrl = getBaseAdminUrl(); | ||
|
||
return ( | ||
<MultiStepHeading | ||
title={__('Set Up Payments', 'goodbids')} | ||
content={__( | ||
'Set up payments for your GOODBIDS site. Click the button below to review and update your site settings. You can revisit these post-launch on the WooCommerce > Settings > Payments page in the WordPress Admin.', | ||
'goodbids', | ||
)} | ||
> | ||
<div className="w-full max-w-60"> | ||
<ButtonLink | ||
target="_blank" | ||
variant="solid" | ||
href={`${baseUrl}${WOOCOMMERCE_PAYMENTS_URL}`} | ||
> | ||
{__('Set Up Payments', 'goodbids')} | ||
</ButtonLink> | ||
</div> | ||
</MultiStepHeading> | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
client-mu-plugins/goodbids/src/views/nonprofit-setup/complete-set-up/update-shipping.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import { ButtonLink } from '../../../components/button-link'; | ||
import { getBaseAdminUrl } from '../../../utils/get-base-url'; | ||
import { MultiStepHeading } from '../components/multi-step-heading'; | ||
|
||
const WOOCOMMERCE_SHIPPING_URL = | ||
'/wp-admin/admin.php?page=wc-settings&tab=shipping'; | ||
|
||
export function UpdateShipping() { | ||
const baseUrl = getBaseAdminUrl(); | ||
|
||
return ( | ||
<MultiStepHeading | ||
title={__('Update Shipping', 'goodbids')} | ||
content={__( | ||
'Click the button below to update your shipping settings. You can revisit these post-launch on the WooCommerce > Settings > Shipping page in the WordPress Admin.', | ||
'goodbids', | ||
)} | ||
> | ||
<div className="w-full max-w-60"> | ||
<ButtonLink | ||
target="_blank" | ||
variant="solid" | ||
href={`${baseUrl}${WOOCOMMERCE_SHIPPING_URL}`} | ||
> | ||
{__('Update Shipping Settings', 'goodbids')} | ||
</ButtonLink> | ||
</div> | ||
</MultiStepHeading> | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
client-mu-plugins/goodbids/src/views/nonprofit-setup/components/card-heading.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import clsx from 'clsx'; | ||
import { H1, P } from '../../../components/typography'; | ||
|
||
type CardHeadingProps = { | ||
title: string; | ||
content: string; | ||
children?: React.ReactNode; | ||
}; | ||
|
||
export function CardHeading({ title, content, children }: CardHeadingProps) { | ||
const containerClasses = clsx('flex items-center justify-between gap-4', { | ||
'p-4': children, | ||
}); | ||
|
||
const headingClasses = clsx('w-full flex flex-col gap-1', { | ||
'max-w-120': children, | ||
'p-4': !children, | ||
}); | ||
|
||
return ( | ||
<div className={containerClasses}> | ||
<div className={headingClasses}> | ||
<H1>{title}</H1> | ||
<P>{content}</P> | ||
</div> | ||
|
||
{children} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.