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

[Fix] #190 - 햄버거바 2차 QA 적용 #191

Merged
merged 3 commits into from
Jul 21, 2022
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 HealthFoodMe/HealthFoodMe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2507,7 +2507,7 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.healthFoodMe.release;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = healthFood_dev;
PROVISIONING_PROFILE_SPECIFIER = HealthFoodMe_Dev;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class HamburgerBarVC: UIViewController {
return view
}()

private var hellowStackView: UIStackView = {
private var helloStackView: UIStackView = {
let st = UIStackView()
st.axis = .vertical
st.spacing = 3
Expand All @@ -60,6 +60,15 @@ class HamburgerBarVC: UIViewController {
return st
}()

private var nickNameWithButtonStackView: UIStackView = {
let st = UIStackView()
st.axis = .horizontal
st.spacing = 8
st.distribution = .equalSpacing
st.alignment = .center
return st
}()

private lazy var helloLabel: UILabel = {
let lb = UILabel()
lb.text = I18N.Map.HamburgerBar.hello
Expand All @@ -69,18 +78,21 @@ class HamburgerBarVC: UIViewController {
return lb
}()

private lazy var nickNameLabel: UILabel = {
let lb = UILabel()
private lazy var nickNameButton: UIButton = {
let button = UIButton()
if let name = name {
lb.text = "\(name)님"
button.setTitle("\(name)", for: .normal)
}
button.setTitleColor(.helfmeBlack, for: .normal)
button.titleLabel?.font = UIFont.NotoMedium(size: 18)
return button
}()

private lazy var sirLabel: UILabel = {
let lb = UILabel()
lb.text = "님"
lb.textColor = .helfmeBlack
lb.font = UIFont.NotoRegular(size: 18)

var text = name ?? ""
print(text)
lb.partFontChange(targetString: text, font: .NotoMedium(size: 18))

lb.font = .NotoRegular(size: 18)
return lb
}()

Expand Down Expand Up @@ -184,7 +196,7 @@ extension HamburgerBarVC {
private func setUI() {
setButtons()
setDivindingView()
setHellowStackView()
setStackView()
self.view.backgroundColor = .clear
}

Expand Down Expand Up @@ -212,16 +224,17 @@ extension HamburgerBarVC {
}
}

private func setHellowStackView() {
nickNameStackView.addArrangedSubviews(nickNameLabel, editNameButton)
hellowStackView.addArrangedSubviews(helloLabel, nickNameStackView, todayHelfmeLabel)
private func setStackView() {
nickNameStackView.addArrangedSubviews(nickNameButton, sirLabel)
nickNameWithButtonStackView.addArrangedSubviews(nickNameStackView, editNameButton)
helloStackView.addArrangedSubviews(helloLabel, nickNameWithButtonStackView, todayHelfmeLabel)
}

private func setLayout() {
view.addSubviews(hamburgerBarView,nicknameChangeSuccessView)


hamburgerBarView.addSubviews(hellowStackView,
hamburgerBarView.addSubviews(helloStackView,
storeButtonStackView, reportButtonStackView,
settingButton, logoutButton, dividingLineViews[0],
dividingLineViews[1], dividingLineViews[2])
Expand All @@ -240,19 +253,19 @@ extension HamburgerBarVC {
make.centerX.equalToSuperview()
}

hellowStackView.snp.makeConstraints { make in
helloStackView.snp.makeConstraints { make in
make.top.equalTo(hamburgerBarView).inset(96)
make.leading.equalTo(hamburgerBarView).inset(20)
}

// editNameButton.snp.makeConstraints { make in
// make.centerY.equalTo(hellowStackView.snp.centerY)
// make.leading.equalTo(hellowStackView.snp.trailing).offset(8)
// make.centerY.equalTo(nickNameStackView.snp.centerY)
// make.leading.equalTo(nickNameStackView.snp.trailing).offset(8)
// }
//

dividingLineViews[0].snp.makeConstraints { make in
make.width.equalTo(hamburgerBarView)
make.top.equalTo(hellowStackView.snp.bottom).offset(38)
make.top.equalTo(helloStackView.snp.bottom).offset(38)
make.height.equalTo(1)
make.leading.equalTo(hamburgerBarView).inset(0)
}
Expand Down Expand Up @@ -327,26 +340,29 @@ extension HamburgerBarVC {
switch(result) {
case .success(let result):
guard let result = result as? UserEntity else { return }
self.nickNameLabel.text = result.name
default : self.nickNameLabel.text = "헬푸미"
self.nickNameButton.setTitle(result.name, for: .normal)
default : self.nickNameButton.setTitle("헬푸미", for: .normal)
}
}
}

private func addObserver() {
addObserverAction(.nicknameChanged) { noti in
if let nickname = noti.object as? String {
self.nickNameLabel.text = nickname
self.nickNameButton.setTitle(nickname, for: .normal)
}
self.nicknameChangeSuccess()
}
}

private func addButtonAction() {
editNameButton.press {

let nicknameVC = ModuleFactory.resolve().makeNicknameChangeVC()

self.navigationController?.pushViewController(nicknameVC, animated: true)
}

nickNameButton.press {
let nicknameVC = ModuleFactory.resolve().makeNicknameChangeVC()
self.navigationController?.pushViewController(nicknameVC, animated: true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SettingVC: UIViewController {
private var topTitleLabel: UILabel = {
let label = UILabel()
label.font = .NotoBold(size: 16)
label.text = I18N.Auth.ChangeNickname.headerTitle
label.text = I18N.Map.HamburgerBar.setting
label.textColor = UIColor.helfmeBlack
return label
}()
Expand Down