diff options
author | 2019-10-16 11:06:27 +0200 | |
---|---|---|
committer | 2019-10-16 11:06:27 +0200 | |
commit | a56408ad7531c1f5e552f926a88cc4540d805b85 (patch) | |
tree | b2b544c5b8deec837df7499c04aaa419246a912a /src/components | |
parent | Add custom CSS for darkmode to fix WhatsApp and Threema QR codes (diff) | |
download | ferdium-app-a56408ad7531c1f5e552f926a88cc4540d805b85.tar.gz ferdium-app-a56408ad7531c1f5e552f926a88cc4540d805b85.tar.zst ferdium-app-a56408ad7531c1f5e552f926a88cc4540d805b85.zip |
Add button to directly open darkmode.css
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 5fe00cb8b..bcff62280 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -29,6 +29,10 @@ const messages = defineMessages({ | |||
29 | id: 'settings.service.form.deleteButton', | 29 | id: 'settings.service.form.deleteButton', |
30 | defaultMessage: '!!!Delete Service', | 30 | defaultMessage: '!!!Delete Service', |
31 | }, | 31 | }, |
32 | openDarkmodeCss: { | ||
33 | id: 'settings.service.form.openDarkmodeCss', | ||
34 | defaultMessage: '!!!Open darkmode.css', | ||
35 | }, | ||
32 | availableServices: { | 36 | availableServices: { |
33 | id: 'settings.service.form.availableServices', | 37 | id: 'settings.service.form.availableServices', |
34 | defaultMessage: '!!!Available services', | 38 | defaultMessage: '!!!Available services', |
@@ -127,6 +131,8 @@ export default @observer class EditServiceForm extends Component { | |||
127 | form: PropTypes.instanceOf(Form).isRequired, | 131 | form: PropTypes.instanceOf(Form).isRequired, |
128 | onSubmit: PropTypes.func.isRequired, | 132 | onSubmit: PropTypes.func.isRequired, |
129 | onDelete: PropTypes.func.isRequired, | 133 | onDelete: PropTypes.func.isRequired, |
134 | openDarkmodeCss: PropTypes.func.isRequired, | ||
135 | isOpeningDarkModeCss: PropTypes.bool.isRequired, | ||
130 | isSaving: PropTypes.bool.isRequired, | 136 | isSaving: PropTypes.bool.isRequired, |
131 | isDeleting: PropTypes.bool.isRequired, | 137 | isDeleting: PropTypes.bool.isRequired, |
132 | isProxyFeatureEnabled: PropTypes.bool.isRequired, | 138 | isProxyFeatureEnabled: PropTypes.bool.isRequired, |
@@ -193,6 +199,8 @@ export default @observer class EditServiceForm extends Component { | |||
193 | isSaving, | 199 | isSaving, |
194 | isDeleting, | 200 | isDeleting, |
195 | onDelete, | 201 | onDelete, |
202 | openDarkmodeCss, | ||
203 | isOpeningDarkModeCss, | ||
196 | isProxyFeatureEnabled, | 204 | isProxyFeatureEnabled, |
197 | isServiceProxyIncludedInCurrentPlan, | 205 | isServiceProxyIncludedInCurrentPlan, |
198 | isSpellcheckerIncludedInCurrentPlan, | 206 | isSpellcheckerIncludedInCurrentPlan, |
@@ -218,6 +226,23 @@ export default @observer class EditServiceForm extends Component { | |||
218 | /> | 226 | /> |
219 | ); | 227 | ); |
220 | 228 | ||
229 | const openDarkmodeCssButton = isOpeningDarkModeCss ? ( | ||
230 | <Button | ||
231 | label={intl.formatMessage(messages.openDarkmodeCss)} | ||
232 | loaded={false} | ||
233 | buttonType="secondary" | ||
234 | className="settings__open-dark-mode-button" | ||
235 | disabled | ||
236 | /> | ||
237 | ) : ( | ||
238 | <Button | ||
239 | buttonType="secondary" | ||
240 | label={intl.formatMessage(messages.openDarkmodeCss)} | ||
241 | className="settings__open-dark-mode-button" | ||
242 | onClick={openDarkmodeCss} | ||
243 | /> | ||
244 | ); | ||
245 | |||
221 | let activeTabIndex = 0; | 246 | let activeTabIndex = 0; |
222 | if (recipe.hasHostedOption && service.team) { | 247 | if (recipe.hasHostedOption && service.team) { |
223 | activeTabIndex = 1; | 248 | activeTabIndex = 1; |
@@ -406,6 +431,7 @@ export default @observer class EditServiceForm extends Component { | |||
406 | <div className="settings__controls"> | 431 | <div className="settings__controls"> |
407 | {/* Delete Button */} | 432 | {/* Delete Button */} |
408 | {action === 'edit' && deleteButton} | 433 | {action === 'edit' && deleteButton} |
434 | {action === 'edit' && openDarkmodeCssButton} | ||
409 | 435 | ||
410 | {/* Save Button */} | 436 | {/* Save Button */} |
411 | {isSaving || isValidatingCustomUrl ? ( | 437 | {isSaving || isValidatingCustomUrl ? ( |