diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/services/content/ServiceView.js | 6 | ||||
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 65 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 2 |
3 files changed, 48 insertions, 25 deletions
diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js index 860863d26..f6832038a 100644 --- a/src/components/services/content/ServiceView.js +++ b/src/components/services/content/ServiceView.js | |||
@@ -135,9 +135,11 @@ export default @inject('stores', 'actions') @observer class ServiceView extends | |||
135 | } = this.props; | 135 | } = this.props; |
136 | 136 | ||
137 | const { | 137 | const { |
138 | showServiceNavigationBar, | 138 | navigationBarBehaviour, |
139 | } = stores.settings.app; | 139 | } = stores.settings.app; |
140 | 140 | ||
141 | const showNavBar = navigationBarBehaviour === 'always' || (navigationBarBehaviour === 'custom' && service.recipe.id === CUSTOM_WEBSITE_ID); | ||
142 | |||
141 | const webviewClasses = classnames({ | 143 | const webviewClasses = classnames({ |
142 | services__webview: true, | 144 | services__webview: true, |
143 | 'services__webview-wrapper': true, | 145 | 'services__webview-wrapper': true, |
@@ -193,7 +195,7 @@ export default @inject('stores', 'actions') @observer class ServiceView extends | |||
193 | <> | 195 | <> |
194 | {!service.isHibernating ? ( | 196 | {!service.isHibernating ? ( |
195 | <> | 197 | <> |
196 | {(service.recipe.id === CUSTOM_WEBSITE_ID || showServiceNavigationBar) && ( | 198 | {showNavBar && ( |
197 | <WebControlsScreen service={service} /> | 199 | <WebControlsScreen service={service} /> |
198 | )} | 200 | )} |
199 | <ServiceWebview | 201 | <ServiceWebview |
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 89c82c7f8..98051d78f 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -33,6 +33,18 @@ const messages = defineMessages({ | |||
33 | id: 'settings.service.form.openDarkmodeCss', | 33 | id: 'settings.service.form.openDarkmodeCss', |
34 | defaultMessage: '!!!Open darkmode.css', | 34 | defaultMessage: '!!!Open darkmode.css', |
35 | }, | 35 | }, |
36 | openUserCss: { | ||
37 | id: 'settings.service.form.openUserCss', | ||
38 | defaultMessage: '!!!Open user.css', | ||
39 | }, | ||
40 | openUserJs: { | ||
41 | id: 'settings.service.form.openUserJs', | ||
42 | defaultMessage: '!!!Open user.js', | ||
43 | }, | ||
44 | recipeFileInfo: { | ||
45 | id: 'settings.service.form.recipeFileInfo', | ||
46 | defaultMessage: '!!!Your user files will be inserted into the webpage so you can customize services in any way you like. User files are only stored locally and are not transferred to other computers using the same account.', | ||
47 | }, | ||
36 | availableServices: { | 48 | availableServices: { |
37 | id: 'settings.service.form.availableServices', | 49 | id: 'settings.service.form.availableServices', |
38 | defaultMessage: '!!!Available services', | 50 | defaultMessage: '!!!Available services', |
@@ -131,8 +143,7 @@ export default @observer class EditServiceForm extends Component { | |||
131 | form: PropTypes.instanceOf(Form).isRequired, | 143 | form: PropTypes.instanceOf(Form).isRequired, |
132 | onSubmit: PropTypes.func.isRequired, | 144 | onSubmit: PropTypes.func.isRequired, |
133 | onDelete: PropTypes.func.isRequired, | 145 | onDelete: PropTypes.func.isRequired, |
134 | openDarkmodeCss: PropTypes.func.isRequired, | 146 | openRecipeFile: PropTypes.func.isRequired, |
135 | isOpeningDarkModeCss: PropTypes.bool.isRequired, | ||
136 | isSaving: PropTypes.bool.isRequired, | 147 | isSaving: PropTypes.bool.isRequired, |
137 | isDeleting: PropTypes.bool.isRequired, | 148 | isDeleting: PropTypes.bool.isRequired, |
138 | isProxyFeatureEnabled: PropTypes.bool.isRequired, | 149 | isProxyFeatureEnabled: PropTypes.bool.isRequired, |
@@ -199,8 +210,7 @@ export default @observer class EditServiceForm extends Component { | |||
199 | isSaving, | 210 | isSaving, |
200 | isDeleting, | 211 | isDeleting, |
201 | onDelete, | 212 | onDelete, |
202 | openDarkmodeCss, | 213 | openRecipeFile, |
203 | isOpeningDarkModeCss, | ||
204 | isProxyFeatureEnabled, | 214 | isProxyFeatureEnabled, |
205 | isServiceProxyIncludedInCurrentPlan, | 215 | isServiceProxyIncludedInCurrentPlan, |
206 | isSpellcheckerIncludedInCurrentPlan, | 216 | isSpellcheckerIncludedInCurrentPlan, |
@@ -226,23 +236,6 @@ export default @observer class EditServiceForm extends Component { | |||
226 | /> | 236 | /> |
227 | ); | 237 | ); |
228 | 238 | ||
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 | |||
246 | let activeTabIndex = 0; | 239 | let activeTabIndex = 0; |
247 | if (recipe.hasHostedOption && service.team) { | 240 | if (recipe.hasHostedOption && service.team) { |
248 | activeTabIndex = 1; | 241 | activeTabIndex = 1; |
@@ -430,11 +423,39 @@ export default @observer class EditServiceForm extends Component { | |||
430 | </PremiumFeatureContainer> | 423 | </PremiumFeatureContainer> |
431 | )} | 424 | )} |
432 | </form> | 425 | </form> |
426 | |||
427 | {action === 'edit' && ( | ||
428 | <> | ||
429 | <div className="settings__open-recipe-file-container"> | ||
430 | <Button | ||
431 | buttonType="secondary" | ||
432 | label={intl.formatMessage(messages.openDarkmodeCss)} | ||
433 | className="settings__open-recipe-file-button" | ||
434 | onClick={() => openRecipeFile('darkmode.css')} | ||
435 | /> | ||
436 | <Button | ||
437 | buttonType="secondary" | ||
438 | label={intl.formatMessage(messages.openUserCss)} | ||
439 | className="settings__open-recipe-file-button" | ||
440 | onClick={() => openRecipeFile('user.css')} | ||
441 | /> | ||
442 | <Button | ||
443 | buttonType="secondary" | ||
444 | label={intl.formatMessage(messages.openUserJs)} | ||
445 | className="settings__open-recipe-file-button" | ||
446 | onClick={() => openRecipeFile('user.js')} | ||
447 | /> | ||
448 | </div> | ||
449 | <p style={{ marginTop: 10 }}> | ||
450 | <span className="mdi mdi-information" /> | ||
451 | {intl.formatMessage(messages.recipeFileInfo)} | ||
452 | </p> | ||
453 | </> | ||
454 | )} | ||
433 | </div> | 455 | </div> |
434 | <div className="settings__controls"> | 456 | <div className="settings__controls"> |
435 | {/* Delete Button */} | 457 | {/* Delete Button */} |
436 | {action === 'edit' && deleteButton} | 458 | {action === 'edit' && deleteButton} |
437 | {action === 'edit' && openDarkmodeCssButton} | ||
438 | 459 | ||
439 | {/* Save Button */} | 460 | {/* Save Button */} |
440 | {isSaving || isValidatingCustomUrl ? ( | 461 | {isSaving || isValidatingCustomUrl ? ( |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 432a546d9..f41c7db8e 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -256,7 +256,7 @@ export default @observer class EditSettingsForm extends Component { | |||
256 | <Toggle field={form.$('minimizeToSystemTray')} /> | 256 | <Toggle field={form.$('minimizeToSystemTray')} /> |
257 | )} | 257 | )} |
258 | <Toggle field={form.$('privateNotifications')} /> | 258 | <Toggle field={form.$('privateNotifications')} /> |
259 | <Toggle field={form.$('showServiceNavigationBar')} /> | 259 | <Select field={form.$('navigationBarBehaviour')} /> |
260 | 260 | ||
261 | <Hr /> | 261 | <Hr /> |
262 | 262 | ||