Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Fix some styling issue and add TS types
Browse files Browse the repository at this point in the history
  • Loading branch information
louwie17 committed Aug 27, 2021
1 parent 7aae799 commit 42e4bec
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

> .name {
.pre-install-wcpay_name {
.wc-payment-gateway-method-name {
display: inline-flex;
img {
height: 24px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { useState, useEffect } from '@wordpress/element';
import {
PLUGINS_STORE_NAME,
PAYMENT_GATEWAYS_STORE_NAME,
WCDataSelector,
PluginsStoreActions,
} from '@woocommerce/data';
import { recordEvent } from '@woocommerce/tracks';
import { useDispatch, useSelect } from '@wordpress/data';
Expand All @@ -31,9 +33,11 @@ export const WCPaymentsRow: React.FC< WCPaymentsRowProps > = ( {
subTitleContent,
} ) => {
const [ installing, setInstalling ] = useState( false );
const { installAndActivatePlugins } = useDispatch( PLUGINS_STORE_NAME );
const { installAndActivatePlugins }: PluginsStoreActions = useDispatch(
PLUGINS_STORE_NAME
);
const { createNotice } = useDispatch( 'core/notices' );
const wcPayInstallationInfo = useSelect( ( select ) => {
const wcPayInstallationInfo = useSelect( ( select: WCDataSelector ) => {
const { getPaymentGateway } = select( PAYMENT_GATEWAYS_STORE_NAME );
const activePlugins: string[] = select(
PLUGINS_STORE_NAME
Expand Down
1 change: 1 addition & 0 deletions packages/data/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export { useSettings } from './settings/use-settings';

export { PLUGINS_STORE_NAME } from './plugins';
export type { Plugin } from './plugins/types';
export { ActionDispatchers as PluginsStoreActions } from './plugins/actions';
export { pluginNames } from './plugins/constants';
export { withPluginsHydration } from './plugins/with-plugins-hydration';

Expand Down
6 changes: 6 additions & 0 deletions packages/data/src/plugins/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,9 @@ export type Actions =
| ReturnType< typeof updateJetpackConnectUrl >
| ReturnType< typeof setPaypalOnboardingStatus >
| ReturnType< typeof setRecommendedPlugins >;

// Types
export type ActionDispatchers = {
installJetpackAndConnect: typeof installJetpackAndConnect;
installAndActivatePlugins: typeof installAndActivatePlugins;
};

0 comments on commit 42e4bec

Please sign in to comment.