Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix / Reintroduce profile menu styling #527

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions packages/ui-react/src/components/UserMenu/UserMenu.module.scss
Original file line number Diff line number Diff line change
@@ -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;
}
Expand All @@ -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);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
exports[`<UserMenu> > renders and matches snapshot 1`] = `
<div>
<h2
class="_sectionHeader_e947a3"
class="_sectionHeader_457528"
>
nav.settings
</h2>
<ul
class="_menuItems_e947a3"
class="_menuItems_457528"
>
<li>
<a
Expand Down Expand Up @@ -61,7 +61,7 @@ exports[`<UserMenu> > renders and matches snapshot 1`] = `
</a>
</li>
<li
class="_divider_e947a3"
class="_divider_457528"
>
<div
class="_menuButton_91706b"
Expand Down
Loading