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

Quick UI Fixes #580

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 1 addition & 1 deletion HIAPI/Models/Attendee.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct Attendee: Codable, APIReturnable {
public let id: String
public let firstName: String?
public let lastName: 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically this email should be required since Attendees provide these at Registration

public let graduationYear: Int
public let school: String
public let major: String
Expand Down
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
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the one that should be optional, yes!

}

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
Loading