From 8c6d4c03913481e03f0fa1489634d422e6a0109b Mon Sep 17 00:00:00 2001 From: 0XYoussefX0 Date: Tue, 2 Apr 2024 20:07:27 +0000 Subject: [PATCH] add margin to onboardingchecklist when there is no scrollbar --- .../OnboardingChecklist.module.scss | 10 +++++++++ .../Onboarding/OnboardingChecklist/index.tsx | 21 +++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/components/Onboarding/OnboardingChecklist/OnboardingChecklist.module.scss b/src/components/Onboarding/OnboardingChecklist/OnboardingChecklist.module.scss index 1496750563f..1a814ac52ff 100644 --- a/src/components/Onboarding/OnboardingChecklist/OnboardingChecklist.module.scss +++ b/src/components/Onboarding/OnboardingChecklist/OnboardingChecklist.module.scss @@ -1,5 +1,15 @@ @use "src/styles/breakpoints"; +body[data-scroll-locked] { + .checklistPosition { + margin-right: var(--scrollbar-width); + } +} + +.marginRight { + margin-right: var(--scrollbar-width); +} + .checklistPosition { position: fixed; inset-block-end: var(--spacing-medium); diff --git a/src/components/Onboarding/OnboardingChecklist/index.tsx b/src/components/Onboarding/OnboardingChecklist/index.tsx index 42ffcee89b0..41902df69d6 100644 --- a/src/components/Onboarding/OnboardingChecklist/index.tsx +++ b/src/components/Onboarding/OnboardingChecklist/index.tsx @@ -2,7 +2,7 @@ import classNames from 'classnames'; import { useRouter } from 'next/router'; import Trans from 'next-translate/Trans'; import useTranslation from 'next-translate/useTranslation'; -import { useDispatch, useSelector } from 'react-redux'; +import { useDispatch, useSelector, shallowEqual } from 'react-redux'; import OnboardingProgress from '../OnboardingProgress'; import { onboardingChecklist } from '../steps'; @@ -16,6 +16,7 @@ import usePersistPreferenceGroup from '@/hooks/auth/usePersistPreferenceGroup'; import CheckIcon from '@/icons/check.svg'; import IconClose from '@/icons/close.svg'; import IconQuestionMark from '@/icons/question-mark-icon.svg'; +import { selectNavbar } from '@/redux/slices/navbar'; import { dismissChecklist, selectOnboarding, @@ -42,6 +43,11 @@ const OnboardingChecklist = () => { const { isChecklistVisible, checklistDismissals, completedGroups } = useSelector(selectOnboarding); + const { isSearchDrawerOpen, isNavigationDrawerOpen, isSettingsDrawerOpen } = useSelector( + selectNavbar, + shallowEqual, + ); + const readingPreferences = useSelector(selectReadingPreferences); const { readingPreference } = readingPreferences; const { @@ -70,7 +76,10 @@ const OnboardingChecklist = () => { return (