From 06a303fc33da0a9691fa47168faa1418f199f661 Mon Sep 17 00:00:00 2001 From: Gan Eng Chin Date: Fri, 23 Dec 2022 21:21:52 +0800 Subject: [PATCH] Types for useRegisteredChannels. --- .../Channels/useRegisteredChannels.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts index d02667433e9..d512f1d4d32 100644 --- a/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts +++ b/plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useRegisteredChannels.ts @@ -1,3 +1,13 @@ +/** + * Internal dependencies + */ +import { InstalledChannel } from '~/marketing/types'; + +type UseRegisteredChannels = { + loading: boolean; + data: Array< InstalledChannel >; +}; + // // TODO: To be removed. This is for testing loading state. // export const useRegisteredChannels = () => { // // TODO: call API here to get data. @@ -17,7 +27,6 @@ // data: [ // { // slug: 'google-listings-and-ads', -// name: 'Google Listings and Ads', // title: 'Google Listings and Ads', // description: // 'Get in front of shoppers and drive traffic so you can grow your business with Smart Shopping Campaigns and free listings.', @@ -42,7 +51,6 @@ // data: [ // { // slug: 'google-listings-and-ads', -// name: 'Google Listings and Ads', // title: 'Google Listings and Ads', // description: // 'Get in front of shoppers and drive traffic so you can grow your business with Smart Shopping Campaigns and free listings.', @@ -59,7 +67,7 @@ // }; // TODO: To be removed. This is for testing everything works okay. -export const useRegisteredChannels = () => { +export const useRegisteredChannels = (): UseRegisteredChannels => { // TODO: call API here to get data. // The following are just dummy data for testing now. return { @@ -67,7 +75,6 @@ export const useRegisteredChannels = () => { data: [ { slug: 'google-listings-and-ads', - name: 'Google Listings and Ads', title: 'Google Listings and Ads', description: 'Get in front of shoppers and drive traffic so you can grow your business with Smart Shopping Campaigns and free listings.',