feat: 상단에 최근 공지사항 표시

This commit is contained in:
Yu Sung
2025-07-28 20:02:54 +09:00
parent b20a6cb0f6
commit 7d22a29517
4 changed files with 62 additions and 13 deletions

View File

@@ -97,6 +97,10 @@ struct MyPageView: View {
CategoryButtonsView(
isShowAuthView: $viewModel.isShowAuthView,
isAuthenticated: viewModel.isAuth,
showMessage: {
viewModel.errorMessage = $0
viewModel.isShowPopup = true
},
refresh: {
viewModel.getMypage()
}
@@ -126,6 +130,7 @@ struct MyPageView: View {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
viewModel.getMypage()
}
viewModel.getLatestNotice()
}
}
}
@@ -172,7 +177,7 @@ struct MyPageHeaderView: View {
if isShowButton {
HStack(spacing: 24) {
// Settings Icon
Image(systemName: "ic_settings")
Image("ic_settings")
.foregroundColor(.white)
.frame(width: 24, height: 24)
.onTapGesture {
@@ -183,7 +188,6 @@ struct MyPageHeaderView: View {
}
.padding(.horizontal, 24)
.padding(.vertical, 20)
.background(Color.black)
}
}
@@ -359,22 +363,30 @@ struct CategoryButtonsView: View {
@Binding var isShowAuthView: Bool
let isAuthenticated: Bool
let showMessage: (String) -> Void
let refresh: () -> Void
var body: some View {
LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 3), spacing: 14) {
LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 4), spacing: 16) {
CategoryButtonItem(icon: "ic_my_storage", title: "보관함") {
AppState.shared.setAppStep(step: .myBox(currentTab: .orderlist))
}
CategoryButtonItem(icon: "ic_my_block", title: "차단목록") {
AppState.shared.setAppStep(step: .blockList)
}
if isAuthenticated {
CategoryButtonItem(
icon: "ic_my_coupon",
title: "쿠폰등록"
) {
CategoryButtonItem(
icon: "ic_my_coupon",
title: "쿠폰등록"
) {
if isAuthenticated {
AppState.shared.setAppStep(step: .canCoupon(refresh: refresh))
} else {
showMessage("본인인증 후 등록합니다.")
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
isShowAuthView = true
}
}
}
@@ -390,11 +402,11 @@ struct CategoryButtonsView: View {
AppState.shared.setAppStep(step: .serviceCenter)
}
if !isAuthenticated {
CategoryButtonItem(
icon: "ic_my_auth",
title: "본인인증"
) {
CategoryButtonItem(
icon: "ic_my_auth",
title: isAuthenticated ? "인증완료" : "본인인증"
) {
if !isAuthenticated {
isShowAuthView = true
}
}