From 99ca310c73024b51fed1f3077375eed7827f2c20 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 28 May 2023 13:48:21 +0530 Subject: Fix issues reported by sonarqube linter --- src/components/layout/AppLayout.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/components/layout') diff --git a/src/components/layout/AppLayout.tsx b/src/components/layout/AppLayout.tsx index 86b4e787e..97795212a 100644 --- a/src/components/layout/AppLayout.tsx +++ b/src/components/layout/AppLayout.tsx @@ -14,7 +14,6 @@ import { Component as PublishDebugInfo } from '../../features/publishDebugInfo'; import ErrorBoundary from '../util/ErrorBoundary'; import { updateVersionParse } from '../../helpers/update-helpers'; -// import globalMessages from '../../i18n/globalMessages'; import { isMac, isWindows } from '../../environment'; import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; import { workspaceStore } from '../../features/workspaces'; @@ -45,13 +44,11 @@ const messages = defineMessages({ }, }); -let transition = 'none'; +const transition = window?.matchMedia('(prefers-reduced-motion: no-preference)') + ? 'transform 0.5s ease' + : 'none'; -if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { - transition = 'transform 0.5s ease'; -} - -const styles = theme => ({ +const styles = (theme: { workspaces: { drawer: { width: any } } }) => ({ appContent: { // width: `calc(100% + ${theme.workspaces.drawer.width}px)`, width: '100%', -- cgit v1.2.3-70-g09d2