diff --git a/src/components/ActionBar/DarkModeDropdown.js b/src/components/ActionBar/DarkModeDropdown.js index cb219cbe5..d2d5fae18 100644 --- a/src/components/ActionBar/DarkModeDropdown.js +++ b/src/components/ActionBar/DarkModeDropdown.js @@ -5,11 +5,8 @@ import IconButton from '@leafygreen-ui/icon-button'; import { Menu, MenuItem } from '@leafygreen-ui/menu'; import { DarkModeContext } from '../../context/dark-mode-context'; import { theme } from '../../theme/docsTheme'; -import IconDarkmode from '../icons/DarkMode'; -import useScreenSize from '../../hooks/useScreenSize'; -import useSnootyMetadata from '../../utils/use-snooty-metadata'; import { reportAnalytics } from '../../utils/report-analytics'; -import { DEPRECATED_PROJECTS } from './ActionBar'; +import IconDarkmode from '../icons/DarkMode'; const iconStyling = css` display: block; @@ -33,7 +30,6 @@ const darkModeSvgStyle = { }; const DarkModeDropdown = () => { - const metadata = useSnootyMetadata(); const dropdownRef = useRef(); // not using dark mode from LG/provider here to account for case of 'system' dark theme @@ -52,16 +48,20 @@ const DarkModeDropdown = () => { [setDarkModePref, setOpen] ); - const { isTabletOrMobile } = useScreenSize(); - const justify = isTabletOrMobile || DEPRECATED_PROJECTS.includes(metadata.project) ? 'start' : 'end'; - return ( -
+
{ diff --git a/tests/unit/__snapshots__/DarkModeDropdown.test.js.snap b/tests/unit/__snapshots__/DarkModeDropdown.test.js.snap index 828578430..3e8c23d57 100644 --- a/tests/unit/__snapshots__/DarkModeDropdown.test.js.snap +++ b/tests/unit/__snapshots__/DarkModeDropdown.test.js.snap @@ -3,6 +3,10 @@ exports[`DarkMode Dropdown component renders dark mode dropdown 1`] = ` .emotion-0 { + position: relative; +} + +.emotion-1 { border: none; -webkit-appearance: unset; padding: unset; @@ -27,7 +31,7 @@ exports[`DarkMode Dropdown component renders dark mode dropdown 1`] = ` cursor: pointer; } -.emotion-0:before { +.emotion-1:before { content: ''; -webkit-transition: 150ms all ease-in-out; transition: 150ms all ease-in-out; @@ -43,43 +47,43 @@ exports[`DarkMode Dropdown component renders dark mode dropdown 1`] = ` transform: scale(0.8); } -.emotion-0:active:before, -.emotion-0:hover:before, -.emotion-0:focus:before { +.emotion-1:active:before, +.emotion-1:hover:before, +.emotion-1:focus:before { -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); transform: scale(1); } -.emotion-0:focus { +.emotion-1:focus { outline: none; } -.emotion-0:active, -.emotion-0:hover { +.emotion-1:active, +.emotion-1:hover { color: #001E2B; } -.emotion-0:active:before, -.emotion-0:hover:before { +.emotion-1:active:before, +.emotion-1:hover:before { background-color: rgba(61,79,88,0.1); } -.emotion-0:focus-visible { +.emotion-1:focus-visible { color: #001E2B; box-shadow: 0 0 0 2px #FFFFFF,0 0 0 4px #0498EC; } -.emotion-0:focus-visible:before { +.emotion-1:focus-visible:before { background-color: rgba(61,79,88,0.1); } -.emotion-0>div { +.emotion-1>div { position: relative; } -.emotion-1 { +.emotion-2 { position: absolute; top: 0; bottom: 0; @@ -99,18 +103,20 @@ exports[`DarkMode Dropdown component renders dark mode dropdown 1`] = ` justify-content: center; } -
+