From f4b4416ea52d564bc2dbe543a82084ed98843ccc Mon Sep 17 00:00:00 2001
From: Markus Hatvan
Date: Fri, 30 Jul 2021 10:54:54 +0200
Subject: chore: migrate from tslint to @typescript-eslint (#1706)
- update .eslintrc to work for .js and .ts
- update devDependencies
- lint properly both root /src and nested /packages
- update webhint recommended setting for tsconfig.json to shrink output
- Manage all eslint rules from the repo root
- escape single quotes in scripts to please windows build
Co-authored-by: Vijay A
---
src/features/workspaces/components/WorkspaceDrawerItem.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/features/workspaces/components/WorkspaceDrawerItem.js')
diff --git a/src/features/workspaces/components/WorkspaceDrawerItem.js b/src/features/workspaces/components/WorkspaceDrawerItem.js
index 2e58b70d6..a3fdf4f47 100644
--- a/src/features/workspaces/components/WorkspaceDrawerItem.js
+++ b/src/features/workspaces/components/WorkspaceDrawerItem.js
@@ -18,7 +18,7 @@ const messages = defineMessages({
},
});
-const styles = theme => ({
+const styles = (theme) => ({
item: {
height: '67px',
padding: `15px ${theme.workspaces.drawer.padding}px`,
--
cgit v1.2.3-70-g09d2
From cfaa5ee25c094a96e106ce0bf657f8cd6a59b867 Mon Sep 17 00:00:00 2001
From: Vijay A
Date: Tue, 10 Aug 2021 07:52:45 +0530
Subject: refactor: Use symbols for key shortcuts
---
src/components/layout/Sidebar.js | 6 +--
.../settings/settings/EditSettingsForm.js | 6 +--
src/environment.js | 2 +
.../workspaces/components/WorkspaceDrawerItem.js | 4 +-
src/i18n/locales/af.json | 2 +-
src/i18n/locales/ar.json | 2 +-
src/i18n/locales/be.json | 2 +-
src/i18n/locales/bs.json | 2 +-
src/i18n/locales/ca.json | 2 +-
src/i18n/locales/cs.json | 2 +-
src/i18n/locales/da.json | 2 +-
src/i18n/locales/de.json | 2 +-
src/i18n/locales/defaultMessages.json | 2 +-
src/i18n/locales/el.json | 2 +-
src/i18n/locales/en-US.json | 2 +-
src/i18n/locales/es.json | 2 +-
src/i18n/locales/fi.json | 2 +-
src/i18n/locales/fr.json | 2 +-
src/i18n/locales/ga.json | 2 +-
src/i18n/locales/he.json | 2 +-
src/i18n/locales/hr.json | 2 +-
src/i18n/locales/hu.json | 2 +-
src/i18n/locales/id.json | 2 +-
src/i18n/locales/it.json | 2 +-
src/i18n/locales/ka.json | 2 +-
src/i18n/locales/ko.json | 2 +-
src/i18n/locales/nl-BE.json | 2 +-
src/i18n/locales/nl.json | 2 +-
src/i18n/locales/no.json | 2 +-
src/i18n/locales/pl.json | 2 +-
src/i18n/locales/pt.json | 2 +-
src/i18n/locales/ro.json | 2 +-
src/i18n/locales/ru.json | 2 +-
src/i18n/locales/sk.json | 2 +-
src/i18n/locales/sl.json | 2 +-
src/i18n/locales/sr.json | 2 +-
src/i18n/locales/sv.json | 2 +-
src/i18n/locales/tr.json | 2 +-
src/i18n/locales/uk.json | 2 +-
src/i18n/locales/vi.json | 2 +-
src/i18n/locales/zh-CN.json | 2 +-
src/i18n/locales/zh-HANT.json | 2 +-
src/i18n/locales/zh.json | 2 +-
.../settings/settings/EditSettingsForm.json | 2 +-
src/lib/Menu.js | 48 +++++++++++-----------
45 files changed, 74 insertions(+), 72 deletions(-)
(limited to 'src/features/workspaces/components/WorkspaceDrawerItem.js')
diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js
index 008143a99..14ab21fb5 100644
--- a/src/components/layout/Sidebar.js
+++ b/src/components/layout/Sidebar.js
@@ -6,7 +6,7 @@ import { inject, observer } from 'mobx-react';
import { Link } from 'react-router';
import Tabbar from '../services/tabs/Tabbar';
-import { ctrlKey, isMac } from '../../environment';
+import { ctrlKey, isMac, shiftKey } from '../../environment';
import { workspaceStore } from '../../features/workspaces';
import { todosStore } from '../../features/todos';
import { todoActions } from '../../features/todos/actions';
@@ -151,7 +151,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp
},
});
}}
- data-tip={`${intl.formatMessage(messages.lockFerdi)} (${ctrlKey}+Shift+L)`}
+ data-tip={`${intl.formatMessage(messages.lockFerdi)} (${ctrlKey}+${shiftKey}+L)`}
>
@@ -190,7 +190,7 @@ export default @inject('stores', 'actions') @observer class Sidebar extends Comp
this.updateToolTip();
}}
className={`sidebar__button sidebar__button--audio ${isAppMuted ? 'is-muted' : ''}`}
- data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+Shift+M)`}
+ data-tip={`${intl.formatMessage(isAppMuted ? messages.unmute : messages.mute)} (${ctrlKey}+${shiftKey}+M)`}
>
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js
index e9ea97d1f..a4381e37d 100644
--- a/src/components/settings/settings/EditSettingsForm.js
+++ b/src/components/settings/settings/EditSettingsForm.js
@@ -16,7 +16,7 @@ import {
FRANZ_TRANSLATION,
GITHUB_FRANZ_URL,
} from '../../../config';
-import { DEFAULT_APP_SETTINGS, isMac, isWindows } from '../../../environment';
+import { cmdKey, shiftKey, DEFAULT_APP_SETTINGS, isMac, isWindows } from '../../../environment';
import globalMessages from '../../../i18n/globalMessages';
const messages = defineMessages({
@@ -54,7 +54,7 @@ const messages = defineMessages({
},
lockInfo: {
id: 'settings.app.lockInfo',
- defaultMessage: '!!!Password Lock allows you to keep your messages protected.\nUsing Password Lock, you will be prompted to enter your password everytime you start Ferdi or lock Ferdi yourself using the lock symbol in the bottom left corner or the shortcut CMD/CTRL+Shift+L.',
+ defaultMessage: '!!!Password Lock allows you to keep your messages protected.\nUsing Password Lock, you will be prompted to enter your password everytime you start Ferdi or lock Ferdi yourself using the lock symbol in the bottom left corner or the shortcut {lockShortcut}.',
},
scheduledDNDTimeInfo: {
id: 'settings.app.scheduledDNDTimeInfo',
@@ -548,7 +548,7 @@ export default @observer class EditSettingsForm extends Component {
}}
>
- { intl.formatMessage(messages.lockInfo) }
+ { intl.formatMessage(messages.lockInfo, { lockShortcut: `${cmdKey}+${shiftKey}+L` }) }
diff --git a/src/environment.js b/src/environment.js
index 7267f93a6..d257a114a 100644
--- a/src/environment.js
+++ b/src/environment.js
@@ -75,6 +75,8 @@ export const is64Bit = osArch.match(/64/);
export const ctrlKey = isMac ? '⌘' : 'Ctrl';
export const cmdKey = isMac ? 'Cmd' : 'Ctrl';
+export const altKey = isMac ? '⌥' : 'Alt';
+export const shiftKey = isMac ? '⇧' : 'Shift';
let api;
let wsApi;
diff --git a/src/features/workspaces/components/WorkspaceDrawerItem.js b/src/features/workspaces/components/WorkspaceDrawerItem.js
index a3fdf4f47..0294f69fc 100644
--- a/src/features/workspaces/components/WorkspaceDrawerItem.js
+++ b/src/features/workspaces/components/WorkspaceDrawerItem.js
@@ -5,7 +5,7 @@ import { observer } from 'mobx-react';
import injectSheet from 'react-jss';
import classnames from 'classnames';
import { defineMessages, intlShape } from 'react-intl';
-import { ctrlKey } from '../../../environment';
+import { altKey, ctrlKey } from '../../../environment';
const messages = defineMessages({
noServicesAddedYet: {
@@ -113,7 +113,7 @@ class WorkspaceDrawerItem extends Component {
onContextMenu={() => (
onContextMenuEditClick && contextMenu.popup(getCurrentWindow())
)}
- data-tip={`${shortcutIndex <= 9 ? `(${ctrlKey}+Alt+${shortcutIndex})` : ''}`}
+ data-tip={`${shortcutIndex <= 9 ? `(${ctrlKey}+${altKey}+${shortcutIndex})` : ''}`}
>
[
{
label: intl.formatMessage(menuItems.edit),
- accelerator: 'Alt+E',
+ accelerator: `${altKey}+E`,
submenu: [
{
label: intl.formatMessage(menuItems.undo),
@@ -348,7 +348,7 @@ const _titleBarTemplateFactory = (intl, locked) => [
},
{
label: intl.formatMessage(menuItems.pasteAndMatchStyle),
- accelerator: `${cmdKey}+Shift+V`, // Override the accelerator since this adds new key combo in macos
+ accelerator: `${cmdKey}+${shiftKey}+V`, // Override the accelerator since this adds new key combo in macos
role: 'pasteAndMatchStyle',
click() {
getActiveWebview().pasteAndMatchStyle();
@@ -367,7 +367,7 @@ const _titleBarTemplateFactory = (intl, locked) => [
},
{
label: intl.formatMessage(menuItems.view),
- accelerator: 'Alt+V',
+ accelerator: `${altKey}+V`,
visible: !locked,
submenu: [
{
@@ -463,7 +463,7 @@ const _titleBarTemplateFactory = (intl, locked) => [
{
label: intl.formatMessage(menuItems.toggleDarkMode),
type: 'checkbox',
- accelerator: `${cmdKey}+Shift+D`,
+ accelerator: `${cmdKey}+${shiftKey}+D`,
checked: window.ferdi.stores.settings.app.darkMode,
click: () => {
window.ferdi.actions.settings.update({
@@ -478,13 +478,13 @@ const _titleBarTemplateFactory = (intl, locked) => [
},
{
label: intl.formatMessage(menuItems.services),
- accelerator: 'Alt+S',
+ accelerator: `${altKey}+S`,
visible: !locked,
submenu: [],
},
{
label: intl.formatMessage(menuItems.workspaces),
- accelerator: 'Alt+W',
+ accelerator: `${altKey}+W`,
submenu: [],
visible: !locked && workspaceStore.isFeatureEnabled,
},
@@ -509,7 +509,7 @@ const _titleBarTemplateFactory = (intl, locked) => [
},
{
label: intl.formatMessage(menuItems.help),
- accelerator: 'Alt+H',
+ accelerator: `${altKey}+H`,
role: 'help',
submenu: [
{
@@ -612,13 +612,13 @@ export default class FranzMenu {
type: 'separator',
}, {
label: intl.formatMessage(menuItems.toggleDevTools),
- accelerator: `${cmdKey}+Alt+I`,
+ accelerator: `${cmdKey}+${altKey}+I`,
click: (menuItem, browserWindow) => {
browserWindow.webContents.toggleDevTools();
},
}, {
label: intl.formatMessage(menuItems.toggleServiceDevTools),
- accelerator: `${cmdKey}+Shift+Alt+I`,
+ accelerator: `${cmdKey}+${shiftKey}+${altKey}+I`,
click: () => {
this.actions.service.openDevToolsForActiveService();
},
@@ -628,7 +628,7 @@ export default class FranzMenu {
if (this.stores.features.features.isTodosEnabled) {
tpl[1].submenu.push({
label: intl.formatMessage(menuItems.toggleTodosDevTools),
- accelerator: `${cmdKey}+Shift+Alt+O`,
+ accelerator: `${cmdKey}+${shiftKey}+${altKey}+O`,
click: () => {
const webview = document.querySelector('#todos-panel webview');
if (webview) this.actions.todos.openDevTools();
@@ -654,13 +654,13 @@ export default class FranzMenu {
},
}, {
label: intl.formatMessage(menuItems.reloadFerdi),
- accelerator: `${cmdKey}+Shift+R`,
+ accelerator: `${cmdKey}+${shiftKey}+R`,
click: () => {
window.location.reload();
},
}, {
label: intl.formatMessage(menuItems.reloadTodos),
- accelerator: `${cmdKey}+Shift+Alt+R`,
+ accelerator: `${cmdKey}+${shiftKey}+${altKey}+R`,
click: () => {
this.actions.todos.reload();
},
@@ -668,7 +668,7 @@ export default class FranzMenu {
type: 'separator',
}, {
label: intl.formatMessage(menuItems.lockFerdi),
- accelerator: `${cmdKey}+Shift+L`,
+ accelerator: `${cmdKey}+${shiftKey}+L`,
enabled: this.stores.user.isLoggedIn && this.stores.settings.app.lockingFeatureEnabled,
click() {
actions.settings.update({
@@ -696,7 +696,7 @@ export default class FranzMenu {
tpl[0].submenu.unshift({
label: intl.formatMessage(menuItems.touchId),
- accelerator: `${cmdKey}+Shift+L`,
+ accelerator: `${cmdKey}+${shiftKey}+L`,
visible: touchIdEnabled,
click() {
systemPreferences.promptTouchID(intl.formatMessage(menuItems.touchIdPrompt)).then(() => {
@@ -716,7 +716,7 @@ export default class FranzMenu {
tpl.unshift({
label: isMac ? app.name : intl.formatMessage(menuItems.file),
- accelerator: 'Alt+F',
+ accelerator: `${altKey}+F`,
submenu: [
{
label: intl.formatMessage(menuItems.about),
@@ -888,24 +888,24 @@ export default class FranzMenu {
visible: !cmdAltShortcutsVisibile,
}, {
label: intl.formatMessage(menuItems.activateNextService),
- accelerator: `${cmdKey}+alt+right`,
+ accelerator: `${cmdKey}+${altKey}+right`,
click: () => this.actions.service.setActiveNext(),
visible: cmdAltShortcutsVisibile,
}, {
label: intl.formatMessage(menuItems.activatePreviousService),
- accelerator: `${cmdKey}+shift+tab`,
+ accelerator: `${cmdKey}+${shiftKey}+tab`,
click: () => this.actions.service.setActivePrev(),
visible: !cmdAltShortcutsVisibile,
}, {
label: intl.formatMessage(menuItems.activatePreviousService),
- accelerator: `${cmdKey}+alt+left`,
+ accelerator: `${cmdKey}+${altKey}+left`,
click: () => this.actions.service.setActivePrev(),
visible: cmdAltShortcutsVisibile,
}, {
label: intl.formatMessage(
settings.all.app.isAppMuted ? menuItems.unmuteApp : menuItems.muteApp,
).replace('&', '&&'),
- accelerator: `${cmdKey}+shift+m`,
+ accelerator: `${cmdKey}+${shiftKey}+m`,
click: () => this.actions.app.toggleMuteApp(),
}, {
type: 'separator',
@@ -930,7 +930,7 @@ export default class FranzMenu {
type: 'separator',
}, {
label: intl.formatMessage(menuItems.serviceGoHome),
- accelerator: `${cmdKey}+shift+H`,
+ accelerator: `${cmdKey}+${shiftKey}+H`,
click: () => this.actions.service.reloadActive(),
});
}
@@ -946,7 +946,7 @@ export default class FranzMenu {
// Add new workspace item:
menu.push({
label: intl.formatMessage(menuItems.addNewWorkspace),
- accelerator: `${cmdKey}+Shift+N`,
+ accelerator: `${cmdKey}+${shiftKey}+N`,
click: () => {
workspaceActions.openWorkspaceSettings();
},
@@ -975,7 +975,7 @@ export default class FranzMenu {
// Default workspace
menu.push({
label: intl.formatMessage(menuItems.defaultWorkspace),
- accelerator: `${cmdKey}+Alt+0`,
+ accelerator: `${cmdKey}+${altKey}+0`,
type: 'radio',
checked: !activeWorkspace,
click: () => {
@@ -986,7 +986,7 @@ export default class FranzMenu {
// Workspace items
workspaces.forEach((workspace, i) => menu.push({
label: workspace.name,
- accelerator: i < 9 ? `${cmdKey}+Alt+${i + 1}` : null,
+ accelerator: i < 9 ? `${cmdKey}+${altKey}+${i + 1}` : null,
type: 'radio',
checked: activeWorkspace ? workspace.id === activeWorkspace.id : false,
click: () => {
--
cgit v1.2.3-70-g09d2
From 969eda02a66050cf4518ddfa657e86d1d6d8b6c3 Mon Sep 17 00:00:00 2001
From: Markus Hatvan
Date: Tue, 10 Aug 2021 19:04:54 +0200
Subject: feat: follow OS reduced motion setting (#1757)
- add missing meta charset to index.html
- dont restrict scaling for user in index.html
- load animations.css conditionally based on motion preference
- load transitions conditionally in js and css based on motion preference
Co-authored-by: Vijay Raghavan Aravamudhan
---
.eslintrc | 1 +
packages/forms/src/button/index.tsx | 13 +-
packages/forms/src/select/index.tsx | 12 +-
packages/forms/src/toggle/index.tsx | 8 +-
packages/ui/src/infobox/index.tsx | 12 +-
src/components/auth/SetupAssistant.js | 110 ++++++-----
src/components/layout/AppLayout.js | 86 +++++----
.../services/content/ConnectionLostBanner.js | 36 ++--
src/components/services/tabs/TabItem.js | 193 +++++++++++--------
src/components/ui/AppLoader/styles.js | 8 +-
src/features/webControls/components/WebControls.js | 65 +++----
.../workspaces/components/WorkspaceDrawerItem.js | 47 +++--
.../components/WorkspaceSwitchingIndicator.js | 23 ++-
src/i18n/locales/defaultMessages.json | 46 ++---
.../src/components/auth/SetupAssistant.json | 10 +-
.../messages/src/components/layout/AppLayout.json | 2 +-
.../services/content/ConnectionLostBanner.json | 12 +-
.../src/components/services/tabs/TabItem.json | 2 +-
.../webControls/components/WebControls.json | 20 +-
src/index.html | 122 +++++++-----
src/internal-server/public/css/main.css | 11 +-
src/styles/button.scss | 91 ++++++---
src/styles/content-tabs.scss | 29 ++-
src/styles/fonts.scss | 6 +
src/styles/image-upload.scss | 32 +++-
src/styles/layout.scss | 70 +++++--
src/styles/main.scss | 1 -
src/styles/radio.scss | 19 +-
src/styles/recipes.scss | 36 ++--
src/styles/settings.scss | 213 +++++++++++++++------
src/styles/slider.scss | 29 +--
src/styles/tabs.scss | 58 ++++--
src/styles/toggle.scss | 4 +-
src/styles/type.scss | 46 +++--
src/styles/welcome.scss | 36 ++--
src/webview/screenshare.js | 16 +-
36 files changed, 962 insertions(+), 563 deletions(-)
(limited to 'src/features/workspaces/components/WorkspaceDrawerItem.js')
diff --git a/.eslintrc b/.eslintrc
index c74b43cf5..3aae0e438 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -119,6 +119,7 @@
// eslint-plugin-react
"react/forbid-prop-types": 1,
"react/destructuring-assignment": 0,
+ "react/jsx-curly-newline": 0,
"react/jsx-filename-extension": 1,
"react/jsx-no-bind": 1,
"react/jsx-props-no-spreading": 0,
diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx
index c08c4e97d..0aef04a6c 100644
--- a/packages/forms/src/button/index.tsx
+++ b/packages/forms/src/button/index.tsx
@@ -35,13 +35,21 @@ interface IProps extends IFormField, IWithStyle {
target?: string;
}
+let buttonTransition: string = 'none';
+let loaderContainerTransition: string = 'none';
+
+if (window.matchMedia('(prefers-reduced-motion: no-preference)')) {
+ buttonTransition = 'background .5s, opacity 0.3s';
+ loaderContainerTransition = 'all 0.3s';
+}
+
const styles = (theme: Theme) => ({
button: {
borderRadius: theme.borderRadiusSmall,
border: 'none',
display: 'inline-flex',
position: 'relative' as Property.Position,
- transition: 'background .5s, opacity 0.3s',
+ transition: buttonTransition,
textAlign: 'center' as Property.TextAlign,
outline: 'none',
alignItems: 'center',
@@ -50,7 +58,6 @@ const styles = (theme: Theme) => ({
(props.stretch ? '100%' : 'auto') as Property.Width,
fontSize: theme.uiFontSize,
textDecoration: 'none',
- // height: theme.buttonHeight,
'&:hover': {
opacity: 0.8,
@@ -129,7 +136,7 @@ const styles = (theme: Theme) => ({
width: (props: IProps): string => (!props.busy ? '0' : '40px'),
height: 20,
overflow: 'hidden',
- transition: 'all 0.3s',
+ transition: loaderContainerTransition,
marginLeft: (props: IProps): number => (!props.busy ? 10 : 20),
marginRight: (props: IProps): number => (!props.busy ? -10 : -20),
position: (props: IProps): Property.Position =>
diff --git a/packages/forms/src/select/index.tsx b/packages/forms/src/select/index.tsx
index 4a5775579..ef3e70ddb 100644
--- a/packages/forms/src/select/index.tsx
+++ b/packages/forms/src/select/index.tsx
@@ -46,6 +46,14 @@ interface IState {
options: IOptions;
}
+let popupTransition: string = 'none';
+let toggleTransition: string = 'none';
+
+if (window.matchMedia('(prefers-reduced-motion: no-preference)')) {
+ popupTransition = 'all 0.3s';
+ toggleTransition = 'transform 0.3s';
+}
+
const styles = (theme: Theme) => ({
select: {
background: theme.selectBackground,
@@ -70,7 +78,7 @@ const styles = (theme: Theme) => ({
overflowX: 'scroll',
border: theme.selectBorder,
borderTop: 0,
- transition: 'all 0.3s',
+ transition: popupTransition,
},
open: {
opacity: 1,
@@ -98,7 +106,7 @@ const styles = (theme: Theme) => ({
toggle: {
marginLeft: 'auto',
fill: theme.selectToggleColor,
- transition: 'transform 0.3s',
+ transition: toggleTransition,
},
toggleOpened: {
transform: 'rotateZ(90deg)',
diff --git a/packages/forms/src/toggle/index.tsx b/packages/forms/src/toggle/index.tsx
index a9970c8f1..e525d2906 100644
--- a/packages/forms/src/toggle/index.tsx
+++ b/packages/forms/src/toggle/index.tsx
@@ -17,6 +17,12 @@ interface IProps
className?: string;
}
+let buttonTransition: string = 'none';
+
+if (window.matchMedia('(prefers-reduced-motion: no-preference)')) {
+ buttonTransition = 'all .5s';
+}
+
const styles = (theme: Theme) => ({
toggle: {
background: theme.toggleBackground,
@@ -34,7 +40,7 @@ const styles = (theme: Theme) => ({
left: 1,
top: 1,
position: 'absolute' as Property.Position,
- transition: 'all .5s',
+ transition: buttonTransition,
},
buttonActive: {
background: theme.toggleButtonActive,
diff --git a/packages/ui/src/infobox/index.tsx b/packages/ui/src/infobox/index.tsx
index 961262001..a6e4b3240 100644
--- a/packages/ui/src/infobox/index.tsx
+++ b/packages/ui/src/infobox/index.tsx
@@ -44,6 +44,14 @@ const buttonStyles = (theme: Theme) => {
return styles;
};
+let infoBoxTransition: string = 'none';
+let ctaTransition: string = 'none';
+
+if (window.matchMedia('(prefers-reduced-motion: no-preference)')) {
+ infoBoxTransition = 'all 0.5s';
+ ctaTransition = 'opacity 0.3s';
+}
+
const styles = (theme: Theme) => ({
wrapper: {
position: 'relative',
@@ -58,7 +66,7 @@ const styles = (theme: Theme) => ({
height: 'auto',
padding: '15px 20px',
top: 0,
- transition: 'all 0.5s',
+ transition: infoBoxTransition,
opacity: 1,
},
dismissing: {
@@ -91,7 +99,7 @@ const styles = (theme: Theme) => ({
marginLeft: 15,
padding: [4, 10],
fontSize: theme.uiFontSize,
- transition: 'opacity 0.3s',
+ transition: ctaTransition,
'&:hover': {
opacity: 0.6,
diff --git a/src/components/auth/SetupAssistant.js b/src/components/auth/SetupAssistant.js
index bd9069eb7..06ab09892 100644
--- a/src/components/auth/SetupAssistant.js
+++ b/src/components/auth/SetupAssistant.js
@@ -18,15 +18,16 @@ const SLACK_ID = 'slack';
const messages = defineMessages({
headline: {
id: 'setupAssistant.headline',
- defaultMessage: '!!!Let\'s get started',
+ defaultMessage: "!!!Let's get started",
},
subHeadline: {
id: 'setupAssistant.subheadline',
- defaultMessage: '!!!Choose from our most used services and get back on top of your messaging now.',
+ defaultMessage:
+ '!!!Choose from our most used services and get back on top of your messaging now.',
},
submitButtonLabel: {
id: 'setupAssistant.submit.label',
- defaultMessage: '!!!Let\'s go',
+ defaultMessage: "!!!Let's go",
},
inviteSuccessInfo: {
id: 'invite.successInfo',
@@ -34,14 +35,19 @@ const messages = defineMessages({
},
});
-const styles = (theme) => ({
+let transition = 'none';
+
+if (window.matchMedia('(prefers-reduced-motion: no-preference)')) {
+ transition = 'all 0.25s';
+}
+
+const styles = theme => ({
root: {
width: '500px !important',
textAlign: 'center',
padding: 20,
- '& h1': {
- },
+ '& h1': {},
},
servicesGrid: {
display: 'flex',
@@ -60,7 +66,7 @@ const styles = (theme) => ({
borderRadius: theme.borderRadius,
marginBottom: 10,
opacity: 0.5,
- transition: 'all 0.25s',
+ transition,
border: [3, 'solid', 'transparent'],
'& h2': {
@@ -70,10 +76,8 @@ const styles = (theme) => ({
'&:hover': {
border: [3, 'solid', theme.brandPrimary],
- '& $serviceIcon': {
- },
+ '& $serviceIcon': {},
},
-
},
selected: {
border: [3, 'solid', theme.brandPrimary],
@@ -82,7 +86,7 @@ const styles = (theme) => ({
},
serviceIcon: {
width: 50,
- transition: 'all 0.25s',
+ transition,
},
slackModalContent: {
@@ -125,7 +129,8 @@ const styles = (theme) => ({
},
});
-@injectSheet(styles) @observer
+@injectSheet(styles)
+@observer
class SetupAssistant extends Component {
static propTypes = {
classes: PropTypes.object.isRequired,
@@ -144,13 +149,17 @@ class SetupAssistant extends Component {
};
state = {
- services: [{
- id: 'whatsapp',
- }, {
- id: 'messenger',
- }, {
- id: 'gmail',
- }],
+ services: [
+ {
+ id: 'whatsapp',
+ },
+ {
+ id: 'messenger',
+ },
+ {
+ id: 'gmail',
+ },
+ ],
isSlackModalOpen: false,
slackWorkspace: '',
};
@@ -158,10 +167,12 @@ class SetupAssistant extends Component {
slackWorkspaceHandler() {
const { slackWorkspace = '', services } = this.state;
- const sanitizedWorkspace = slackWorkspace.trim().replace(/^https?:\/\//, '');
+ const sanitizedWorkspace = slackWorkspace
+ .trim()
+ .replace(/^https?:\/\//, '');
if (sanitizedWorkspace) {
- const index = services.findIndex((s) => s.id === SLACK_ID);
+ const index = services.findIndex(s => s.id === SLACK_ID);
if (index === -1) {
const newServices = services;
@@ -179,9 +190,17 @@ class SetupAssistant extends Component {
render() {
const { intl } = this.context;
const {
- classes, isInviteSuccessful, onSubmit, services, isSettingUpServices,
+ classes,
+ isInviteSuccessful,
+ onSubmit,
+ services,
+ isSettingUpServices,
} = this.props;
- const { isSlackModalOpen, slackWorkspace, services: addedServices } = this.state;
+ const {
+ isSlackModalOpen,
+ slackWorkspace,
+ services: addedServices,
+ } = this.state;
return (
@@ -197,29 +216,22 @@ class SetupAssistant extends Component {
)}
-
-
- {intl.formatMessage(messages.headline)}
-
-
- {intl.formatMessage(messages.subHeadline)}
-
+
+
{intl.formatMessage(messages.headline)}
+
{intl.formatMessage(messages.subHeadline)}
- {Object.keys(services).map((id) => {
+ {Object.keys(services).map(id => {
const service = services[id];
return (