Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad committed Mar 11, 2024
1 parent 3c77ddd commit cf19ca6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function LinksForm({ id, value, mutation: useUpdateSiteSettingsAP
const updateSiteSettingsAPI = useUpdateSiteSettingsAPI();
const { t } = useTranslation();

const { methods, fields } = useLinksForm({ defaultValues: { value: value } });
const { methods, fields } = useLinksForm({ defaultValues: { value } });

return (
<Form id={id} methods={methods} onSubmit={updateSiteSettingsAPI.mutate}>
Expand All @@ -50,3 +50,7 @@ LinksForm.propTypes = {
mutation: PropTypes.func.isRequired,
value: PropTypes.string,
};

LinksForm.defaultProps = {
value: '',
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ export default function TextForm({ id, value, mutation: useUpdateSiteSettingsAPI
const { t } = useTranslation();
const maintenanceBannerId = localStorage.getItem('maintenanceBannerId');

const { methods, fields } = useTextForm({ defaultValues: { value: value } });
const { methods, fields } = useTextForm({ defaultValues: { value } });

// Function to clear the form
const clearForm = () => {
methods.reset({ value: '' });
toast.dismiss(maintenanceBannerId);
updateSiteSettingsAPI.mutate('')
methods.reset({ value: '' });
toast.dismiss(maintenanceBannerId);
updateSiteSettingsAPI.mutate('');
};

return (
Expand Down Expand Up @@ -63,3 +63,7 @@ TextForm.propTypes = {
mutation: PropTypes.func.isRequired,
value: PropTypes.string,
};

TextForm.defaultProps = {
value: '',
};

0 comments on commit cf19ca6

Please sign in to comment.