Skip to content

Commit

Permalink
Merge pull request #125 from DeveloperAcademy-POSTECH/feat/designsyst…
Browse files Browse the repository at this point in the history
…em/ZES-167-apply-colors

[DesignSystem] 다크 모드 컬러 적용
  • Loading branch information
Chaeho-Min authored Dec 3, 2022
2 parents 5c9b61d + 208d02b commit 73fa55f
Show file tree
Hide file tree
Showing 73 changed files with 404 additions and 468 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x00",
"green" : "0x00",
"red" : "0x00"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
Expand Down
2 changes: 0 additions & 2 deletions Projects/App/Sources/Application/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
3 changes: 2 additions & 1 deletion Projects/App/Sources/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import Combine
import UIKit
import DesignSystem
import KakaoSDKAuth

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
Expand Down Expand Up @@ -35,7 +36,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
window.makeKeyAndVisible()

/// remove navigation back button text and change color
navigationController.navigationBar.tintColor = .black
navigationController.navigationBar.tintColor = .accent
navigationController.navigationBar.topItem?.title = ""
}

Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Sources/Global/Extension/NavigationBar+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension UINavigationBar {
appearance.configureWithOpaqueBackground()

// 네비게이션바 배경색
appearance.backgroundColor = .white
appearance.backgroundColor = .background

// 아래 회색 라인 없애기
appearance.shadowColor = .clear
Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Sources/Global/Extension/UITableView+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extension UITableView {
let messageLabel: UILabel = {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.text = message
$0.textColor = (type == .noresult) ? .zestyColor(.dim) : .label
$0.textColor = (type == .noresult) ? .dim : .label
$0.numberOfLines = 0
$0.textAlignment = .center
$0.font = .systemFont(ofSize: 17, weight: .medium)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ final class DomainSettingViewController: UIViewController {
emailTextField.becomeFirstResponder()
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

let savedTraitCollection = UITraitCollection.current

UITraitCollection.current = self.traitCollection
if !viewModel.isInputValid || viewModel.shouldDisplayWarning {
arrowButton.setBorderColor(UIColor.disabled.cgColor)
} else {
arrowButton.setBorderColor(UIColor.blackComponent.cgColor)
}

UITraitCollection.current = savedTraitCollection
}

// MARK: - Function

@objc func arrowButtonTapped() {
Expand Down Expand Up @@ -155,12 +170,12 @@ extension DomainSettingViewController {
extension DomainSettingViewController {

private func configureUI() {
view.backgroundColor = .white
view.backgroundColor = .background

self.navigationController?.navigationBar.tintColor = .black
self.navigationController?.navigationBar.tintColor = .accent
self.navigationController?.navigationBar.topItem?.title = ""

emailInputView.backgroundColor = .black
emailInputView.backgroundColor = .blackComponent
emailInputView.layer.cornerRadius = 25
emailInputView.layer.masksToBounds = true

Expand All @@ -170,20 +185,20 @@ extension DomainSettingViewController {
emailStackView.alignment = .fill

emailTextField.becomeFirstResponder()
emailTextField.attributedPlaceholder = .init(attributedString: NSAttributedString(string: "이메일", attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray]))
emailTextField.textColor = .white
emailTextField.attributedPlaceholder = .init(attributedString: NSAttributedString(string: "이메일", attributes: [NSAttributedString.Key.foregroundColor: UIColor.reverseSecondaryLabel]))
emailTextField.textColor = .reverseLabel
emailTextField.font = .systemFont(ofSize: 17, weight: .medium)
emailTextField.keyboardType = .emailAddress
emailTextField.autocapitalizationType = .none

domainPlaceholder.textColor = .white
domainPlaceholder.textColor = .reverseLabel
domainPlaceholder.text = "@\(viewModel.organization.domain)"
domainPlaceholder.font = .systemFont(ofSize: 17, weight: .medium)
domainPlaceholder.setContentCompressionResistancePriority(.init(1000), for: .horizontal)

arrowButton.addTarget(self, action: #selector(arrowButtonTapped), for: .touchUpInside)

emailDuplicatedLabel.textColor = .red
emailDuplicatedLabel.textColor = .point
emailDuplicatedLabel.text = "이미 사용된 이메일이에요."
emailDuplicatedLabel.font = .systemFont(ofSize: 13, weight: .regular)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ extension OrgDetailViewController {
extension OrgDetailViewController {

private func configureUI() {
view.backgroundColor = .zestyColor(.background)
view.backgroundColor = .background

orgDetailInformationView1 = OrgDetailInformationView()
orgDetailInformationView2 = OrgDetailInformationView()
orgDetailInformationView3 = OrgDetailInformationView()

orgNameLabel.text = UserInfoManager.userInfo?.userOrgName ?? "(인증대학없음)"
orgNameLabel.textColor = .black
orgNameLabel.textColor = .label
orgNameLabel.font = UIFont.systemFont(ofSize: CGFloat(26), weight: .bold)
orgNameLabel.textAlignment = .center
orgNameLabel.numberOfLines = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ final class OrgDetailInformationView: UIView {
extension OrgDetailInformationView {

private func configureUI() {
backgroundColor = .zestyColor(.background)
backgroundColor = .clear

informationLabel.textColor = .secondaryLabel
informationLabel.font = UIFont.systemFont(ofSize: CGFloat(13), weight: .regular)
informationLabel.textAlignment = .left
informationLabel.numberOfLines = 1

numberLabel.textColor = .black
numberLabel.textColor = .label
numberLabel.font = UIFont.systemFont(ofSize: CGFloat(17), weight: .medium)
numberLabel.textAlignment = .left
numberLabel.numberOfLines = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ extension OrganizationListCell {

private func configureUI() {
addSubviews([orgNameLabel, disclosureIndicator])
self.backgroundColor = .clear

selectionStyle = .none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ final class OrganizationListViewController: UIViewController {
bindUI()
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

let savedTraitCollection = UITraitCollection.current

UITraitCollection.current = self.traitCollection
searchingTextFieldView.setBorderColor(UIColor.blackComponent.cgColor)

UITraitCollection.current = savedTraitCollection
}

// MARK: Function

@objc func searchButtonTapped() {
Expand Down Expand Up @@ -132,7 +143,7 @@ extension OrganizationListViewController: UITableViewDelegate {
extension OrganizationListViewController {

private func configureUI() {
view.backgroundColor = .white
view.backgroundColor = .background

navigationItem.title = "대학 선택"
navigationController?.navigationBar.titleTextAttributes = [
Expand All @@ -146,8 +157,8 @@ extension OrganizationListViewController {
let largeConfig = UIImage.SymbolConfiguration(pointSize: 16, weight: .bold, scale: .default)
let largeBoldDoc = UIImage(systemName: "magnifyingglass", withConfiguration: largeConfig)
searchButton.setImage(largeBoldDoc, for: .normal)
searchButton.backgroundColor = .black
searchButton.tintColor = .white
searchButton.backgroundColor = .blackComponent
searchButton.tintColor = .reverseLabel
searchButton.layer.cornerRadius = 45/2
searchButton.clipsToBounds = true
searchButton.addTarget(self, action: #selector(searchButtonTapped), for: .touchUpInside)
Expand All @@ -156,11 +167,12 @@ extension OrganizationListViewController {
tableView.separatorStyle = .none
tableView.dataSource = self
tableView.delegate = self
tableView.backgroundColor = .background
}

private func setNavigationBar() {
let rightBarButton: UIBarButtonItem = UIBarButtonItem(image: UIImage(systemName: "chevron.backward"), style: .plain, target: self, action: #selector(backButtonDidTap))
rightBarButton.tintColor = .label
rightBarButton.tintColor = .accent
navigationItem.leftBarButtonItem = rightBarButton
}

Expand All @@ -183,7 +195,7 @@ extension OrganizationListViewController {
tableView.snp.makeConstraints { make in
make.top.equalTo(searchingTextFieldView.snp.bottom).offset(16)
make.horizontalEdges.equalToSuperview()
make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
make.bottom.equalTo(view.snp.bottom)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ final class DomainSettingCompleteViewController: UIViewController {
extension DomainSettingCompleteViewController {

private func configureUI() {
view.backgroundColor = .white
view.backgroundColor = .background

navigationItem.setHidesBackButton(true, animated: true)

cardView.clipsToBounds = true
cardView.layer.cornerRadius = 16
cardView.layer.applyFigmaShadow(color: .black, opacity: 0.25, xCoord: 0, yCoord: 0, blur: 5, spread: 0)
cardView.backgroundColor = .white
cardView.backgroundColor = .cardFill

signupImageView.image = UIImage(.img_signup)
signupImageView.contentMode = .scaleAspectFit
Expand All @@ -67,7 +67,7 @@ extension DomainSettingCompleteViewController {

cardUserNameLabel.text = viewModel.userName
cardUserNameLabel.font = .systemFont(ofSize: 16, weight: .medium)
cardUserNameLabel.textColor = .zestyColor(.gray3C3C43)
cardUserNameLabel.textColor = .secondaryLabel

startButton.setTitle("완료", for: .normal)
startButton.addTarget(self, action: #selector(startButtonTapped), for: .touchUpInside)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class VerifingCodeViewController: UIViewController {

private let resendStackView = UIStackView()
private let resendLabel = UILabel()
private let resendEamilButton = UIButton(type: .custom)
private let resendEmailButton = UIButton(type: .custom)

private let arrowButton = ArrowButton(initialDisable: false)

Expand All @@ -55,6 +55,17 @@ final class VerifingCodeViewController: UIViewController {
analytics()
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

let savedTraitCollection = UITraitCollection.current

UITraitCollection.current = self.traitCollection
arrowButton.setBorderColor(UIColor.blackComponent.cgColor)

UITraitCollection.current = savedTraitCollection
}

// MARK: - Function

@objc func resendButtonTapped() {
Expand All @@ -64,21 +75,21 @@ final class VerifingCodeViewController: UIViewController {
viewModel.resendEamil()
viewModel.startTimer()

resendEamilButton.isEnabled = false
resendEmailButton.isEnabled = false

DispatchQueue.main.async {
self.warningMessage.isHidden = true
}

DispatchQueue.main.asyncAfter(deadline: .now() + 3.1) {
self.resendEamilButton.isEnabled = true
self.resendEmailButton.isEnabled = true
}
}

private func showToastMessage() {
let toastLabel = UILabel()
toastLabel.backgroundColor = .black
toastLabel.textColor = .white
toastLabel.backgroundColor = .blackComponent
toastLabel.textColor = .reverseLabel
toastLabel.font = .systemFont(ofSize: 16.0, weight: .regular)
toastLabel.textAlignment = .center
toastLabel.text = "메일을 다시 보냈어요"
Expand Down Expand Up @@ -137,7 +148,7 @@ extension VerifingCodeViewController {
.sink { [weak self] timerText in
guard let self = self else { return }
self.timerLabel.text = timerText
self.timerLabel.textColor = timerText.count > 5 ? .zestyColor(.point) : .label
self.timerLabel.textColor = timerText.count > 5 ? .point : .label
}
.store(in: &cancelBag)

Expand Down Expand Up @@ -198,14 +209,14 @@ extension VerifingCodeViewController {
extension VerifingCodeViewController {

private func configureUI() {
view.backgroundColor = .white
view.backgroundColor = .background

navigationController?.navigationBar.tintColor = .label
navigationController?.navigationBar.topItem?.title = ""

warningMessage.text = "잘못된 코드예요."
warningMessage.isHidden = true
warningMessage.textColor = .zestyColor(.point)
warningMessage.textColor = .point

timerLabel.text = viewModel.timerText

Expand All @@ -218,18 +229,18 @@ extension VerifingCodeViewController {
resendLabel.font = .systemFont(ofSize: 13, weight: .regular)
resendLabel.numberOfLines = 0

resendEamilButton.setTitle("다시 보내기", for: .normal)
resendEamilButton.setTitleColor(.label, for: .normal)
resendEamilButton.titleLabel?.font = .systemFont(ofSize: 13, weight: .bold)
resendEamilButton.addTarget(self, action: #selector(resendButtonTapped), for: .touchUpInside)
resendEmailButton.setTitle("다시 보내기", for: .normal)
resendEmailButton.setTitleColor(.label, for: .normal)
resendEmailButton.titleLabel?.font = .systemFont(ofSize: 13, weight: .bold)
resendEmailButton.addTarget(self, action: #selector(resendButtonTapped), for: .touchUpInside)

arrowButton.isHidden = true
arrowButton.startIndicator()
}

private func createLayout() {
view.addSubviews([titleView, warningMessage, otpStackView, timerLabel, resendStackView, arrowButton])
resendStackView.addArrangedSubviews([resendLabel, resendEamilButton])
resendStackView.addArrangedSubviews([resendLabel, resendEmailButton])

titleView.snp.makeConstraints { make in
make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
Expand Down
Loading

0 comments on commit 73fa55f

Please sign in to comment.