♻️ Sample implementation of seller-type in JS

This commit is contained in:
Philipp Stracker 2025-02-10 18:54:31 +01:00
parent b387fff9ef
commit 988d221a98
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,5 @@
import { __ } from '@wordpress/i18n';
import classNames from 'classnames';
import SettingsCard from '../../../../ReusableComponents/SettingsCard';
import { CommonHooks } from '../../../../../data';
@ -8,11 +9,15 @@ import SettingsBlock from '../../../../ReusableComponents/SettingsBlock';
import { ControlStaticValue } from '../../../../ReusableComponents/Controls';
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 (
<SettingsCard
className="ppcp-connection-details ppcp--value-list"
className={ className }
title={ __( 'Connection status', 'woocommerce-paypal-payments' ) }
description={ <ConnectionDescription /> }
>

View file

@ -5,6 +5,7 @@ import { getSettingsTabs } from './Tabs';
const SettingsScreen = ( { activePanel, setActivePanel } ) => {
const tabs = getSettingsTabs();
const { Component } = tabs.find( ( tab ) => tab.name === activePanel );
return (
<>
<SettingsNavigation