@@ -119,81 +119,81 @@ export class Panel extends Component {
119119 }
120120
121121 render ( ) {
122- if ( ! this . state . ready ) {
123- return null ;
124- }
125-
126122 return (
127123 < Pane minWidth = { 350 } >
128124 < Header />
129- { this . state . isEnabled && this . state . schedule . isEnabled ? (
130- < Pane display = "flex" paddingX = { 16 } paddingY = { 20 } >
131- < Pane display = "flex" alignItems = "center" flex = { 1 } >
132- < Text className = "cursor-default" > { translate ( 'status' ) } </ Text >
133- </ Pane >
134- < Pane display = "flex" alignItems = "center" justifyContent = "center" >
135- { this . renderScheduleStatus ( ) }
136- </ Pane >
137- </ Pane >
138- ) : (
139- < SwitchField
140- label = { translate ( 'status' ) }
141- labelClassName = "cursor-default"
142- checked = { this . state . isEnabled }
143- onChange = { event => this . toggleStatus ( event . target . checked ) }
144- height = { 20 }
145- paddingX = { 16 }
146- paddingY = { 20 }
147- />
148- ) }
149- < SegmentedControlField
150- name = "mode"
151- label = { translate ( 'mode' ) }
152- labelClassName = "cursor-default"
153- options = { modes }
154- value = { this . state . mode }
155- onChange = { this . changeMode }
156- maxWidth = { 260 }
157- paddingX = { 16 }
158- paddingBottom = { 20 }
159- />
160- < Pane display = "flex" paddingX = { 16 } paddingY = { 10 } alignItems = "center" justifyContent = "space-between" borderTop >
161- < Pane display = "flex" gap = { 10 } >
162- < SettingsButton history = { this . props . history } />
163- { this . state . enableLogs && (
164- < LinkIconButton
165- icon = { HistoryIcon }
166- link = "/logs"
167- tooltip = { translate ( 'logs' ) }
168- history = { this . props . history }
169- />
170- ) }
171- { ! this . state . hideReportIssueButton && (
172- < LinkIconButton
173- icon = { IssueNewIcon }
174- link = "https://github.com/AXeL-dev/distract-me-not/issues"
175- external
176- tooltip = { translate ( 'reportIssue' ) }
177- history = { this . props . history }
125+ { ! this . state . ready ? null : (
126+ < >
127+ { this . state . isEnabled && this . state . schedule . isEnabled ? (
128+ < Pane display = "flex" paddingX = { 16 } paddingY = { 20 } >
129+ < Pane display = "flex" alignItems = "center" flex = { 1 } >
130+ < Text className = "cursor-default" > { translate ( 'status' ) } </ Text >
131+ </ Pane >
132+ < Pane display = "flex" alignItems = "center" justifyContent = "center" >
133+ { this . renderScheduleStatus ( ) }
134+ </ Pane >
135+ </ Pane >
136+ ) : (
137+ < SwitchField
138+ label = { translate ( 'status' ) }
139+ labelClassName = "cursor-default"
140+ checked = { this . state . isEnabled }
141+ onChange = { event => this . toggleStatus ( event . target . checked ) }
142+ height = { 20 }
143+ paddingX = { 16 }
144+ paddingY = { 20 }
178145 />
179146 ) }
180- </ Pane >
181- < Pane >
182- < AnimatedIconButton
183- appearance = "minimal"
184- tooltip = { this . state . mode === Mode . whitelist ? translate ( 'addToWhitelist' ) : translate ( 'addToBlacklist' ) }
185- tooltipPosition = { Position . LEFT }
186- icon = { PlusIcon }
187- iconSize = { 22 }
188- iconColor = "#47b881"
189- onClick = { ( ) => addCurrentWebsite ( this . state . mode , this . state . showAddWebsitePrompt ) }
190- hideOnClick = { true }
191- hideAnimationIcon = { TickIcon }
192- isVisible = { this . state . isAddButtonVisible }
193- onVisibilityChange = { this . setAddButtonVisibility }
147+ < SegmentedControlField
148+ name = "mode"
149+ label = { translate ( 'mode' ) }
150+ labelClassName = "cursor-default"
151+ options = { modes }
152+ value = { this . state . mode }
153+ onChange = { this . changeMode }
154+ maxWidth = { 260 }
155+ paddingX = { 16 }
156+ paddingBottom = { 20 }
194157 />
195- </ Pane >
196- </ Pane >
158+ < Pane display = "flex" paddingX = { 16 } paddingY = { 10 } alignItems = "center" justifyContent = "space-between" borderTop >
159+ < Pane display = "flex" gap = { 10 } >
160+ < SettingsButton history = { this . props . history } />
161+ { this . state . enableLogs && (
162+ < LinkIconButton
163+ icon = { HistoryIcon }
164+ link = "/logs"
165+ tooltip = { translate ( 'logs' ) }
166+ history = { this . props . history }
167+ />
168+ ) }
169+ { ! this . state . hideReportIssueButton && (
170+ < LinkIconButton
171+ icon = { IssueNewIcon }
172+ link = "https://github.com/AXeL-dev/distract-me-not/issues"
173+ external
174+ tooltip = { translate ( 'reportIssue' ) }
175+ history = { this . props . history }
176+ />
177+ ) }
178+ </ Pane >
179+ < Pane >
180+ < AnimatedIconButton
181+ appearance = "minimal"
182+ tooltip = { this . state . mode === Mode . whitelist ? translate ( 'addToWhitelist' ) : translate ( 'addToBlacklist' ) }
183+ tooltipPosition = { Position . LEFT }
184+ icon = { PlusIcon }
185+ iconSize = { 22 }
186+ iconColor = "#47b881"
187+ onClick = { ( ) => addCurrentWebsite ( this . state . mode , this . state . showAddWebsitePrompt ) }
188+ hideOnClick = { true }
189+ hideAnimationIcon = { TickIcon }
190+ isVisible = { this . state . isAddButtonVisible }
191+ onVisibilityChange = { this . setAddButtonVisibility }
192+ />
193+ </ Pane >
194+ </ Pane >
195+ </ >
196+ ) }
197197 </ Pane >
198198 ) ;
199199 }
0 commit comments