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

Notifications Button #301

Merged
merged 3 commits into from
Dec 4, 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
12 changes: 11 additions & 1 deletion components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
// const showMenuDropdown = useRef(false);
const [showMenuDropdown, setShowMenuDropdown] = useState(false);
const dropdownRef = useRef(null);
const router = useRouter();

Check warning on line 76 in components/Header.tsx

View workflow job for this annotation

GitHub Actions / lint

'router' is assigned a value but never used

const [userLoggedOut, setUserLoggedOut] = useState(false);

Expand All @@ -95,6 +95,12 @@
setShowModal(true);
};

const NotificationsButton = (): ReactElement => (
<Link href="/subscriptions">
<a className="notificationsButton">Notifications</a>
</Link>
);

const DropDownMenu = useMemo(() => {
const toggleMenuDropdown = (): void => {
setShowMenuDropdown(!showMenuDropdown);
Expand Down Expand Up @@ -155,7 +161,10 @@
return (
<>
{userInfo && !userLoggedOut ? (
<DropDownMenu />
<div className="header-items">
<NotificationsButton />
<DropDownMenu />
</div>
) : (
<>
<NotifSignUpButton onNotifSignUp={onNotifSignUp} />
Expand Down Expand Up @@ -264,6 +273,7 @@
buttonColor={campusToColor[campus]}
/>
</div>

<DropdownMenuWrapper
onSignIn={onSignIn}
onSignOut={onSignOut}
Expand Down
31 changes: 27 additions & 4 deletions styles/pages/_Results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ $SIDEBAR_WIDTH: 268px;
}

.Results_SignIn {
margin: 0 17px 0 30px;
margin-left: auto;
margin: 0 17px 0 5px;
padding: 12px 16px;
background: Colors.$NEU_Red;
color: Colors.$White;
Expand All @@ -51,6 +50,24 @@ $SIDEBAR_WIDTH: 268px;
white-space: nowrap;
}

.notificationsButton {
margin-left: auto;
font-size: 16px;
color: Colors.$NEU9;
text-decoration: none;
margin-right: 16px;
margin-bottom: 6px;
padding: 0;
border: none;
background: none;
cursor: pointer;
font-weight: 500;
}

.notificationsButton:hover {
color: inherit;
}

.disabledButton {
opacity: 0.5;
cursor: not-allowed;
Expand Down Expand Up @@ -221,13 +238,19 @@ $SIDEBAR_WIDTH: 268px;
float: right;
}

.header-items {
display: flex;
align-items: center;
justify-content: flex-end;
margin-left: auto;
}

.user-menu {
display: flex;
flex: 1;
text-align: right;
margin: 0 17px 0 30px;
margin: 0 17px 0 4px;
position: relative;
justify-content: flex-end;

&__button {
display: flex;
Expand Down
Loading