-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…ilter 🔗 :: (#204) 모집의뢰서 필터 구현
- Loading branch information
Showing
16 changed files
with
591 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import RxFlow | ||
|
||
public enum RecruitmentFilterStep: Step { | ||
case recruitmentFilterIsRequired | ||
case popToRecruitment(jobCode: String?, techCode: [String]?) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Projects/Flow/Sources/Recruitment/RecruitmentFilterFlow.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import UIKit | ||
import Presentation | ||
import Swinject | ||
import RxFlow | ||
import Core | ||
|
||
public final class RecruitmentFilterFlow: Flow { | ||
public let container: Container | ||
private let rootViewController: RecruitmentFilterViewController | ||
public var root: Presentable { | ||
return rootViewController | ||
} | ||
|
||
public init(container: Container) { | ||
self.container = container | ||
self.rootViewController = container.resolve(RecruitmentFilterViewController.self)! | ||
} | ||
|
||
public func navigate(to step: Step) -> FlowContributors { | ||
guard let step = step as? RecruitmentFilterStep else { return .none } | ||
|
||
switch step { | ||
case .recruitmentFilterIsRequired: | ||
return navigateToRecruitmentFilter() | ||
|
||
case let .popToRecruitment(jobCode, techCode): | ||
return popToRecruitment(jobCode: jobCode ?? "", techCode: techCode) | ||
} | ||
} | ||
} | ||
|
||
private extension RecruitmentFilterFlow { | ||
func navigateToRecruitmentFilter() -> FlowContributors { | ||
return .one(flowContributor: .contribute( | ||
withNextPresentable: rootViewController, | ||
withNextStepper: rootViewController.viewModel | ||
)) | ||
} | ||
|
||
func popToRecruitment(jobCode: String, techCode: [String]?) -> FlowContributors { | ||
let popView = self.rootViewController.navigationController?.viewControllers.first as? RecruitmentViewController | ||
popView?.viewModel.jobCode = jobCode | ||
popView?.viewModel.techCode = techCode | ||
self.rootViewController.navigationController?.popViewController(animated: true) | ||
|
||
return .none | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
Projects/Modules/DesignSystem/Sources/CheckBox/JobisCheckBox.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import UIKit | ||
import RxSwift | ||
import RxCocoa | ||
import Then | ||
import SnapKit | ||
|
||
public final class JobisCheckBox: UIButton { | ||
public var isCheck: Bool = false { | ||
didSet { self.configureUI() } | ||
} | ||
|
||
private var fgColor: UIColor { | ||
return isCheck ? .GrayScale.gray10: .GrayScale.gray50 | ||
} | ||
|
||
private var bgColor: UIColor { | ||
return isCheck ? .Primary.blue20: .GrayScale.gray30 | ||
} | ||
|
||
public init() { | ||
super.init(frame: .zero) | ||
configureUI() | ||
} | ||
|
||
required public init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private func configureUI() { | ||
let image: UIImage? = .jobisIcon(.arrowDown) | ||
.withTintColor(fgColor, renderingMode: .alwaysTemplate) | ||
.resize(size: 28) | ||
|
||
var config = UIButton.Configuration.plain() | ||
config.image = image | ||
config.imagePlacement = .all | ||
self.configuration = config | ||
self.layer.cornerRadius = 4 | ||
self.backgroundColor = bgColor | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
Projects/Modules/DesignSystem/Sources/TextField/JobisSearchTextField.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import UIKit | ||
import Then | ||
import SnapKit | ||
import RxSwift | ||
import RxCocoa | ||
|
||
public final class JobisSearchTextField: UIStackView { | ||
private var disposeBag = DisposeBag() | ||
private let searchImageView = UIImageView().then { | ||
$0.image = .jobisIcon(.searchIcon) | ||
} | ||
private let searchTextField = UITextField() | ||
|
||
public init() { | ||
super.init(frame: .zero) | ||
self.spacing = 4 | ||
self.axis = .horizontal | ||
self.layoutMargins = .init(top: 12, left: 16, bottom: 12, right: 16) | ||
self.isLayoutMarginsRelativeArrangement = true | ||
self.backgroundColor = .GrayScale.gray30 | ||
self.layer.cornerRadius = 12 | ||
} | ||
|
||
required init(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override public func layoutSubviews() { | ||
addView() | ||
setLayout() | ||
} | ||
|
||
public func setTextField( | ||
placeholder: String | ||
) { | ||
self.searchTextField.placeholder = placeholder | ||
} | ||
|
||
private func addView() { | ||
[ | ||
searchImageView, | ||
searchTextField | ||
].forEach(self.addArrangedSubview(_:)) | ||
} | ||
|
||
private func setLayout() { | ||
searchImageView.snp.makeConstraints { | ||
$0.height.width.equalTo(24) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Projects/Presentation/Sources/RecruitmentFilter/Cell/JobsCollectionViewCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import UIKit | ||
import Domain | ||
import DesignSystem | ||
import SnapKit | ||
import Then | ||
import RxSwift | ||
import RxCocoa | ||
|
||
final class JobsCollectionViewCell: BaseCollectionViewCell<CodeEntity> { | ||
static let identifier = "JobsCollectionViewCell" | ||
public var isCheck: Bool = false { | ||
didSet { | ||
self.backgroundColor = isCheck ? .Primary.blue20 : .GrayScale.gray30 | ||
self.jobLabel.setJobisText( | ||
model?.keyword ?? "", | ||
font: .body, | ||
color: isCheck ? .GrayScale.gray10 : .Primary.blue40 | ||
) | ||
} | ||
} | ||
private var disposeBag = DisposeBag() | ||
private let jobLabel = UILabel() | ||
|
||
override func addView() { | ||
self.contentView.addSubview(jobLabel) | ||
} | ||
|
||
override func setLayout() { | ||
jobLabel.snp.makeConstraints { | ||
$0.leading.trailing.equalToSuperview().inset(12) | ||
$0.top.bottom.equalToSuperview().inset(4) | ||
} | ||
} | ||
|
||
override func configureView() { | ||
self.backgroundColor = .GrayScale.gray30 | ||
self.layer.cornerRadius = 16 | ||
} | ||
|
||
override func adapt(model: CodeEntity) { | ||
super.adapt(model: model) | ||
jobLabel.setJobisText(model.keyword, font: .body, color: .Primary.blue40) | ||
} | ||
} |
Oops, something went wrong.