Skip to content

Conversation

@durualayli
Copy link

Very small changes:

  • Added basketball and hockey back to the available sports (uncommented)
    1. Also to the past scores part with basketball having a different number of periods thus columns for men and women
  • Hid the upcoming games section when there aren't any upcoming games, so the padding is fixed


// Both
// case Basketball
case Basketball
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we clean this up a bit? I think a cleaner approach would look closer to this:

enum Sport: String, Identifiable, CaseIterable, CustomStringConvertible {
var id: Self { self }

case all = "All"
case basketball = "Basketball"
case iceHockey = "Ice Hockey"
case lacrosse = "Lacrosse"
case soccer = "Soccer"
case fieldHockey = "Field Hockey"
case baseball = "Baseball"
case football = "Football"

}

case All

// Both
// case Basketball
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should remove the comments as well

case .Baseball: return game.timeUpdates.count > 3 ? game.timeUpdates.count - 2 : 10
// the last three columns are total runs, hits, and errors
// if backend stores null for scoreBreakdown, display regular score box with 10 columns
case .Basketball:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for comments for each sport, you should remove those. Additionally, you should be consistent about the indentation here. I think a good practice is doing it inline when you have singular value, and nesting it when you're performing computations. Additionally, swift has implicit returns for things like this, so your code would be a lot cleaner without the returns here!

Copy link

@Xhether Xhether left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small stying issues I addressed in the comments, but great work! I'll approve ASAP after you fix those

@durualayli
Copy link
Author

  • Deleted the unnecessary comments, but kept the type of sports comments to be able to use them after
  • Deleted the return statements where possible and wrote them inline

@durualayli durualayli requested a review from Xhether January 28, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HI-PRI] Re-add basketball and hockey Schedule page empty state ui bug

4 participants