2022-04-11 21:57:07 +00:00
|
|
|
import variables from 'modules/variables';
|
2022-10-30 16:56:26 +00:00
|
|
|
import { useState, memo } from 'react';
|
2022-04-11 21:57:07 +00:00
|
|
|
import Checkbox from '../Checkbox';
|
|
|
|
import Slider from '../Slider';
|
|
|
|
import { TextField } from '@mui/material';
|
2021-08-15 21:28:37 +00:00
|
|
|
|
2022-04-11 21:57:07 +00:00
|
|
|
import EventBus from 'modules/helpers/eventbus';
|
|
|
|
import { values } from 'modules/helpers/settings/modals';
|
2022-08-16 15:38:22 +00:00
|
|
|
import SettingsItem from '../SettingsItem';
|
2021-03-31 20:54:16 +00:00
|
|
|
|
2022-10-30 16:56:26 +00:00
|
|
|
function ExperimentalSettings() {
|
2021-11-14 14:44:16 +00:00
|
|
|
const [eventType, setEventType] = useState();
|
|
|
|
const [eventName, setEventName] = useState();
|
2021-03-31 20:54:16 +00:00
|
|
|
|
2021-02-28 20:30:57 +00:00
|
|
|
return (
|
2021-03-22 22:17:52 +00:00
|
|
|
<>
|
2022-08-16 15:38:22 +00:00
|
|
|
<span className="mainTitle">
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.experimental.title')}
|
2022-08-16 15:38:22 +00:00
|
|
|
</span>
|
|
|
|
<span className="subtitle">
|
2022-08-26 09:45:32 +00:00
|
|
|
{variables.getMessage('modals.main.settings.sections.experimental.warning')}
|
2022-08-16 15:38:22 +00:00
|
|
|
</span>
|
2022-08-26 09:45:32 +00:00
|
|
|
<SettingsItem
|
|
|
|
title={variables.getMessage('modals.main.settings.sections.experimental.developer')}
|
|
|
|
>
|
2022-08-16 15:38:22 +00:00
|
|
|
<Checkbox name="debug" text="Debug hotkey (Ctrl + #)" element=".other" />
|
|
|
|
<Slider
|
|
|
|
title="Debug timeout"
|
|
|
|
name="debugtimeout"
|
|
|
|
min="0"
|
|
|
|
max="5000"
|
|
|
|
default="0"
|
|
|
|
step="100"
|
|
|
|
marks={values('experimental')}
|
|
|
|
element=".other"
|
|
|
|
/>
|
|
|
|
<p>Send Event</p>
|
|
|
|
<TextField
|
|
|
|
label={'Type'}
|
|
|
|
value={eventType}
|
|
|
|
onChange={(e) => setEventType(e.target.value)}
|
|
|
|
spellCheck={false}
|
|
|
|
varient="outlined"
|
|
|
|
InputLabelProps={{ shrink: true }}
|
|
|
|
/>
|
|
|
|
<TextField
|
|
|
|
label={'Name'}
|
|
|
|
value={eventName}
|
|
|
|
onChange={(e) => setEventName(e.target.value)}
|
|
|
|
spellCheck={false}
|
|
|
|
varient="outlined"
|
|
|
|
InputLabelProps={{ shrink: true }}
|
|
|
|
/>
|
|
|
|
</SettingsItem>
|
2022-08-21 11:41:05 +00:00
|
|
|
<SettingsItem
|
2022-08-26 09:45:32 +00:00
|
|
|
title={variables.getMessage('modals.main.settings.sections.experimental.developer')}
|
2022-08-21 11:41:05 +00:00
|
|
|
final={true}
|
|
|
|
>
|
|
|
|
<button className="uploadbg" onClick={() => EventBus.dispatch(eventType, eventName)}>
|
|
|
|
Send
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
className="reset"
|
|
|
|
style={{ marginLeft: '0px' }}
|
|
|
|
onClick={() => localStorage.clear()}
|
|
|
|
>
|
|
|
|
Clear LocalStorage
|
|
|
|
</button>
|
2022-08-16 15:38:22 +00:00
|
|
|
</SettingsItem>
|
2021-03-22 22:17:52 +00:00
|
|
|
</>
|
2021-02-28 20:30:57 +00:00
|
|
|
);
|
2021-03-17 13:01:53 +00:00
|
|
|
}
|
2022-10-30 16:56:26 +00:00
|
|
|
|
2022-11-06 11:59:59 +00:00
|
|
|
export default memo(ExperimentalSettings);
|