|
| 1 | +import UIKit |
| 2 | +import SnapKit |
| 3 | +import Then |
| 4 | +import DesignSystem |
| 5 | + |
| 6 | +public final class CompanyDetailProfileView: BaseView { |
| 7 | + private let backStackView = UIStackView().then { |
| 8 | + $0.axis = .vertical |
| 9 | + $0.spacing = 12 |
| 10 | + $0.layoutMargins = .init(top: 12, left: 24, bottom: 12, right: 24) |
| 11 | + $0.isLayoutMarginsRelativeArrangement = true |
| 12 | + } |
| 13 | + private let profileStackView = UIStackView().then { |
| 14 | + $0.axis = .horizontal |
| 15 | + $0.spacing = 12 |
| 16 | + } |
| 17 | + private let companyLogoImageView = UIImageView().then { |
| 18 | + $0.clipsToBounds = true |
| 19 | + $0.layer.borderWidth = 1.0 |
| 20 | + $0.layer.borderColor = UIColor.GrayScale.gray30.cgColor |
| 21 | + $0.layer.cornerRadius = 8 |
| 22 | + } |
| 23 | + private let companyLabel = UILabel().then { |
| 24 | + $0.setJobisText( |
| 25 | + "๊ธฐ์
์์ธ ๋ถ๋ฌ์ค๋์ค...", |
| 26 | + font: .headLine, |
| 27 | + color: .GrayScale.gray90 |
| 28 | + ) |
| 29 | + } |
| 30 | + let companyContentLabel = UILabel().then { |
| 31 | + $0.setJobisText( |
| 32 | + "-", |
| 33 | + font: .body, |
| 34 | + color: .GrayScale.gray70 |
| 35 | + ) |
| 36 | + $0.numberOfLines = 0 |
| 37 | + $0.lineBreakMode = .byWordWrapping |
| 38 | + } |
| 39 | + |
| 40 | + func setCompanyProfile(imageUrl: String, companyName: String, companyContent: String) { |
| 41 | + companyLogoImageView.setJobisImage(urlString: imageUrl) |
| 42 | + companyLabel.text = companyName |
| 43 | + companyContentLabel.text = companyContent |
| 44 | + } |
| 45 | + |
| 46 | + public override func addView() { |
| 47 | + [ |
| 48 | + companyLogoImageView, |
| 49 | + companyLabel |
| 50 | + ].forEach(self.profileStackView.addArrangedSubview(_:)) |
| 51 | + |
| 52 | + [ |
| 53 | + profileStackView, |
| 54 | + companyContentLabel |
| 55 | + ].forEach(self.backStackView.addArrangedSubview(_:)) |
| 56 | + self.addSubview(backStackView) |
| 57 | + } |
| 58 | + |
| 59 | + public override func setLayout() { |
| 60 | + companyLogoImageView.snp.makeConstraints { |
| 61 | + $0.width.height.equalTo(48) |
| 62 | + } |
| 63 | + |
| 64 | + backStackView.snp.makeConstraints { |
| 65 | + $0.edges.equalToSuperview() |
| 66 | + } |
| 67 | + } |
| 68 | +} |
0 commit comments