Skip to content

Commit

Permalink
Add indicator style.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitrox committed Sep 25, 2024
1 parent 2de300a commit 8239b47
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,15 @@
.gla-account-card__description {
gap: 0;
}

.gla-account-card__indicator {
color: #007CBA;

Check failure on line 14 in js/src/components/google-combo-account-card/connect-google-combo-account-card.scss

View workflow job for this annotation

GitHub Actions / Lint CSS

Expected "#007CBA" to be "#007cba" (color-hex-case)
display: flex;
vertical-align: middle;

.components-spinner {
margin-top: 0;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { Spinner } from '@wordpress/components';

/**
* Internal dependencies
Expand Down Expand Up @@ -97,6 +98,21 @@ const ConnectedGoogleComboAccountCard = ( { googleAccount } ) => {
);
};

const Indicator = () => {
if ( creatingAccounts ) {
return (
<>
<Spinner />
<span>
{ __( 'Creating…', 'google-listings-and-ads' ) }
</span>
</>
);
}

return null;
};

return (
<AccountCard
appearance={ APPEARANCE.GOOGLE }
Expand All @@ -111,7 +127,7 @@ const ConnectedGoogleComboAccountCard = ( { googleAccount } ) => {
p: <p></p>,
}
) }
indicator={ creatingAccounts ? 'Creating...' : null }
indicator={ <Indicator /> }
/>
);
};
Expand Down

0 comments on commit 8239b47

Please sign in to comment.