Skip to content

Commit

Permalink
Quick UI Fixes (#580)
Browse files Browse the repository at this point in the history
* fixed home button touch issue, increased space between table view and schedule seg control

* Update User.swift

* Update Attendee.swift

Make email required
  • Loading branch information
s0phialiu authored Feb 21, 2024
1 parent 737821d commit 07ccc47
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion HIAPI/Models/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation

public struct User: Codable, APIReturnable {
public let userId: String
public let email: String
public let email: String? // Email should be an optional field because not every GH account has their email set to public
}

public struct RolesContainer: Codable, APIReturnable {
Expand Down
4 changes: 2 additions & 2 deletions HackIllinois.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2024.2.0;
MARKETING_VERSION = 2024.2.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" -Xfrontend -warn-long-expression-type-checking=150";
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios;
Expand Down Expand Up @@ -1407,7 +1407,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2024.2.0;
MARKETING_VERSION = 2024.2.1;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion HackIllinois/FlowControllers/HILoginFlowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private extension HILoginFlowController {
let (apiUser, _) = try result.get()
var user = user
user.userId = apiUser.userId
user.email = apiUser.email
user.email = apiUser.email ?? ""
self?.populateRoleData(buildingUser: user, profile: profile, sender: sender)
} catch {
self?.presentAuthenticationFailure(withError: error, sender: sender)
Expand Down
11 changes: 5 additions & 6 deletions HackIllinois/ViewControllers/HIHomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class HIHomeViewController: HIEventListViewController {
(HITimeDataSource.shared.eventTimes.checkInStart, "HACKILLINOIS BEGINS IN"),
(HITimeDataSource.shared.eventTimes.hackStart, "HACKING BEGINS IN"),
(HITimeDataSource.shared.eventTimes.hackEnd, "HACKING ENDS IN"),
(HITimeDataSource.shared.eventTimes.eventEnd, "QUEST COMPLETE")
(HITimeDataSource.shared.eventTimes.eventEnd, "HACKILLINOIS ENDS IN")
]

var transparentImageView: UIImageView!
Expand Down Expand Up @@ -89,16 +89,15 @@ extension HIHomeViewController {
view.addSubview(legendButton)
legendButton.isUserInteractionEnabled = true

let buttonSize: CGFloat = UIDevice.current.userInterfaceIdiom != .pad ? 30 : 50
let padding: CGFloat = UIDevice.current.userInterfaceIdiom != .pad ? 16 : 50
let buttonSize: CGFloat = UIDevice.current.userInterfaceIdiom != .pad ? 35 : 50
let padding: CGFloat = UIDevice.current.userInterfaceIdiom != .pad ? 16 : 80

legendButton.constrain(width: buttonSize, height: buttonSize)
legendButton.translatesAutoresizingMaskIntoConstraints = false

view.bringSubviewToFront(legendButton)
// Increase the hit target area by adding padding
legendButton.topAnchor.constraint(equalTo: bannerFrameView.topAnchor, constant: (UIDevice.current.userInterfaceIdiom == .pad) ? 0 : -10).isActive = true
legendButton.topAnchor.constraint(equalTo: countdownFrameView.topAnchor, constant: (UIDevice.current.userInterfaceIdiom == .pad) ? 0 : 15).isActive = true
legendButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -padding).isActive = true

legendButton.addTarget(self, action: #selector(didSelectLegendButton(_:)), for: .touchUpInside)
}

Expand Down
6 changes: 3 additions & 3 deletions HackIllinois/ViewControllers/HIScheduleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ extension HIScheduleViewController {
segmentedControlConstant = 40.0
}

segmentedControl.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 20 + segmentedControlConstant).isActive = true
segmentedControl.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 15 + segmentedControlConstant).isActive = true
segmentedControl.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: -36).isActive = true
segmentedControl.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: 40).isActive = true
segmentedControl.heightAnchor.constraint(equalToConstant: 66 + segmentedControlConstant).isActive = true
Expand All @@ -172,7 +172,7 @@ extension HIScheduleViewController {
let tableView = HITableView()
view.addSubview(tableView)
let padConstant = (UIDevice.current.userInterfaceIdiom == .pad) ? 4.0 : 1
tableView.topAnchor.constraint(equalTo: segmentedControl.bottomAnchor, constant: 30 * padConstant).isActive = true
tableView.topAnchor.constraint(equalTo: segmentedControl.bottomAnchor, constant: 40 * padConstant).isActive = true
tableView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor).isActive = true
tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
tableView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor).isActive = true
Expand Down Expand Up @@ -387,7 +387,7 @@ extension HIScheduleViewController {
descriptionLabel.leadingAnchor.constraint(equalTo: locationImageView.leadingAnchor).isActive = true
descriptionLabel.bottomAnchor.constraint(equalTo: locationImageView.bottomAnchor, constant: UIScreen.main.bounds.width > 850 ? 50 : ((UIDevice.current.userInterfaceIdiom == .pad) ? 40 : 25.0)).isActive = true
descriptionLabel.constrain(width: containerViewWidth - 40)
padding += UIScreen.main.bounds.width > 850 ? 300 : ((UIDevice.current.userInterfaceIdiom == .pad) ? 200 : 140.0)
padding += UIScreen.main.bounds.width > 850 ? 300 : ((UIDevice.current.userInterfaceIdiom == .pad) ? 210 : 140.0)
}
}
@objc func containerViewTapped(_ sender: UITapGestureRecognizer) {
Expand Down

0 comments on commit 07ccc47

Please sign in to comment.