Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function SelfHostedInstructions( { onClickClose } ) {
const translate = useTranslate();
return (
<div>
<button>
</button>
<h2>{ translate( 'Add self-hosted site' ) }</h2>
<p>
{ translate(
'By default when you sign into the WordPress.com app, you can edit blogs and sites hosted at WordPress.com'
) }
</p>
<p>
{ translate(
"If you'd like to edit your self-hosted WordPress blog or site, you can do that by following these instructions:"</p></div>
const GMClosureNotice = ( {
priorityChatClosesAt,
priorityChatReopensAt,
compact,
basicChatClosesAt,
basicChatReopensAt,
displayAt,
purchases,
} ) => {
const translate = useTranslate();
const moment = useLocalizedMoment();
const hasBusinessOrEcommercePlan = some(
purchases,
( { productSlug } ) => isBusinessPlan( productSlug ) || isEcommercePlan( productSlug )
);
const hasPersonalOrPremiumPlan = some(
purchases,
( { productSlug } ) => isPersonalPlan( productSlug ) || isPremiumPlan( productSlug )
);
const hasNoPlan = ! hasBusinessOrEcommercePlan && ! hasPersonalOrPremiumPlan;
const currentDate = moment();
const guessedTimezone = moment.tz.guess();
const [ closesAt, reopensAt ] = [
const MarketingToolsHeader: FunctionComponent< Props > = ( { handleButtonClick } ) => {
const translate = useTranslate();
return (
<div>
<img alt="{" src="/calypso/images/illustrations/illustration-404.svg">
</div>
<div>
<h1>
{ translate( 'Drive more traffic to your site with better SEO' ) }
</h1>
</div>
export default function JetpackConnectHelpButton( { label } ) {
const dispatch = useDispatch();
const translate = useTranslate();
const recordClick = React.useCallback( () => {
dispatch( recordTracksEvent( 'calypso_jpc_help_link_click' ) );
}, [ dispatch ] );
return (
{ ' ' }
{ label || translate( 'Get help setting up Jetpack' ) }
const ProgressIndicator = ( { stepNumber, totalSteps } ) => {
const translate = useTranslate();
return (
<div data-e2e-type="{">
{ translate( 'Step %(stepNumber)d of %(stepTotal)d', {
args: {
stepNumber: stepNumber + 1,
stepTotal: totalSteps,
},
} ) }
</div>
);
};
export const MarketingToolsGoogleAdwordsFeature: FunctionComponent< ConnectedProps > = ( {
isAtomic,
isJetpack,
isPremiumOrHigher,
recordTracksEvent,
showCard,
siteId,
siteSlug,
} ) => {
const translate = useTranslate();
if ( ! showCard || ( isJetpack && ! isAtomic ) || ! siteId || ! siteSlug ) {
return null;
}
const handleUpgradeClick = () => {
recordTracksEvent( 'calypso_marketing_tools_adwords_plan_upgrade_button_click' );
page( addQueryArgs( { plan: PLAN_PREMIUM }, `/plans/${ siteSlug }` ) );
};
const renderButton = () => {
if ( isPremiumOrHigher ) {
return ;
}
return (
<button>
{ translate( 'Upgrade to Premium' ) }</button>
function WPLineItem( { item, className, hasDeleteButtons, removeItem } ) {
const translate = useTranslate();
const hasDomainsInCart = useHasDomainsInCart();
const itemSpanId = `checkout-line-item-${ item.id }`;
const deleteButtonId = `checkout-delete-button-${ item.id }`;
const [ isModalVisible, setIsModalVisible ] = useState( false );
const modalCopy = returnModalCopy( item.type, translate, hasDomainsInCart );
return (
<div>
{ item.label }
<span aria-labelledby="{">
{ renderDisplayValueMarkdown( item.amount.displayValue ) }
</span>
{ hasDeleteButtons && item.type !== 'tax' && (
</div>
function PendingGSuiteTosNoticeDialog( props ) {
const [ password, setPassword ] = useState( false );
const [ isCopied, setIsCopied ] = useState( false );
const [ openTracked, setOpenTracked ] = useState( false );
const translate = useTranslate();
const trackEvent = ( message, tracksEvent ) => {
props.trackEvent( {
domainName: props.domainName,
message,
section: props.section,
siteSlug: props.siteSlug,
tracksEvent,
user: props.user,
} );
};
if ( props.visible && ! openTracked ) {
trackEvent(
`Opened G Suite "ToS Dialog" via ${ props.section }`,
'calypso_domain_management_gsuite_pending_account_open_dialog'
const GSuiteUpsellCard = ( {
currencyCode,
domain,
gSuiteCost,
gSuiteProductSlug,
onAddEmailClick,
onSkipClick,
recordTracksEvent,
} ) => {
const [ users, setUsers ] = useState( newUsers( domain ) );
const canContinue = areAllUsersValid( users );
const translate = useTranslate();
const recordClickEvent = eventName => {
recordTracksEvent( eventName, {
domain_name: domain,
user_count: users.length,
} );
};
const recordUsersChangedEvent = ( previousUsers, nextUsers ) => {
if ( previousUsers.length !== nextUsers.length ) {
recordTracksEvent( 'calypso_checkout_gsuite_upgrade_users_changed', {
domain_name: domain,
next_user_count: nextUsers.length,
prev_user_count: previousUsers.length,
} );
}
function GSuiteUserItem( props ) {
const translate = useTranslate();
const [ dialogVisible, setDialogVisible ] = useState( false );
const onFixClickHandler = e => {
e.preventDefault();
setDialogVisible( true );
};
const onCloseClickHandler = () => {
setDialogVisible( false );
};
const getLoginLink = () => {
const { email, domain } = props.user;
return `https://accounts.google.com/AccountChooser?Email=${ email }&service=CPanel&continue=https://admin.google.com/a/${ domain }`;
};
const renderManage = () => {
return (