@@ -14,21 +14,16 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
- // import React, { ChangeEvent } from "react";
18
17
import React from "react" ;
19
18
20
19
import EventTilePreview from "../elements/EventTilePreview" ;
21
- // import Field from "../elements/Field";
22
- // import SettingsFlag from "../elements/SettingsFlag";
23
20
import SettingsStore from "../../../settings/SettingsStore" ;
24
21
import Slider from "../elements/Slider" ;
25
22
import { FontWatcher } from "../../../settings/watchers/FontWatcher" ;
26
- // import { IValidationResult, IFieldState } from "../elements/Validation";
27
23
import { Layout } from "../../../settings/enums/Layout" ;
28
24
import { MatrixClientPeg } from "../../../MatrixClientPeg" ;
29
25
import { SettingLevel } from "../../../settings/SettingLevel" ;
30
26
import { _t } from "../../../languageHandler" ;
31
- // import { clamp } from "../../../utils/numbers";
32
27
import SettingsSubsection from "./shared/SettingsSubsection" ;
33
28
34
29
interface IProps { }
@@ -96,27 +91,6 @@ export default class FontScalingPanel extends React.Component<IProps, IState> {
96
91
await SettingsStore . setValue ( "baseFontSizeV3" , null , SettingLevel . DEVICE , delta ) ;
97
92
} ;
98
93
99
- // private onValidateFontSize = async ({ value }: Pick<IFieldState, "value">): Promise<IValidationResult> => {
100
- // const parsedSize = parseFloat(value!);
101
- // const min = FontWatcher.MIN_SIZE;
102
- // const max = FontWatcher.MAX_SIZE;
103
- //
104
- // if (isNaN(parsedSize)) {
105
- // return { valid: false, feedback: _t("settings|appearance|font_size_nan") };
106
- // }
107
- //
108
- // if (!(min <= parsedSize && parsedSize <= max)) {
109
- // return {
110
- // valid: false,
111
- // feedback: _t("settings|appearance|font_size_limit", { min, max }),
112
- // };
113
- // }
114
- //
115
- // SettingsStore.setValue("baseFontSizeV2", null, SettingLevel.DEVICE, parseInt(value!, 10));
116
- //
117
- // return { valid: true, feedback: _t("settings|appearance|font_size_valid", { min, max }) };
118
- // };
119
-
120
94
public render ( ) : React . ReactNode {
121
95
return (
122
96
< SettingsSubsection
@@ -146,35 +120,6 @@ export default class FontScalingPanel extends React.Component<IProps, IState> {
146
120
/>
147
121
< div className = "mx_FontScalingPanel_fontSlider_largeText" > Aa</ div >
148
122
</ div >
149
-
150
- { /*<SettingsFlag*/ }
151
- { /* name="useCustomFontSize"*/ }
152
- { /* level={SettingLevel.ACCOUNT}*/ }
153
- { /* onChange={(checked) => {*/ }
154
- { /* this.setState({ useCustomFontSize: checked });*/ }
155
- { /* if (!checked) {*/ }
156
- { /* const size = parseInt(this.state.fontSize, 10);*/ }
157
- { /* const clamped = clamp(size, FontWatcher.MIN_SIZE, FontWatcher.MAX_SIZE);*/ }
158
- { /* if (clamped !== size) {*/ }
159
- { /* this.onFontSizeChanged(clamped);*/ }
160
- { /* }*/ }
161
- { /* }*/ }
162
- { /* }}*/ }
163
- { /* useCheckbox={true}*/ }
164
- { /*/>*/ }
165
-
166
- { /*<Field*/ }
167
- { /* type="number"*/ }
168
- { /* label={_t("settings|appearance|font_size")}*/ }
169
- { /* autoComplete="off"*/ }
170
- { /* placeholder={this.state.fontSize.toString()}*/ }
171
- { /* value={this.state.fontSize.toString()}*/ }
172
- { /* id="font_size_field"*/ }
173
- { /* onValidate={this.onValidateFontSize}*/ }
174
- { /* onChange={(value: ChangeEvent<HTMLInputElement>) => this.setState({ fontSize: value.target.value })}*/ }
175
- { /* disabled={!this.state.useCustomFontSize}*/ }
176
- { /* className="mx_AppearanceUserSettingsTab_checkboxControlledField"*/ }
177
- { /*/>*/ }
178
123
</ SettingsSubsection >
179
124
) ;
180
125
}
0 commit comments