Skip to content

Commit

Permalink
Add preConditionReady check.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvinb committed Oct 7, 2024
1 parent 3965234 commit 8a4ba4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@ import './connect-account-card.scss';
* @param {string} props.helperText The helper text for the account card.
* @param {JSX.Element} props.body The content for the body of the account card.
* @param {JSX.Element} props.footer The content for the footer of the account card.
* @param {boolean} [props.disabled=false] Whether display the Card in disabled style.
*/
const ConnectAccountCard = ( { title, helperText, body, footer } ) => {
const ConnectAccountCard = ( {
title,
helperText,
body,
footer,
disabled = false,
} ) => {
return (
<AccountCard
className="gla-google-combo-connect-account-card"
title={ title }
helper={ helperText }
disabled={ disabled }
>
<Section.Card.Body className="gla-google-combo-connect-account-card__body">
{ body }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import SpinnerCard from '.~/components/spinner-card';
*/

const ConnectMC = () => {
const { googleMCAccount, hasFinishedResolution } = useGoogleMCAccount();
const { googleMCAccount, hasFinishedResolution, isPreconditionReady } =
useGoogleMCAccount();
const [ value, setValue ] = useState();
const [ handleConnectMC, resultConnectMC ] = useConnectMCAccount( value );
const [ handleCreateAccount, resultCreateAccount ] = useCreateMCAccount();
Expand Down Expand Up @@ -117,6 +118,7 @@ const ConnectMC = () => {
handleCreateAccount={ handleCreateAccount }
/>
}
disabled={ ! isPreconditionReady }
/>
);
};
Expand Down

0 comments on commit 8a4ba4c

Please sign in to comment.