diff --git a/packages/ui-react/src/components/UserMenu/UserMenu.module.scss b/packages/ui-react/src/components/UserMenu/UserMenu.module.scss index 096f619ca..24c78503d 100644 --- a/packages/ui-react/src/components/UserMenu/UserMenu.module.scss +++ b/packages/ui-react/src/components/UserMenu/UserMenu.module.scss @@ -1,6 +1,21 @@ @use '@jwp/ott-ui-react/src/styles/variables'; @use '@jwp/ott-ui-react/src/styles/theme'; +@mixin divider-before($marginY, $marginX, $background-opacity) { + position: relative; + margin-top: $marginY; + + &::before { + position: absolute; + top: calc(#{$marginY} * -0.5); + right: $marginX; + left: $marginX; + height: 1px; + background-color: rgba(variables.$white, $background-opacity); + content: ''; + } +} + .popover { top: 10px; } @@ -13,3 +28,37 @@ margin-right: calc(#{variables.$base-spacing} / 2); } } + +.menuItems { + width: auto; + margin: 0; + padding: 0; + list-style-type: none; + + > li > a { + padding: 0 18px; + font-size: 16px; + } +} + +.divider { + @include divider-before(variables.$base-spacing, 0, 0.12); + + &.small { + @include divider-before(variables.$base-spacing, variables.$base-spacing, 0.32); + } +} + +.sectionHeader { + width: 100%; + padding: 12px 0 12px 24px; + color: variables.$white; + font-weight: 700; + font-size: 12px; + text-transform: uppercase; + opacity: 0.7; + + .menuItems + & { + @include divider-before(variables.$base-spacing, variables.$base-spacing, 0.32); + } +} diff --git a/packages/ui-react/src/components/UserMenuNav/UserMenuNav.module.scss b/packages/ui-react/src/components/UserMenuNav/UserMenuNav.module.scss deleted file mode 100644 index 9c8daf45c..000000000 --- a/packages/ui-react/src/components/UserMenuNav/UserMenuNav.module.scss +++ /dev/null @@ -1,55 +0,0 @@ -@use '@jwp/ott-ui-react/src/styles/variables'; -@use '@jwp/ott-ui-react/src/styles/theme'; - -@mixin divider-before($marginY, $marginX, $background-opacity) { - position: relative; - margin-top: $marginY; - - &::before { - position: absolute; - top: calc(#{$marginY} * -0.5); - right: $marginX; - left: $marginX; - height: 1px; - background-color: rgba(variables.$white, $background-opacity); - content: ''; - } -} - -.menuItems { - width: auto; - margin: 0; - padding: 0; - list-style-type: none; - - > li > a { - padding: 0 18px; - font-size: 16px; - } -} - -.button { - margin-bottom: variables.$base-spacing; -} - -.divider { - @include divider-before(variables.$base-spacing, 0, 0.12); - - &.small { - @include divider-before(variables.$base-spacing, variables.$base-spacing, 0.32); - } -} - -.sectionHeader { - width: 100%; - padding: 12px 0 12px 24px; - color: variables.$white; - font-weight: 700; - font-size: 12px; - text-transform: uppercase; - opacity: 0.7; - - .menuItems + & { - @include divider-before(variables.$base-spacing, variables.$base-spacing, 0.32); - } -} diff --git a/packages/ui-react/src/components/UserMenuNav/UserMenuNav.tsx b/packages/ui-react/src/components/UserMenuNav/UserMenuNav.tsx index 57b7f85f8..962ff8298 100644 --- a/packages/ui-react/src/components/UserMenuNav/UserMenuNav.tsx +++ b/packages/ui-react/src/components/UserMenuNav/UserMenuNav.tsx @@ -12,12 +12,11 @@ import { userProfileURL } from '@jwp/ott-common/src/utils/urlFormatting'; import { PATH_USER_ACCOUNT, PATH_USER_FAVORITES, PATH_USER_PAYMENTS } from '@jwp/ott-common/src/paths'; import type { Profile } from '@jwp/ott-common/types/profiles'; +import styles from '../UserMenu/UserMenu.module.scss'; // TODO inherit styling import MenuButton from '../MenuButton/MenuButton'; import Icon from '../Icon/Icon'; import ProfileCircle from '../ProfileCircle/ProfileCircle'; -import styles from './UserMenuNav.module.scss'; - type Props = { small?: boolean; focusable: boolean; diff --git a/packages/ui-react/src/components/UserMenuNav/__snapshots__/UserMenuNav.test.tsx.snap b/packages/ui-react/src/components/UserMenuNav/__snapshots__/UserMenuNav.test.tsx.snap index f0a3fdc77..b971d187b 100644 --- a/packages/ui-react/src/components/UserMenuNav/__snapshots__/UserMenuNav.test.tsx.snap +++ b/packages/ui-react/src/components/UserMenuNav/__snapshots__/UserMenuNav.test.tsx.snap @@ -3,12 +3,12 @@ exports[` > renders and matches snapshot 1`] = `

nav.settings