-
Notifications
You must be signed in to change notification settings - Fork 0
Zain/implement highlight UI v2 #42
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
base: main
Are you sure you want to change the base?
Conversation
MrPeterss
left a comment
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.
Nice work zain, just a couple of comments!
| } | ||
| } | ||
|
|
||
| var sport: Sport{ |
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.
can we add a space between the "t" and "{"
| } | ||
|
|
||
| var sport: Sport{ | ||
| switch self{ |
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.
same here space before the "{"
| } | ||
| } | ||
| } | ||
| } |
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 like both of the approaches with the complations and the async/await
| .resizable() | ||
| .frame(width: 9.87, height: 18.57) | ||
| } | ||
| Spacer() |
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.
space above
|
|
||
| struct NoHighlightView: View { | ||
| var body: some View { | ||
| VStack { |
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.
keep the spaces between the vstack children
| ) | ||
| } | ||
|
|
||
|
|
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.
there is an extra space
| .onChange(of: viewModel.selectedSport) { _, _ in | ||
| viewModel.filter() | ||
| } | ||
|
|
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.
extra space above
| NavigationLink(destination: | ||
| DetailedHighlightsView(title: title, highlightScope: scope) | ||
| .environmentObject(viewModel)) | ||
| { |
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.
either put the "{" above on line 92 or move one of the closing ")" on line 93
angelinaa-chen
left a comment
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.
Nice PR Zain! A couple comments, and maybe let's wait until back-end pushes their changes to test the sportsType filtering before merging. Otherwise, looks amazing :) great work!!
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.
Small nit: HighlightStar is misspelled (missing the t)
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "kid_star (1).png", |
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.
The filename and the name of the actual image file differ -- could we have them uniform just in case?
| @@ -0,0 +1,187 @@ | |||
| // | |||
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.
| .fontWeight(.bold) | ||
| .foregroundColor(Constants.Colors.white) | ||
| .underline() | ||
| // Text(article.source) |
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.
If this comment isn't needed anymore, could we go ahead and delete it? If not I think adding a comment as to what it might be used for in the future might be nice!
| init(from gqlArticle: ArticlesQuery.Data.Article) { | ||
| self.id = gqlArticle.id ?? UUID().uuidString | ||
| self.image = gqlArticle.image ?? "" | ||
| self.title = gqlArticle.title |
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.
Not sure if this will ever happen, but could we also put a fallback value for the title and url since the Article properties aren't optionals? An empty string would work as a default

Added
HighlightsViewModelwith loading, filtering, and clean separation of highlights into structured lists for the views.Added
NoHighlightViewImplemented networking for fetching articles and YouTube videos.
(This looks like a big PR, but the lines of code mostly come from
HighlightsViewModel, which copies a lot of its structure from already existingGamesViewModelandPastGameViewModelNetworking:
I originally implemented both fetches using separate completion handlers, but since both are always needed, I switched to an async/await setup and grouped the calls.
This is my first time using async/await in Swift, so I’d appreciate extra attention on that part to make sure the approach is correct and safe.
Next Steps:
Logic:
Style
Other