diff options
author | 2022-11-07 01:11:48 +0530 | |
---|---|---|
committer | 2022-11-08 17:25:27 +0530 | |
commit | a1f5e31bfce97b4bbe492e24bf7d57ec2803c31a (patch) | |
tree | 881417b8917e8212fcf94547b92bba2701592745 /src/components/settings/services/EditServiceForm.js | |
parent | 6.2.1-nightly.42 [skip ci] (diff) | |
download | ferdium-app-a1f5e31bfce97b4bbe492e24bf7d57ec2803c31a.tar.gz ferdium-app-a1f5e31bfce97b4bbe492e24bf7d57ec2803c31a.tar.zst ferdium-app-a1f5e31bfce97b4bbe492e24bf7d57ec2803c31a.zip |
refactor: remove toggle component's duplicate
Diffstat (limited to 'src/components/settings/services/EditServiceForm.js')
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index eeb9ef54d..eb18b57eb 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -4,7 +4,6 @@ import { observer } from 'mobx-react'; | |||
4 | import { Link } from 'react-router-dom'; | 4 | import { Link } from 'react-router-dom'; |
5 | import { defineMessages, injectIntl } from 'react-intl'; | 5 | import { defineMessages, injectIntl } from 'react-intl'; |
6 | import normalizeUrl from 'normalize-url'; | 6 | import normalizeUrl from 'normalize-url'; |
7 | |||
8 | import { mdiInformation } from '@mdi/js'; | 7 | import { mdiInformation } from '@mdi/js'; |
9 | import Form from '../../../lib/Form'; | 8 | import Form from '../../../lib/Form'; |
10 | import Recipe from '../../../models/Recipe'; | 9 | import Recipe from '../../../models/Recipe'; |
@@ -12,12 +11,11 @@ import Service from '../../../models/Service'; | |||
12 | import Tabs from '../../ui/Tabs/Tabs'; | 11 | import Tabs from '../../ui/Tabs/Tabs'; |
13 | import TabItem from '../../ui/Tabs/TabItem'; | 12 | import TabItem from '../../ui/Tabs/TabItem'; |
14 | import Input from '../../ui/input/index'; | 13 | import Input from '../../ui/input/index'; |
15 | import Toggle from '../../ui/Toggle'; | 14 | import Toggle from '../../ui/toggle'; |
16 | import Slider from '../../ui/Slider'; | 15 | import Slider from '../../ui/Slider'; |
17 | import Button from '../../ui/button'; | 16 | import Button from '../../ui/button'; |
18 | import ImageUpload from '../../ui/ImageUpload'; | 17 | import ImageUpload from '../../ui/ImageUpload'; |
19 | import Select from '../../ui/Select'; | 18 | import Select from '../../ui/Select'; |
20 | |||
21 | import { isMac } from '../../../environment'; | 19 | import { isMac } from '../../../environment'; |
22 | import globalMessages from '../../../i18n/globalMessages'; | 20 | import globalMessages from '../../../i18n/globalMessages'; |
23 | import Icon from '../../ui/icon'; | 21 | import Icon from '../../ui/icon'; |
@@ -342,22 +340,22 @@ class EditServiceForm extends Component { | |||
342 | <div className="settings__options"> | 340 | <div className="settings__options"> |
343 | <div className="settings__settings-group"> | 341 | <div className="settings__settings-group"> |
344 | <H3>{intl.formatMessage(messages.headlineNotifications)}</H3> | 342 | <H3>{intl.formatMessage(messages.headlineNotifications)}</H3> |
345 | <Toggle field={form.$('isNotificationEnabled')} /> | 343 | <Toggle {...form.$('isNotificationEnabled').bind()} /> |
346 | <Toggle field={form.$('isMuted')} /> | 344 | <Toggle {...form.$('isMuted').bind()} /> |
347 | <p className="settings__help indented__help"> | 345 | <p className="settings__help indented__help"> |
348 | {intl.formatMessage(messages.isMutedInfo)} | 346 | {intl.formatMessage(messages.isMutedInfo)} |
349 | </p> | 347 | </p> |
350 | <Toggle field={form.$('isMediaBadgeEnabled')} /> | 348 | <Toggle {...form.$('isMediaBadgeEnabled').bind()} /> |
351 | </div> | 349 | </div> |
352 | 350 | ||
353 | <div className="settings__settings-group"> | 351 | <div className="settings__settings-group"> |
354 | <H3>{intl.formatMessage(messages.headlineBadges)}</H3> | 352 | <H3>{intl.formatMessage(messages.headlineBadges)}</H3> |
355 | <Toggle field={form.$('isBadgeEnabled')} /> | 353 | <Toggle {...form.$('isBadgeEnabled').bind()} /> |
356 | {recipe.hasIndirectMessages && | 354 | {recipe.hasIndirectMessages && |
357 | form.$('isBadgeEnabled').value && ( | 355 | form.$('isBadgeEnabled').value && ( |
358 | <> | 356 | <> |
359 | <Toggle | 357 | <Toggle |
360 | field={form.$('isIndirectMessageBadgeEnabled')} | 358 | {...form.$('isIndirectMessageBadgeEnabled').bind()} |
361 | /> | 359 | /> |
362 | <p className="settings__help indented__help"> | 360 | <p className="settings__help indented__help"> |
363 | {intl.formatMessage(messages.indirectMessageInfo)} | 361 | {intl.formatMessage(messages.indirectMessageInfo)} |
@@ -365,19 +363,21 @@ class EditServiceForm extends Component { | |||
365 | </> | 363 | </> |
366 | )} | 364 | )} |
367 | {recipe.allowFavoritesDelineationInUnreadCount && ( | 365 | {recipe.allowFavoritesDelineationInUnreadCount && ( |
368 | <Toggle field={form.$('onlyShowFavoritesInUnreadCount')} /> | 366 | <Toggle |
367 | {...form.$('onlyShowFavoritesInUnreadCount').bind()} | ||
368 | /> | ||
369 | )} | 369 | )} |
370 | </div> | 370 | </div> |
371 | 371 | ||
372 | <div className="settings__settings-group"> | 372 | <div className="settings__settings-group"> |
373 | <H3>{intl.formatMessage(messages.headlineGeneral)}</H3> | 373 | <H3>{intl.formatMessage(messages.headlineGeneral)}</H3> |
374 | <Toggle field={form.$('isEnabled')} /> | 374 | <Toggle {...form.$('isEnabled').bind()} /> |
375 | <Toggle field={form.$('isHibernationEnabled')} /> | 375 | <Toggle {...form.$('isHibernationEnabled').bind()} /> |
376 | <p className="settings__help indented__help"> | 376 | <p className="settings__help indented__help"> |
377 | {intl.formatMessage(messages.isHibernationEnabledInfo)} | 377 | {intl.formatMessage(messages.isHibernationEnabledInfo)} |
378 | </p> | 378 | </p> |
379 | <Toggle field={form.$('isWakeUpEnabled')} /> | 379 | <Toggle {...form.$('isWakeUpEnabled').bind()} /> |
380 | <Toggle field={form.$('trapLinkClicks')} /> | 380 | <Toggle {...form.$('trapLinkClicks').bind()} /> |
381 | {/* TODO: Need to figure out how to effect this change without a reload of the recipe */} | 381 | {/* TODO: Need to figure out how to effect this change without a reload of the recipe */} |
382 | <p className="settings__help indented__help"> | 382 | <p className="settings__help indented__help"> |
383 | {intl.formatMessage(messages.serviceReloadRequired)} | 383 | {intl.formatMessage(messages.serviceReloadRequired)} |
@@ -386,7 +386,7 @@ class EditServiceForm extends Component { | |||
386 | 386 | ||
387 | <div className="settings__settings-group"> | 387 | <div className="settings__settings-group"> |
388 | <H3>{intl.formatMessage(messages.headlineAppearance)}</H3> | 388 | <H3>{intl.formatMessage(messages.headlineAppearance)}</H3> |
389 | <Toggle field={form.$('isDarkModeEnabled')} /> | 389 | <Toggle {...form.$('isDarkModeEnabled').bind()} /> |
390 | {form.$('isDarkModeEnabled').value && ( | 390 | {form.$('isDarkModeEnabled').value && ( |
391 | <> | 391 | <> |
392 | <H3> | 392 | <H3> |
@@ -399,7 +399,7 @@ class EditServiceForm extends Component { | |||
399 | <Slider field={form.$('darkReaderSepia')} /> | 399 | <Slider field={form.$('darkReaderSepia')} /> |
400 | </> | 400 | </> |
401 | )} | 401 | )} |
402 | <Toggle field={form.$('isProgressbarEnabled')} /> | 402 | <Toggle {...form.$('isProgressbarEnabled').bind()} /> |
403 | </div> | 403 | </div> |
404 | </div> | 404 | </div> |
405 | <div className="service-icon"> | 405 | <div className="service-icon"> |
@@ -429,7 +429,7 @@ class EditServiceForm extends Component { | |||
429 | {intl.formatMessage(messages.headlineProxy)} | 429 | {intl.formatMessage(messages.headlineProxy)} |
430 | <span className="badge badge--success">beta</span> | 430 | <span className="badge badge--success">beta</span> |
431 | </H3> | 431 | </H3> |
432 | <Toggle field={form.$('proxy.isEnabled')} /> | 432 | <Toggle {...form.$('proxy.isEnabled').bind()} /> |
433 | {form.$('proxy.isEnabled').value && ( | 433 | {form.$('proxy.isEnabled').value && ( |
434 | <> | 434 | <> |
435 | <div className="grid"> | 435 | <div className="grid"> |