diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-06-05 16:28:45 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-05 12:58:45 +0200 |
commit | aa6689e6158efde28b68948cd8b67d55080158d2 (patch) | |
tree | 6e687fb7b5e2eb37c0027ba31d968b04632f5771 /src/components/settings | |
parent | Reused commonly defined method for 'apiBase' (diff) | |
download | ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.tar.gz ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.tar.zst ferdium-app-aa6689e6158efde28b68948cd8b67d55080158d2.zip |
Removed hardcoded strings and reused constants defined in config.js (#1499)
Diffstat (limited to 'src/components/settings')
4 files changed, 10 insertions, 8 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 809bfda6e..68d88e218 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -11,7 +11,7 @@ import Button from '../../ui/Button'; | |||
11 | import Infobox from '../../ui/Infobox'; | 11 | import Infobox from '../../ui/Infobox'; |
12 | import SubscriptionForm from '../../../containers/subscription/SubscriptionFormScreen'; | 12 | import SubscriptionForm from '../../../containers/subscription/SubscriptionFormScreen'; |
13 | import { i18nPlanName } from '../../../helpers/plan-helpers'; | 13 | import { i18nPlanName } from '../../../helpers/plan-helpers'; |
14 | import { LOCAL_SERVER } from '../../../config'; | 14 | import { LOCAL_SERVER, LIVE_FRANZ_API } from '../../../config'; |
15 | 15 | ||
16 | const messages = defineMessages({ | 16 | const messages = defineMessages({ |
17 | headline: { | 17 | headline: { |
@@ -154,7 +154,7 @@ class AccountDashboard extends Component { | |||
154 | } | 154 | } |
155 | 155 | ||
156 | const isUsingWithoutAccount = server === LOCAL_SERVER; | 156 | const isUsingWithoutAccount = server === LOCAL_SERVER; |
157 | const isUsingFranzServer = server === 'https://api.franzinfra.com'; | 157 | const isUsingFranzServer = server === LIVE_FRANZ_API; |
158 | 158 | ||
159 | return ( | 159 | return ( |
160 | <div className="settings__main"> | 160 | <div className="settings__main"> |
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js index f7786f4e8..616c8c587 100644 --- a/src/components/settings/navigation/SettingsNavigation.js +++ b/src/components/settings/navigation/SettingsNavigation.js | |||
@@ -5,7 +5,7 @@ import { inject, observer } from 'mobx-react'; | |||
5 | import { ProBadge } from '@meetfranz/ui'; | 5 | import { ProBadge } from '@meetfranz/ui'; |
6 | import { RouterStore } from 'mobx-react-router'; | 6 | import { RouterStore } from 'mobx-react-router'; |
7 | 7 | ||
8 | import { LOCAL_SERVER, LIVE_API } from '../../../config'; | 8 | import { LOCAL_SERVER, LIVE_FERDI_API, LIVE_FRANZ_API } from '../../../config'; |
9 | import Link from '../../ui/Link'; | 9 | import Link from '../../ui/Link'; |
10 | import { workspaceStore } from '../../../features/workspaces'; | 10 | import { workspaceStore } from '../../../features/workspaces'; |
11 | import UIStore from '../../../stores/UIStore'; | 11 | import UIStore from '../../../stores/UIStore'; |
@@ -82,7 +82,7 @@ export default @inject('stores', 'actions') @observer class SettingsNavigation e | |||
82 | this.props.actions.settings.update({ | 82 | this.props.actions.settings.update({ |
83 | type: 'app', | 83 | type: 'app', |
84 | data: { | 84 | data: { |
85 | server: LIVE_API, | 85 | server: LIVE_FERDI_API, |
86 | }, | 86 | }, |
87 | }); | 87 | }); |
88 | } | 88 | } |
@@ -105,7 +105,7 @@ export default @inject('stores', 'actions') @observer class SettingsNavigation e | |||
105 | const { intl } = this.context; | 105 | const { intl } = this.context; |
106 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); | 106 | const isLoggedIn = Boolean(localStorage.getItem('authToken')); |
107 | const isUsingWithoutAccount = stores.settings.app.server === LOCAL_SERVER; | 107 | const isUsingWithoutAccount = stores.settings.app.server === LOCAL_SERVER; |
108 | const isUsingFranzServer = stores.settings.app.server === 'https://api.franzinfra.com'; | 108 | const isUsingFranzServer = stores.settings.app.server === LIVE_FRANZ_API; |
109 | 109 | ||
110 | return ( | 110 | return ( |
111 | <div className="settings-navigation"> | 111 | <div className="settings-navigation"> |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 0c0366335..08e5efa2a 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -16,6 +16,7 @@ import Input from '../../ui/Input'; | |||
16 | import { | 16 | import { |
17 | DEFAULT_APP_SETTINGS, | 17 | DEFAULT_APP_SETTINGS, |
18 | FRANZ_TRANSLATION, | 18 | FRANZ_TRANSLATION, |
19 | GITHUB_FRANZ_URL, | ||
19 | } from '../../../config'; | 20 | } from '../../../config'; |
20 | import { isMac, isWindows } from '../../../environment'; | 21 | import { isMac, isWindows } from '../../../environment'; |
21 | 22 | ||
@@ -677,13 +678,13 @@ export default @observer class EditSettingsForm extends Component { | |||
677 | 678 | ||
678 | Ferdi is based on | 679 | Ferdi is based on |
679 | {' '} | 680 | {' '} |
680 | <a href="https://github.com/meetfranz/franz" target="_blank">Franz</a> | 681 | <a href={`${GITHUB_FRANZ_URL}/franz`} target="_blank">Franz</a> |
681 | 682 | ||
682 | 683 | ||
683 | , a project published | 684 | , a project published |
684 | under the | 685 | under the |
685 | {' '} | 686 | {' '} |
686 | <a href="https://github.com/meetfranz/franz/blob/master/LICENSE" target="_blank">Apache-2.0 License</a> | 687 | <a href={`${GITHUB_FRANZ_URL}/franz/blob/master/LICENSE`} target="_blank">Apache-2.0 License</a> |
687 | </span> | 688 | </span> |
688 | <br /> | 689 | <br /> |
689 | <span className="mdi mdi-information" /> | 690 | <span className="mdi mdi-information" /> |
diff --git a/src/components/settings/team/TeamDashboard.js b/src/components/settings/team/TeamDashboard.js index 72358d485..f26f4cc0c 100644 --- a/src/components/settings/team/TeamDashboard.js +++ b/src/components/settings/team/TeamDashboard.js | |||
@@ -12,6 +12,7 @@ import Button from '../../ui/Button'; | |||
12 | import Infobox from '../../ui/Infobox'; | 12 | import Infobox from '../../ui/Infobox'; |
13 | import globalMessages from '../../../i18n/globalMessages'; | 13 | import globalMessages from '../../../i18n/globalMessages'; |
14 | import UpgradeButton from '../../ui/UpgradeButton'; | 14 | import UpgradeButton from '../../ui/UpgradeButton'; |
15 | import { LIVE_FRANZ_API } from '../../../config'; | ||
15 | 16 | ||
16 | const messages = defineMessages({ | 17 | const messages = defineMessages({ |
17 | headline: { | 18 | headline: { |
@@ -125,7 +126,7 @@ export default @injectSheet(styles) @observer class TeamDashboard extends Compon | |||
125 | } = this.props; | 126 | } = this.props; |
126 | const { intl } = this.context; | 127 | const { intl } = this.context; |
127 | 128 | ||
128 | if (server === 'https://api.franzinfra.com') { | 129 | if (server === LIVE_FRANZ_API) { |
129 | return ( | 130 | return ( |
130 | <div className="settings__main"> | 131 | <div className="settings__main"> |
131 | <div className="settings__header"> | 132 | <div className="settings__header"> |