File size: 776 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import { SubscriptionManager } from '@automattic/data-stores';
import { useTranslate } from 'i18n-calypso';
import { useMemo } from 'react';
const useSubheaderText = () => {
const emailAddress = SubscriptionManager.useSubscriberEmailAddress();
const translate = useTranslate();
return useMemo( () => {
if ( emailAddress ) {
return translate(
'Manage WordPress.com sites and newsletters you’ve subscribed to with {{span}}%(emailAddress)s{{/span}}.',
{
args: {
emailAddress: emailAddress,
},
components: {
span: <span className="email-address" />,
},
}
);
}
return translate( 'Manage your WordPress.com site and newsletter subscriptions.' );
}, [ emailAddress, translate ] );
};
export default useSubheaderText;
|