2023-03-21 19:59:16 +00:00
|
|
|
import { memo } from 'react';
|
2024-02-18 23:05:15 +00:00
|
|
|
import variables from 'config/variables';
|
2022-04-07 09:25:01 +00:00
|
|
|
import { MdClose, MdRestartAlt } from 'react-icons/md';
|
2024-02-19 09:42:59 +00:00
|
|
|
import { setDefaultSettings } from 'utils/settings';
|
2024-02-18 23:05:15 +00:00
|
|
|
import { Tooltip } from 'components/Elements';
|
2024-03-19 23:35:17 +00:00
|
|
|
|
2022-10-30 16:56:26 +00:00
|
|
|
function ResetModal({ modalClose }) {
|
2021-04-17 20:38:16 +00:00
|
|
|
const reset = () => {
|
2021-09-28 22:04:04 +00:00
|
|
|
variables.stats.postEvent('setting', 'Reset');
|
2021-08-14 19:10:48 +00:00
|
|
|
setDefaultSettings('reset');
|
2021-04-17 20:38:16 +00:00
|
|
|
window.location.reload();
|
2021-07-18 09:43:25 +00:00
|
|
|
};
|
2021-04-17 20:38:16 +00:00
|
|
|
|
2021-03-19 20:18:57 +00:00
|
|
|
return (
|
2022-04-24 20:12:49 +00:00
|
|
|
<div className="smallModal">
|
|
|
|
<div className="shareHeader">
|
2022-05-11 15:09:26 +00:00
|
|
|
<span className="title">
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.advanced.reset_modal.title')}
|
2022-05-11 15:09:26 +00:00
|
|
|
</span>
|
2022-06-03 20:18:47 +00:00
|
|
|
<Tooltip
|
2022-08-26 09:45:32 +00:00
|
|
|
title={variables.getMessage('modals.main.settings.sections.advanced.reset_modal.cancel')}
|
2022-06-03 20:18:47 +00:00
|
|
|
>
|
2022-04-24 20:12:49 +00:00
|
|
|
<div className="close" onClick={modalClose}>
|
|
|
|
<MdClose />
|
|
|
|
</div>
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
2022-04-08 13:48:36 +00:00
|
|
|
<span className="title">
|
2022-08-26 10:44:24 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.advanced.reset_modal.question')}
|
2022-04-08 13:48:36 +00:00
|
|
|
</span>
|
2022-04-24 20:12:49 +00:00
|
|
|
<span className="subtitle">
|
2022-08-26 10:44:24 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.advanced.reset_modal.information')}
|
2022-04-08 13:48:36 +00:00
|
|
|
</span>
|
|
|
|
<div className="resetFooter">
|
2022-05-11 15:09:26 +00:00
|
|
|
<button className="textButton" onClick={modalClose}>
|
2022-04-08 13:48:36 +00:00
|
|
|
<MdClose />
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.advanced.reset_modal.cancel')}
|
2021-07-06 18:38:20 +00:00
|
|
|
</button>
|
2022-04-08 13:48:36 +00:00
|
|
|
<button onClick={() => reset()}>
|
|
|
|
<MdRestartAlt />
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.buttons.reset')}
|
2021-07-06 18:38:20 +00:00
|
|
|
</button>
|
2021-03-19 20:18:57 +00:00
|
|
|
</div>
|
2022-04-08 13:48:36 +00:00
|
|
|
</div>
|
2021-03-19 20:18:57 +00:00
|
|
|
);
|
|
|
|
}
|
2022-10-30 16:56:26 +00:00
|
|
|
|
2024-02-27 17:17:52 +00:00
|
|
|
const MemoizedResetModal = memo(ResetModal);
|
|
|
|
|
|
|
|
export { MemoizedResetModal as default, MemoizedResetModal as ResetModal };
|