mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Sample implementation of seller-type in JS
This commit is contained in:
parent
b387fff9ef
commit
988d221a98
2 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import SettingsCard from '../../../../ReusableComponents/SettingsCard';
|
import SettingsCard from '../../../../ReusableComponents/SettingsCard';
|
||||||
import { CommonHooks } from '../../../../../data';
|
import { CommonHooks } from '../../../../../data';
|
||||||
|
@ -8,11 +9,15 @@ import SettingsBlock from '../../../../ReusableComponents/SettingsBlock';
|
||||||
import { ControlStaticValue } from '../../../../ReusableComponents/Controls';
|
import { ControlStaticValue } from '../../../../ReusableComponents/Controls';
|
||||||
|
|
||||||
const ConnectionStatus = () => {
|
const ConnectionStatus = () => {
|
||||||
const { merchant } = CommonHooks.useMerchantInfo();
|
const merchant = CommonHooks.useMerchant();
|
||||||
|
const className = classNames( 'ppcp-connection-details ppcp--value-list', {
|
||||||
|
'ppcp--type-business': merchant.isBusinessSeller,
|
||||||
|
'ppcp--type-casual': merchant.isCasualSeller,
|
||||||
|
} );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsCard
|
<SettingsCard
|
||||||
className="ppcp-connection-details ppcp--value-list"
|
className={ className }
|
||||||
title={ __( 'Connection status', 'woocommerce-paypal-payments' ) }
|
title={ __( 'Connection status', 'woocommerce-paypal-payments' ) }
|
||||||
description={ <ConnectionDescription /> }
|
description={ <ConnectionDescription /> }
|
||||||
>
|
>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { getSettingsTabs } from './Tabs';
|
||||||
const SettingsScreen = ( { activePanel, setActivePanel } ) => {
|
const SettingsScreen = ( { activePanel, setActivePanel } ) => {
|
||||||
const tabs = getSettingsTabs();
|
const tabs = getSettingsTabs();
|
||||||
const { Component } = tabs.find( ( tab ) => tab.name === activePanel );
|
const { Component } = tabs.find( ( tab ) => tab.name === activePanel );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SettingsNavigation
|
<SettingsNavigation
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue