@@ -25,6 +25,12 @@ class Preferences extends React.Component {
25
25
if ( Number . isNaN ( value ) ) {
26
26
value = 16 ;
27
27
}
28
+ if ( value > 36 ) {
29
+ value = 36 ;
30
+ }
31
+ if ( value < 8 ) {
32
+ value = 8 ;
33
+ }
28
34
this . props . setFontSize ( value ) ;
29
35
}
30
36
@@ -33,6 +39,12 @@ class Preferences extends React.Component {
33
39
if ( Number . isNaN ( value ) ) {
34
40
value = 2 ;
35
41
}
42
+ if ( value > 6 ) {
43
+ value = 6 ;
44
+ }
45
+ if ( value < 0 ) {
46
+ value = 0 ;
47
+ }
36
48
this . props . setIndentation ( value ) ;
37
49
}
38
50
@@ -106,6 +118,7 @@ class Preferences extends React.Component {
106
118
className = "preference__minus-button"
107
119
onClick = { ( ) => this . props . setFontSize ( this . props . fontSize - 2 ) }
108
120
aria-label = "decrease font size"
121
+ disabled = { this . props . fontSize <= 8 }
109
122
>
110
123
< InlineSVG src = { minusUrl } alt = "Decrease Font Size" />
111
124
< h6 className = "preference__label" > Decrease</ h6 >
@@ -125,6 +138,7 @@ class Preferences extends React.Component {
125
138
className = "preference__plus-button"
126
139
onClick = { ( ) => this . props . setFontSize ( this . props . fontSize + 2 ) }
127
140
aria-label = "increase font size"
141
+ disabled = { this . props . fontSize >= 36 }
128
142
>
129
143
< InlineSVG src = { plusUrl } alt = "Increase Font Size" />
130
144
< h6 className = "preference__label" > Increase</ h6 >
@@ -136,6 +150,7 @@ class Preferences extends React.Component {
136
150
className = "preference__minus-button"
137
151
onClick = { ( ) => this . props . setIndentation ( this . props . indentationAmount - 2 ) }
138
152
aria-label = "decrease indentation amount"
153
+ disabled = { this . props . indentationAmount <= 0 }
139
154
>
140
155
< InlineSVG src = { minusUrl } alt = "DecreaseIndentation Amount" />
141
156
< h6 className = "preference__label" > Decrease</ h6 >
@@ -155,6 +170,7 @@ class Preferences extends React.Component {
155
170
className = "preference__plus-button"
156
171
onClick = { ( ) => this . props . setIndentation ( this . props . indentationAmount + 2 ) }
157
172
aria-label = "increase indentation amount"
173
+ disabled = { this . props . indentationAmount >= 6 }
158
174
>
159
175
< InlineSVG src = { plusUrl } alt = "IncreaseIndentation Amount" />
160
176
< h6 className = "preference__label" > Increase</ h6 >
0 commit comments