-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ap/no notifications husky page #265
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
onClick={() => { | ||
router.push('NEU'); | ||
}} | ||
onMouseEnter={() => setIsHovering(true)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To change image upon hovering, am setting isHovering constant to true when mouse enters the Button and to false when mouse leaves the button.
|
||
export const EmptyCard = (): ReactElement => { | ||
const router = useRouter(); | ||
const [isHovering, setIsHovering] = useState(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added const isHovering so that Husky image can be changed when mouse hovers over the "search for classes" button
@@ -131,6 +135,10 @@ export default function SubscriptionsPage(): ReactElement { | |||
await fetchSectionNotifs(); | |||
setClasses(classMapping); | |||
setIsFetching(false); | |||
// are there classes the user is subscribed to? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding condition for when to display the No Notifications page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, main thing is the changes to ClassCardWrapper. I think we shouldn't need to touch that file at all, since it's only supposed to wrap actual class cards. The EmptyCard should serve as its own component, and not really need to rely on that.
<div className="SearchResult__header--left">{headerLeft}</div> | ||
{headerRight} | ||
</div> | ||
<div>{headerLeft}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we needed the styles from SearchResult__header and SearchResult__header--left for the class cards. Did your changes actually need to change this file?
|
||
return ( | ||
<> | ||
<div className="Results_Container"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need all these extra styles, and it would be better to make a separate style sheet for EmptyCards.
padding-bottom: 0px; | ||
} | ||
|
||
.SearchResult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move these out into a separate _EmptyCard.scss so we don't put too much into this file.
…ieval of Term name.
Properly migrate styles to new _EmptyCard file
Styles have been moved to new EmptyStyles, Empty Card automatically updates to show current semester. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks pretty good, just some comments on code consistency and readability for the rest of the codebase
@@ -13,18 +13,17 @@ type ClassCardWrapperType = { | |||
afterBody?: ReactElement; | |||
}; | |||
|
|||
const ClassCardWrapper = ({ | |||
export const ClassCardWrapper = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's match the rest of the codebase here and use function
definitions rather than arrow notations. It seems to be like a 70 / 30 split on what we do, but we should pick one to stick with, and I'll just go with the majority
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in recent commit
package.json
Outdated
@@ -43,6 +43,7 @@ | |||
"js-yaml-loader": "^1.2.2", | |||
"jsonwebtoken": "^8.5.1", | |||
"jwt-decode": "^3.1.2", | |||
"leading-trim": "^1.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see evidence that adding a package is the correct call here. It's fine if we actually need it, but I would like that proof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in recent commit
@@ -133,6 +137,10 @@ export default function SubscriptionsPage(): ReactElement { | |||
await fetchSectionNotifs(); | |||
setClasses(classMapping); | |||
setIsFetching(false); | |||
// are there classes the user is subscribed to? | |||
if (classMapping.size > 0) { | |||
setIsSubscribed(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is a state variable being reassigned to another state variable? I would just use classMapping.size > 0
instead of managing a derived piece of state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will address this in a future ticket
pages/subscriptions.tsx
Outdated
@@ -158,25 +166,33 @@ export default function SubscriptionsPage(): ReactElement { | |||
{isFetching ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the ternary, especially nested ones. Would an early return be better? This is really not that important but just thinking from a readability standpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will address this in a future ticket
- fix styles in classcard, use function notation - Redirect Empty card to empty results page.
…andboxnu/searchneu into AP/no-notifications-husky-page
This reverts commit 0dad192.
Purpose
Creates an EmptyCard to display for the Empty Notifications page.
When "Search for classes" button is hovered over, crying-husky image changes to happy-husky image.
Includes a placeholder text for "Spring 2023 Notifications", this will need to be changed to actually reflect the semester of notifications being displayed.
Tickets
https://trello.com/c/SoJpDQFG
Contributors
@ananyaspatil @Anzhuo-W
Feature List
Created display for the Empty Notifications page.
When "Search for classes" button is hovered over, crying-husky image changes to happy-husky image.
Pictures
No Hover:
Hover:
Reviewers
Primary reviewer:
@pranavphadke1 @sebwittr
Secondary reviewers:
@soulwa