diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/settings/account/AccountDashboard.js | 71 | ||||
-rw-r--r-- | src/components/settings/user/EditUserForm.js | 25 | ||||
-rw-r--r-- | src/index.js | 29 | ||||
-rw-r--r-- | src/stores/UIStore.js | 7 | ||||
-rw-r--r-- | src/styles/toggle.scss | 2 |
5 files changed, 61 insertions, 73 deletions
diff --git a/src/components/settings/account/AccountDashboard.js b/src/components/settings/account/AccountDashboard.js index 9c9543749..f2d3ca8c0 100644 --- a/src/components/settings/account/AccountDashboard.js +++ b/src/components/settings/account/AccountDashboard.js | |||
@@ -169,15 +169,9 @@ export default @observer class AccountDashboard extends Component { | |||
169 | {user.organization && `${user.organization}, `} | 169 | {user.organization && `${user.organization}, `} |
170 | {user.email} | 170 | {user.email} |
171 | <br /> | 171 | <br /> |
172 | {!user.isEnterprise && !user.isPremium && ( | ||
173 | <span className="badge badge">{intl.formatMessage(messages.accountTypeBasic)}</span> | ||
174 | )} | ||
175 | {user.isPremium && ( | 172 | {user.isPremium && ( |
176 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> | 173 | <span className="badge badge--premium">{intl.formatMessage(messages.accountTypePremium)}</span> |
177 | )} | 174 | )} |
178 | {user.isEnterprise && ( | ||
179 | <span className="badge badge--success">{intl.formatMessage(messages.accountTypeEnterprise)}</span> | ||
180 | )} | ||
181 | </div> | 175 | </div> |
182 | <Link to="/settings/user/edit" className="button"> | 176 | <Link to="/settings/user/edit" className="button"> |
183 | {intl.formatMessage(messages.accountEditButton)} | 177 | {intl.formatMessage(messages.accountEditButton)} |
@@ -235,34 +229,7 @@ export default @observer class AccountDashboard extends Component { | |||
235 | ) | 229 | ) |
236 | )} | 230 | )} |
237 | 231 | ||
238 | {user.isEnterprise && ( | 232 | {!user.isPremium && ( |
239 | <div className="account"> | ||
240 | <div className="account__box"> | ||
241 | <h2>{user.company.name}</h2> | ||
242 | <p> | ||
243 | Technical contact: | ||
244 | <Link | ||
245 | className="link" | ||
246 | target="_blank" | ||
247 | to={`mailto:${user.company.contact.technical}?subject=Franz`} | ||
248 | > | ||
249 | {user.company.contact.technical} | ||
250 | </Link> | ||
251 | <br /> | ||
252 | General contact: | ||
253 | <Link | ||
254 | className="link" | ||
255 | target="_blank" | ||
256 | to={`mailto:${user.company.contact.default}?subject=Franz`} | ||
257 | > | ||
258 | {user.company.contact.default} | ||
259 | </Link> | ||
260 | </p> | ||
261 | </div> | ||
262 | </div> | ||
263 | )} | ||
264 | |||
265 | {!user.isEnterprise && !user.isPremium && ( | ||
266 | isLoadingPlans ? ( | 233 | isLoadingPlans ? ( |
267 | <Loader /> | 234 | <Loader /> |
268 | ) : ( | 235 | ) : ( |
@@ -277,27 +244,25 @@ export default @observer class AccountDashboard extends Component { | |||
277 | ) | 244 | ) |
278 | )} | 245 | )} |
279 | 246 | ||
280 | {!user.isEnterprise && ( | 247 | <div className="account franz-form"> |
281 | <div className="account franz-form"> | 248 | <div className="account__box"> |
282 | <div className="account__box"> | 249 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> |
283 | <h2>{intl.formatMessage(messages.headlineDangerZone)}</h2> | 250 | {!isDeleteAccountSuccessful && ( |
284 | {!isDeleteAccountSuccessful && ( | 251 | <div className="account__subscription"> |
285 | <div className="account__subscription"> | 252 | <p>{intl.formatMessage(messages.deleteInfo)}</p> |
286 | <p>{intl.formatMessage(messages.deleteInfo)}</p> | 253 | <Button |
287 | <Button | 254 | label={intl.formatMessage(messages.deleteAccount)} |
288 | label={intl.formatMessage(messages.deleteAccount)} | 255 | buttonType="danger" |
289 | buttonType="danger" | 256 | onClick={() => deleteAccount()} |
290 | onClick={() => deleteAccount()} | 257 | loaded={!isLoadingDeleteAccount} |
291 | loaded={!isLoadingDeleteAccount} | 258 | /> |
292 | /> | ||
293 | </div> | ||
294 | )} | ||
295 | {isDeleteAccountSuccessful && ( | ||
296 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> | ||
297 | )} | ||
298 | </div> | 259 | </div> |
260 | )} | ||
261 | {isDeleteAccountSuccessful && ( | ||
262 | <p>{intl.formatMessage(messages.deleteEmailSent)}</p> | ||
263 | )} | ||
299 | </div> | 264 | </div> |
300 | )} | 265 | </div> |
301 | </Fragment> | 266 | </Fragment> |
302 | )} | 267 | )} |
303 | </div> | 268 | </div> |
diff --git a/src/components/settings/user/EditUserForm.js b/src/components/settings/user/EditUserForm.js index 0e3ac6b10..a1a353e57 100644 --- a/src/components/settings/user/EditUserForm.js +++ b/src/components/settings/user/EditUserForm.js | |||
@@ -3,11 +3,10 @@ import PropTypes from 'prop-types'; | |||
3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; | 3 | import { observer, PropTypes as MobxPropTypes } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape } from 'react-intl'; |
5 | import { Link } from 'react-router'; | 5 | import { Link } from 'react-router'; |
6 | 6 | import { Input } from '@meetfranz/forms'; | |
7 | // import { Link } from 'react-router'; | ||
8 | 7 | ||
9 | import Form from '../../../lib/Form'; | 8 | import Form from '../../../lib/Form'; |
10 | import Input from '../../ui/Input'; | 9 | // import Input from '../../ui/Input'; |
11 | import Button from '../../ui/Button'; | 10 | import Button from '../../ui/Button'; |
12 | import Radio from '../../ui/Radio'; | 11 | import Radio from '../../ui/Radio'; |
13 | import Infobox from '../../ui/Infobox'; | 12 | import Infobox from '../../ui/Infobox'; |
@@ -39,13 +38,12 @@ const messages = defineMessages({ | |||
39 | }, | 38 | }, |
40 | }); | 39 | }); |
41 | 40 | ||
42 | export default @observer class EditServiceForm extends Component { | 41 | export default @observer class EditUserForm extends Component { |
43 | static propTypes = { | 42 | static propTypes = { |
44 | status: MobxPropTypes.observableArray.isRequired, | 43 | status: MobxPropTypes.observableArray.isRequired, |
45 | form: PropTypes.instanceOf(Form).isRequired, | 44 | form: PropTypes.instanceOf(Form).isRequired, |
46 | onSubmit: PropTypes.func.isRequired, | 45 | onSubmit: PropTypes.func.isRequired, |
47 | isSaving: PropTypes.bool.isRequired, | 46 | isSaving: PropTypes.bool.isRequired, |
48 | isEnterprise: PropTypes.bool.isRequired, | ||
49 | }; | 47 | }; |
50 | 48 | ||
51 | static contextTypes = { | 49 | static contextTypes = { |
@@ -68,7 +66,6 @@ export default @observer class EditServiceForm extends Component { | |||
68 | // user, | 66 | // user, |
69 | status, | 67 | status, |
70 | form, | 68 | form, |
71 | isEnterprise, | ||
72 | isSaving, | 69 | isSaving, |
73 | } = this.props; | 70 | } = this.props; |
74 | const { intl } = this.context; | 71 | const { intl } = this.context; |
@@ -98,23 +95,21 @@ export default @observer class EditServiceForm extends Component { | |||
98 | )} | 95 | )} |
99 | <h2>{intl.formatMessage(messages.headlineAccount)}</h2> | 96 | <h2>{intl.formatMessage(messages.headlineAccount)}</h2> |
100 | <div className="grid__row"> | 97 | <div className="grid__row"> |
101 | <Input field={form.$('firstname')} focus /> | 98 | <Input {...form.$('firstname').bind()} focus /> |
102 | <Input field={form.$('lastname')} /> | 99 | <Input {...form.$('lastname').bind()} /> |
103 | </div> | 100 | </div> |
104 | <Input field={form.$('email')} /> | 101 | <Input {...form.$('email').bind()} /> |
105 | {!isEnterprise && ( | 102 | <Radio field={form.$('accountType')} /> |
106 | <Radio field={form.$('accountType')} /> | 103 | {form.$('accountType').value === 'company' && ( |
107 | )} | ||
108 | {!isEnterprise && form.$('accountType').value === 'company' && ( | ||
109 | <Input field={form.$('organization')} /> | 104 | <Input field={form.$('organization')} /> |
110 | )} | 105 | )} |
111 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> | 106 | <h2>{intl.formatMessage(messages.headlinePassword)}</h2> |
112 | <Input | 107 | <Input |
113 | field={form.$('oldPassword')} | 108 | {...form.$('oldPassword').bind()} |
114 | showPasswordToggle | 109 | showPasswordToggle |
115 | /> | 110 | /> |
116 | <Input | 111 | <Input |
117 | field={form.$('newPassword')} | 112 | {...form.$('newPassword').bind()} |
118 | showPasswordToggle | 113 | showPasswordToggle |
119 | scorePassword | 114 | scorePassword |
120 | /> | 115 | /> |
diff --git a/src/index.js b/src/index.js index a2b4acb00..a3c770797 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -94,6 +94,35 @@ if (!gotTheLock) { | |||
94 | } | 94 | } |
95 | }); | 95 | }); |
96 | } | 96 | } |
97 | // const isSecondInstance = app.makeSingleInstance((argv) => { | ||
98 | // if (mainWindow) { | ||
99 | // if (mainWindow.isMinimized()) mainWindow.restore(); | ||
100 | // mainWindow.focus(); | ||
101 | |||
102 | // if (process.platform === 'win32') { | ||
103 | // // Keep only command line / deep linked arguments | ||
104 | // const url = argv.slice(1); | ||
105 | |||
106 | // if (url) { | ||
107 | // handleDeepLink(mainWindow, url.toString()); | ||
108 | // } | ||
109 | // } | ||
110 | // } | ||
111 | |||
112 | // if (argv.includes('--reset-window')) { | ||
113 | // // Needs to be delayed to not interfere with mainWindow.restore(); | ||
114 | // setTimeout(() => { | ||
115 | // debug('Resetting windows via Task'); | ||
116 | // mainWindow.setPosition(DEFAULT_WINDOW_OPTIONS.x + 100, DEFAULT_WINDOW_OPTIONS.y + 100); | ||
117 | // mainWindow.setSize(DEFAULT_WINDOW_OPTIONS.width, DEFAULT_WINDOW_OPTIONS.height); | ||
118 | // }, 1); | ||
119 | // } | ||
120 | // }); | ||
121 | |||
122 | // if (isSecondInstance) { | ||
123 | // console.log('An instance of Franz is already running. Exiting...'); | ||
124 | // app.exit(); | ||
125 | // } | ||
97 | 126 | ||
98 | // Fix Unity indicator issue | 127 | // Fix Unity indicator issue |
99 | // https://github.com/electron/electron/issues/9046 | 128 | // https://github.com/electron/electron/issues/9046 |
diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js index d37ebe4c7..bb7965a4a 100644 --- a/src/stores/UIStore.js +++ b/src/stores/UIStore.js | |||
@@ -1,8 +1,7 @@ | |||
1 | import { action, observable, computed } from 'mobx'; | 1 | import { action, observable, computed } from 'mobx'; |
2 | import { theme } from '@meetfranz/theme'; | ||
2 | 3 | ||
3 | import Store from './lib/Store'; | 4 | import Store from './lib/Store'; |
4 | import * as themeDefault from '../theme/default'; | ||
5 | import * as themeDark from '../theme/dark'; | ||
6 | 5 | ||
7 | export default class UIStore extends Store { | 6 | export default class UIStore extends Store { |
8 | @observable showServicesUpdatedInfoBar = false; | 7 | @observable showServicesUpdatedInfoBar = false; |
@@ -24,10 +23,10 @@ export default class UIStore extends Store { | |||
24 | 23 | ||
25 | @computed get theme() { | 24 | @computed get theme() { |
26 | if (this.stores.settings.all.app.darkMode) { | 25 | if (this.stores.settings.all.app.darkMode) { |
27 | return Object.assign({}, themeDefault, themeDark); | 26 | return theme('dark'); |
28 | } | 27 | } |
29 | 28 | ||
30 | return themeDefault; | 29 | return theme('default'); |
31 | } | 30 | } |
32 | 31 | ||
33 | // Actions | 32 | // Actions |
diff --git a/src/styles/toggle.scss b/src/styles/toggle.scss index 0ce0c3379..52675ceed 100644 --- a/src/styles/toggle.scss +++ b/src/styles/toggle.scss | |||
@@ -41,7 +41,7 @@ $toggle-button-size: 22px; | |||
41 | 41 | ||
42 | &.is-active .franz-form__toggle-button { | 42 | &.is-active .franz-form__toggle-button { |
43 | background: $theme-brand-primary; | 43 | background: $theme-brand-primary; |
44 | left: $toggle-width - $toggle-size - 3;; | 44 | left: $toggle-width - $toggle-size - 3; |
45 | } | 45 | } |
46 | 46 | ||
47 | input { display: none; } | 47 | input { display: none; } |