diff --git a/client/src/components/Filters/CustomRules.js b/client/src/components/Filters/CustomRules.js index 05640734..31eb482e 100644 --- a/client/src/components/Filters/CustomRules.js +++ b/client/src/components/Filters/CustomRules.js @@ -1,13 +1,12 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Trans, withTranslation } from 'react-i18next'; -import classnames from 'classnames'; import Card from '../ui/Card'; import PageTitle from '../ui/PageTitle'; import Examples from './Examples'; import Check from './Check'; import { getTextareaCommentsHighlight, syncScroll } from '../../helpers/highlightTextareaComments'; -import { COMMENT_LINE_DEFAULT_TOKEN, isFirefox } from '../../helpers/constants'; +import { COMMENT_LINE_DEFAULT_TOKEN } from '../../helpers/constants'; import '../ui/texareaCommentsHighlight.css'; class CustomRules extends Component { @@ -52,26 +51,19 @@ class CustomRules extends Component { return ( <> - + - - + + /> {getTextareaCommentsHighlight( this.ref, userRules, - classnames({ 'form-control--textarea-large': isFirefox }), + undefined, [COMMENT_LINE_DEFAULT_TOKEN, '!'], )} diff --git a/client/src/components/Settings/Dns/Upstream/Form.js b/client/src/components/Settings/Dns/Upstream/Form.js index 0e688393..63e73b5d 100644 --- a/client/src/components/Settings/Dns/Upstream/Form.js +++ b/client/src/components/Settings/Dns/Upstream/Form.js @@ -9,7 +9,6 @@ import { renderRadioField, renderTextareaField, CheckboxField } from '../../../. import { DNS_REQUEST_OPTIONS, FORM_NAME, - isFirefox, UPSTREAM_CONFIGURATION_WIKI_LINK, } from '../../../../helpers/constants'; import { testUpstreamWithFormValues } from '../../../../actions'; @@ -90,25 +89,10 @@ renderTextareaWithHighlightField.propTypes = { normalizeOnBlur: PropTypes.func, onScroll: PropTypes.func, placeholder: PropTypes.string.isRequired, - subtitle: PropTypes.string.isRequired, type: PropTypes.string.isRequired, }; const INPUT_FIELDS = [ - { - name: UPSTREAM_DNS_NAME, - type: 'text', - component: renderTextareaWithHighlightField, - className: classnames('form-control form-control--textarea font-monospace text-input', { - 'text-input--larger': isFirefox, - }), - containerClass: classnames('text-edit-container', { - 'mb-4': !isFirefox, - 'mb-6': isFirefox, - }), - placeholder: 'upstream_dns', - normalizeOnBlur: removeEmptyLines, - }, { name: UPSTREAM_MODE_NAME, type: 'radio', @@ -176,6 +160,20 @@ const Form = ({ dns_providers + + + + + {INPUT_FIELDS.map(renderField)} diff --git a/client/src/components/ui/texareaCommentsHighlight.css b/client/src/components/ui/texareaCommentsHighlight.css index 19c84fac..a0f50560 100644 --- a/client/src/components/ui/texareaCommentsHighlight.css +++ b/client/src/components/ui/texareaCommentsHighlight.css @@ -1,6 +1,7 @@ .text-edit-container { position: relative; - height: 10rem; + min-height: 240px; + overflow: hidden; } .text-input, @@ -10,33 +11,20 @@ left: 0; width: 100%; height: 100%; - padding: 1rem; + padding: 16px; background: transparent; white-space: pre-wrap; - line-height: 1.5rem; + line-height: 24px; word-wrap: break-word; font-size: var(--font-size-disable-autozoom); margin: 0; -} - -.form--upstream .text-input, -.form--upstream .text-output { - width: 98%; - left: 1%; + overscroll-behavior: none; } .text-input { + position: relative; opacity: 1; - resize: none; - height: 10rem; -} - -.text-input--larger { - height: 11rem; -} - -.text-input--largest { - height: 16rem; + min-height: 240px; } .text-output {