Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DSMInhyeKang committed Mar 6, 2023
2 parents bac5eb9 + 6dba742 commit 96902c7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
8 changes: 6 additions & 2 deletions Projects/Features/HomeFeature/Sources/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ struct HomeView: View {
} label: {
NoticeView()
}
.animation(
.easeIn(duration: 1.5),
value: viewModel.isExistNewNotice
)
}

Text("오늘의 급식")
.dmsFont(.title(.title1), color: .GrayScale.gray7)
.padding(.top, viewModel.isExistNewNotice ? 16 : 46)
.padding(.top, viewModel.isExistNewNotice ? 10 : 46)

selectDateView()
.padding(.top, 24)
.padding(.top, 15)

MealCarouselView(
meal: viewModel.selectedDateMeal,
Expand Down
9 changes: 7 additions & 2 deletions Projects/Features/HomeFeature/Sources/HomeViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import DomainModule
import ErrorModule
import Foundation
import Utility
import SwiftUI

final class HomeViewModel: BaseViewModel {
@Published var selectedDate = Date()
@Published var isExistNewNotice = true
@Published var isExistNewNotice = false
@Published var meals: [String: MealEntity] = [:]
@Published var prevMonth = Date().month
var selectedDateString: String {
Expand Down Expand Up @@ -36,7 +37,11 @@ final class HomeViewModel: BaseViewModel {

func onAppear() {
addCancellable(fetchWhetherNewNoticeUseCase.execute()) { [weak self] isExistNewNotice in
self?.isExistNewNotice = isExistNewNotice
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
withAnimation {
self?.isExistNewNotice = isExistNewNotice
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct SchoolCodeView: View {
VStack(spacing: 24) {
DMSPassCodeView(codeCount: 8, text: $viewModel.schoolCode)

Text(viewModel.isErrorOcuured ? viewModel.errorMessage : "이메일로 전송된 인증코드 8자리를 입력해주세요.")
Text(viewModel.isErrorOcuured ? viewModel.errorMessage : "소속된 학교의 인증코드 8자리를 입력해주세요.")
.dmsFont(.body(.body3), color: viewModel.isErrorOcuured ? .System.error : .GrayScale.gray5)
}
.padding(.top, 56)
Expand Down
Binary file not shown.

0 comments on commit 96902c7

Please sign in to comment.