Skip to content

Commit

Permalink
tests remove unused component
Browse files Browse the repository at this point in the history
  • Loading branch information
0aveRyan committed Sep 21, 2024
1 parent 7bea44f commit 49f25d4
Showing 1 changed file with 0 additions and 91 deletions.
91 changes: 0 additions & 91 deletions src/app/pages/settings/contentSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,97 +5,6 @@ import AppStore from 'App/data/store';
import { bluehostSettingsApiFetch } from 'App/util/helpers';
import { useNotification } from 'App/components/notifications';

const ContentRevisions = ( { setError, notify } ) => {
const { store, setStore } = useContext( AppStore );
const [ contentRevisions, setNumContentRevisions ] = useState(
store.contentRevisions
);

const contentRevisionsNoticeTitle = () => {
return __( 'Post revision setting saved ', 'wp-plugin-bluehost' );
};

const contentRevisionsNoticeText = () => {
return (
__( 'Posts will save ', 'wp-plugin-bluehost' ) +
contentRevisions +
_n(
' revision.',
' revisions.',
parseInt( contentRevisions ),
'wp-plugin-bluehost'
)
);
};

const contentRevisionsDescriptionText = () => {
return (
__(
'Saving drafts and updating published content creates revisions. Make changes with confidence, knowing you can take ',
'wp-plugin-bluehost'
) +
contentRevisions +
_n(
' step back.',
' steps back.',
parseInt( contentRevisions ),
'wp-plugin-bluehost'
)
);
};

const handleContentRevisionsChange = ( value ) => {
bluehostSettingsApiFetch(
{ contentRevisions: value },
setError,
// eslint-disable-next-line no-unused-vars
( response ) => {
setNumContentRevisions( value );
}
);
};

const notifySuccess = () => {
notify.push( 'content-revision-notice', {
title: contentRevisionsNoticeTitle(),
description: <span>{ contentRevisionsNoticeText() }</span>,
variant: 'success',
autoDismiss: 5000,
} );
};

useUpdateEffect( () => {
setStore( {
...store,
contentRevisions,
} );

notifySuccess();
}, [ contentRevisions ] );

return (
<SelectField
id="content-revisions-select"
label={ __(
'Number of revisions per post to save ',
'wp-plugin-bluehost'
) }
description={ contentRevisionsDescriptionText() }
value={ contentRevisions }
selectedLabel={ contentRevisions }
options={ [
{ label: '1', value: '1' },
{ label: '5', value: '5' },
{ label: '10', value: '10' },
{ label: '20', value: '20' },
{ label: '40', value: '40' },
] }
onChange={ handleContentRevisionsChange }
className="nfd-select-field__spaced"
/>
);
};

const EmptyTrash = ( { setError, notify } ) => {
const { store, setStore } = useContext( AppStore );
const [ emptyTrashDays, setNumEmptyTrashDays ] = useState(
Expand Down

0 comments on commit 49f25d4

Please sign in to comment.