aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings/EditServiceScreen.js
diff options
context:
space:
mode:
authorLibravatar vantezzen <hello@vantezzen.io>2019-10-16 11:06:27 +0200
committerLibravatar vantezzen <hello@vantezzen.io>2019-10-16 11:06:27 +0200
commita56408ad7531c1f5e552f926a88cc4540d805b85 (patch)
treeb2b544c5b8deec837df7499c04aaa419246a912a /src/containers/settings/EditServiceScreen.js
parentAdd custom CSS for darkmode to fix WhatsApp and Threema QR codes (diff)
downloadferdium-app-a56408ad7531c1f5e552f926a88cc4540d805b85.tar.gz
ferdium-app-a56408ad7531c1f5e552f926a88cc4540d805b85.tar.zst
ferdium-app-a56408ad7531c1f5e552f926a88cc4540d805b85.zip
Add button to directly open darkmode.css
Diffstat (limited to 'src/containers/settings/EditServiceScreen.js')
-rw-r--r--src/containers/settings/EditServiceScreen.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js
index e4ff03bb3..d18d7fb9b 100644
--- a/src/containers/settings/EditServiceScreen.js
+++ b/src/containers/settings/EditServiceScreen.js
@@ -92,6 +92,10 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
92 intl: intlShape, 92 intl: intlShape,
93 }; 93 };
94 94
95 state = {
96 isOpeningDarkModeCss: false,
97 }
98
95 onSubmit(data) { 99 onSubmit(data) {
96 const { action } = this.props.router.params; 100 const { action } = this.props.router.params;
97 const { recipes, services } = this.props.stores; 101 const { recipes, services } = this.props.stores;
@@ -278,6 +282,28 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
278 } 282 }
279 } 283 }
280 284
285 openDarkmodeCss() {
286 const { openDarkmodeCss } = this.props.actions.service;
287 const { action } = this.props.router.params;
288
289 if (action === 'edit') {
290 this.setState({
291 isOpeningDarkModeCss: true,
292 });
293
294 const { activeSettings: service } = this.props.stores.services;
295 openDarkmodeCss({
296 recipe: service.recipe.id,
297 });
298
299 setTimeout(() => {
300 this.setState({
301 isOpeningDarkModeCss: false,
302 });
303 }, 2500);
304 }
305 }
306
281 render() { 307 render() {
282 const { recipes, services, user } = this.props.stores; 308 const { recipes, services, user } = this.props.stores;
283 const { action } = this.props.router.params; 309 const { action } = this.props.router.params;
@@ -329,6 +355,8 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
329 isDeleting={services.deleteServiceRequest.isExecuting} 355 isDeleting={services.deleteServiceRequest.isExecuting}
330 onSubmit={d => this.onSubmit(d)} 356 onSubmit={d => this.onSubmit(d)}
331 onDelete={() => this.deleteService()} 357 onDelete={() => this.deleteService()}
358 openDarkmodeCss={() => this.openDarkmodeCss()}
359 isOpeningDarkModeCss={this.state.isOpeningDarkModeCss}
332 isProxyFeatureEnabled={proxyFeature.isEnabled} 360 isProxyFeatureEnabled={proxyFeature.isEnabled}
333 isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan} 361 isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan}
334 isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan} 362 isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan}
@@ -356,6 +384,7 @@ EditServiceScreen.wrappedComponent.propTypes = {
356 createService: PropTypes.func.isRequired, 384 createService: PropTypes.func.isRequired,
357 updateService: PropTypes.func.isRequired, 385 updateService: PropTypes.func.isRequired,
358 deleteService: PropTypes.func.isRequired, 386 deleteService: PropTypes.func.isRequired,
387 openDarkmodeCss: PropTypes.func.isRequired,
359 }).isRequired, 388 }).isRequired,
360 // settings: PropTypes.shape({ 389 // settings: PropTypes.shape({
361 // update: PropTypes.func.isRequred, 390 // update: PropTypes.func.isRequred,