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

Team and Event Info #967

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class EventInfoViewController: TBATableViewController, Observable {
return cell
case .twitter:
let cell = self.tableView(tableView, detailCellForRowAtIndexPath: indexPath)
cell.textLabel?.text = "View #\(self.event.key) on Twitter"
cell.textLabel?.text = "View \(self.event.key) on Twitter"
return cell
case .youtube:
let cell = self.tableView(tableView, detailCellForRowAtIndexPath: indexPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ private enum TeamInfoSection: Int {

private enum TeamInfoItem {
case location
case rookieYear
case sponsors
case website
case twitter
Expand Down Expand Up @@ -75,6 +76,8 @@ class TeamInfoViewController: TBATableViewController, Observable {
switch item {
case .location:
return self.tableView(tableView, locationCellForRowAt: indexPath)
case .rookieYear:
return self.tableView(tableView, rookieYearCellForRowAt: indexPath)
case .sponsors:
return self.tableView(tableView, sponsorCellForRowAt: indexPath)
case .website:
Expand All @@ -83,7 +86,7 @@ class TeamInfoViewController: TBATableViewController, Observable {
return cell
case .twitter:
let cell = self.tableView(tableView, linkCellForRowAt: indexPath)
cell.textLabel?.text = "View #\(self.team.key) on Twitter"
cell.textLabel?.text = "View \(self.team.key) on Twitter"
return cell
case .youtube:
let cell = self.tableView(tableView, linkCellForRowAt: indexPath)
Expand All @@ -108,7 +111,9 @@ class TeamInfoViewController: TBATableViewController, Observable {
infoItems.append(.location)
}
if team.name != nil {
infoItems.append(.rookieYear)
infoItems.append(.sponsors)

Copy link
Member

Choose a reason for hiding this comment

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

nit: newline

}

if !infoItems.isEmpty {
Expand Down Expand Up @@ -146,6 +151,18 @@ class TeamInfoViewController: TBATableViewController, Observable {

return cell
}

private func tableView(_ tableView: UITableView, rookieYearCellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(indexPath: indexPath) as ReverseSubtitleTableViewCell

cell.titleLabel?.text = "Rookie Year"
cell.subtitleLabel?.text = String(team.rookieYear!)

cell.accessoryType = .none
cell.selectionStyle = .none

return cell
}

private func tableView(_ tableView: UITableView, sponsorCellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(indexPath: indexPath) as BasicTableViewCell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct InfoCellViewModel {

init(event: Event) {
nameString = event.name ?? event.key
subtitleStrings = [event.locationString, event.dateString].compactMap({ $0 })
subtitleStrings = [event.locationString, event.dateString, event.weekString].compactMap({ $0 })
}

init(team: Team) {
Expand Down
Loading