2024-02-18 23:05:15 +00:00
|
|
|
import variables from 'config/variables';
|
2023-03-21 19:59:16 +00:00
|
|
|
import { useState, memo } from 'react';
|
2023-03-16 11:11:18 +00:00
|
|
|
import { MdClose, MdOutlineAddLink } from 'react-icons/md';
|
2024-03-19 23:35:17 +00:00
|
|
|
import { Tooltip, Button } from 'components/Elements';
|
2024-03-02 22:46:28 +00:00
|
|
|
|
2023-03-15 18:34:02 +00:00
|
|
|
function CustomURLModal({ modalClose, urlError, modalCloseOnly }) {
|
2021-11-10 16:20:40 +00:00
|
|
|
const [url, setURL] = useState();
|
2021-11-01 13:24:09 +00:00
|
|
|
|
|
|
|
return (
|
2022-04-24 20:12:49 +00:00
|
|
|
<div className="smallModal">
|
|
|
|
<div className="shareHeader">
|
|
|
|
<span className="title">
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.background.source.add_url')}
|
2022-04-24 20:12:49 +00:00
|
|
|
</span>
|
2022-06-03 20:52:37 +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:52:37 +00:00
|
|
|
>
|
2022-04-24 20:12:49 +00:00
|
|
|
<div className="close" onClick={modalCloseOnly}>
|
|
|
|
<MdClose />
|
|
|
|
</div>
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
2023-03-16 11:11:18 +00:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
value={url}
|
|
|
|
onChange={(e) => setURL(e.target.value.replace(/(\r\n|\n|\r)/gm, ''))}
|
|
|
|
varient="outlined"
|
|
|
|
/>
|
|
|
|
<span className="dropdown-error">{urlError}</span>
|
|
|
|
<div className="resetFooter">
|
2024-03-19 23:35:17 +00:00
|
|
|
<Button
|
|
|
|
type="secondary"
|
|
|
|
onClick={modalCloseOnly}
|
|
|
|
icon={<MdClose />}
|
|
|
|
label={variables.getMessage('modals.main.settings.sections.advanced.reset_modal.cancel')}
|
|
|
|
/>
|
|
|
|
<Button
|
|
|
|
type="settings"
|
|
|
|
onClick={() => modalClose(url)}
|
|
|
|
icon={<MdOutlineAddLink />}
|
|
|
|
label={variables.getMessage('modals.main.settings.sections.background.source.add_url')}
|
|
|
|
/>
|
2023-03-15 18:34:02 +00:00
|
|
|
</div>
|
2023-03-16 11:11:18 +00:00
|
|
|
</div>
|
2021-11-01 13:24:09 +00:00
|
|
|
);
|
|
|
|
}
|
2022-10-30 16:56:26 +00:00
|
|
|
|
2022-11-06 11:59:59 +00:00
|
|
|
export default memo(CustomURLModal);
|