+ client: Allow Fastest IP address and Parallel requests to toggle each other: Merge pull request #619 in DNS/adguard-home from feature/1678 to master

Close #1678

Squashed commit of the following:

commit 9251ed0f1b58426104d1b9bdaa4b7af5f92be83e
Author: ArtemBaskal <a.baskal@adguard.com>
Date:   Thu May 21 18:25:18 2020 +0300

    + client: Allow `Fastest IP address` and `Parallel requests` to toggle each other
This commit is contained in:
Artem Baskal
2020-05-25 19:41:04 +03:00
parent 2f5073b720
commit 383507bc0c
6 changed files with 137 additions and 114 deletions

View File

@@ -374,3 +374,8 @@ export const ACTION = {
block: 'block',
unblock: 'unblock',
};
export const DNS_REQUEST_OPTIONS = {
PARALLEL_REQUESTS: 'parallel_requests',
FASTEST_ADDR: 'fastest_addr',
};

View File

@@ -119,11 +119,19 @@ renderGroupField.propTypes = {
};
export const renderRadioField = ({
input, placeholder, disabled, meta: { touched, error },
input,
placeholder,
subtitle,
disabled,
meta: { touched, error },
}) => <Fragment>
<label className="custom-control custom-radio custom-control-inline">
<label className="custom-control custom-radio">
<input {...input} type="radio" className="custom-control-input" disabled={disabled} />
<span className="custom-control-label">{placeholder}</span>
{subtitle && <span
className="checkbox__label-subtitle"
dangerouslySetInnerHTML={{ __html: subtitle }}
/>}
</label>
{!disabled
&& touched
@@ -133,6 +141,7 @@ export const renderRadioField = ({
renderRadioField.propTypes = {
input: PropTypes.object.isRequired,
placeholder: PropTypes.string,
subtitle: PropTypes.string,
disabled: PropTypes.bool,
meta: PropTypes.shape({
touched: PropTypes.bool,
@@ -155,12 +164,10 @@ export const renderSelectField = ({
<span className="checkbox__label">
<span className="checkbox__label-text checkbox__label-text--long">
<span className="checkbox__label-title">{placeholder}</span>
{subtitle && (
<span
className="checkbox__label-subtitle"
dangerouslySetInnerHTML={{ __html: subtitle }}
/>
)}
{subtitle && <span
className="checkbox__label-subtitle"
dangerouslySetInnerHTML={{ __html: subtitle }}
/>}
</span>
</span>
</label>