-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2608 from woocommerce/update/2593-update-app-sele…
…ct-control-single-select 2593: Update AppSelectControl to single select
- Loading branch information
Showing
9 changed files
with
106 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import AppSelectControl from '.~/components/app-select-control'; | ||
import useExistingGoogleAdsAccounts from '.~/hooks/useExistingGoogleAdsAccounts'; | ||
|
||
/** | ||
* @param {Object} props The component props | ||
* @return {JSX.Element} An enhanced AppSelectControl component. | ||
*/ | ||
const AdsAccountSelectControl = ( props ) => { | ||
const { existingAccounts } = useExistingGoogleAdsAccounts(); | ||
|
||
const options = existingAccounts?.map( ( acc ) => ( { | ||
value: acc.id, | ||
label: `${ acc.name } (${ acc.id })`, | ||
} ) ); | ||
|
||
return ( | ||
<AppSelectControl | ||
options={ options } | ||
autoSelectFirstOption | ||
{ ...props } | ||
/> | ||
); | ||
}; | ||
|
||
export default AdsAccountSelectControl; |
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 |
---|---|---|
|
@@ -3,3 +3,7 @@ | |
margin-bottom: 0; | ||
} | ||
} | ||
|
||
.app-select-control--has-single-value { | ||
pointer-events: none; | ||
} |
33 changes: 0 additions & 33 deletions
33
js/src/components/google-ads-account-card/connect-ads/ads-account-select-control.js
This file was deleted.
Oops, something went wrong.
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
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