Skip to content

Commit

Permalink
Updating Jetpack notice text and component
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-karen committed Oct 15, 2024
1 parent 0a4e08a commit 08711e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { __ } from '@wordpress/i18n';
import SimpleNotice from 'components/notice';
import PropTypes from 'prop-types';

const DeprecationNotice = ( { show, dismissNotice, message, link } ) => {
const DeprecationNotice = ( { show, dismissNotice, message, link, linkText, title } ) => {
if ( ! show ) {
return;
}
Expand All @@ -13,15 +13,9 @@ const DeprecationNotice = ( { show, dismissNotice, message, link } ) => {
dismissText={ __( 'Dismiss', 'jetpack' ) }
onDismissClick={ dismissNotice }
>
<div style={ { fontWeight: 600 } }>{ title }</div>
<div>{ message }</div>
{ link && (
<ExternalLink href={ link }>
{ __(
'To find out more about what this means for you, please refer to this document.',
'jetpack'
) }
</ExternalLink>
) }
{ link && <ExternalLink href={ link }>{ linkText }</ExternalLink> }
</SimpleNotice>
);
};
Expand All @@ -32,6 +26,8 @@ DeprecationNotice.propTypes = {
dismissNotice: PropTypes.func.isRequired,
message: PropTypes.string.isRequired,
link: PropTypes.string,
linkText: PropTypes.string,
title: PropTypes.string,
};

export default DeprecationNotice;
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import {
} from 'state/initial-state';
import { getLicensingError, clearLicensingError } from 'state/licensing';
import { getSiteDataErrors } from 'state/site';
import DeprecationNotice from './deprecation-notice';
import DismissableNotices from './dismissable';
import DeprecationNotice from './generic-notice';
import JetpackConnectionErrors from './jetpack-connection-errors';
import PlanConflictWarning from './plan-conflict-warning';
import JetpackStateNotices from './state-notices';
Expand Down Expand Up @@ -224,8 +224,10 @@ class JetpackNotices extends React.Component {
// const notices = [
// {
// noticeKey: 'my-xyz-deprecate-feature',
// message: __( "Jetpack's xyz feature has been removed.", 'jetpack' ),
// title: __( "Retired feature: Jetpack's XYZ Feature", 'jetpack' ),
// message: __( "This feature is being retired and will be removed effective November, 2024. Please use the Classic Theme Helper plugin instead.", 'jetpack' ),
// link: getRedirectUrl( 'my-support' ),
// linkText: __( 'Learn more', 'jetpack' ),
// show: this.props.showXYZNotice && ! this.isNoticeDismissed( 'my-xyz-deprecate-feature' )
// }
// ];
Expand Down Expand Up @@ -289,15 +291,17 @@ class JetpackNotices extends React.Component {
/>
) }

{ notices.map( ( { noticeKey, message, link, show } ) => (
{ notices.map( ( { noticeKey, message, link, show, title, linkText } ) => (
<DeprecationNotice
key={ noticeKey }
show={ show && ! this.isNoticeDismissed( noticeKey ) }
noticeKey={ noticeKey }
// eslint-disable-next-line react/jsx-no-bind
dismissNotice={ () => this.dismissNotice( noticeKey ) }
title={ title }
message={ message }
link={ link }
linkText={ linkText }
/>
) ) }
</div>
Expand Down

0 comments on commit 08711e6

Please sign in to comment.