Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions Projects/App/iOS/Sources/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import FeatureFlagClient
import Firebase
import FirebaseAnalytics
import FirebaseCore
import FirebaseRemoteConfig
import FirebaseWrapper
import KeychainClient
import LocalDatabaseClient
Expand Down
8 changes: 8 additions & 0 deletions Projects/Feature/MainFeature/Sources/MainCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public struct MainCore: Reducer {
public var isExistNewVersion: Bool = false
public var mealCore: MealCore.State?
public var timeTableCore: TimeTableCore.State?
public var weeklyTimeTableCore: WeeklyTimeTableCore.State?
@PresentationState public var settingsCore: SettingsCore.State?
@PresentationState public var noticeCore: NoticeCore.State?
public var isShowingReviewToast: Bool = false
Expand Down Expand Up @@ -67,6 +68,7 @@ public struct MainCore: Reducer {
case tabSwiped(Int)
case mealCore(MealCore.Action)
case timeTableCore(TimeTableCore.Action)
case weeklyTimeTableCore(WeeklyTimeTableCore.Action)
case settingButtonDidTap
case checkVersion(TaskResult<String>)
case noticeButtonDidTap
Expand Down Expand Up @@ -114,6 +116,9 @@ public struct MainCore: Reducer {
if state.timeTableCore == nil {
state.timeTableCore = .init(displayDate: state.$displayDate)
}
if state.weeklyTimeTableCore == nil {
state.weeklyTimeTableCore = .init(displayDate: state.$displayDate)
}
return Effect.run { send in
let checkVersion = await Action.checkVersion(
TaskResult {
Expand Down Expand Up @@ -229,6 +234,9 @@ extension Reducer where State == MainCore.State, Action == MainCore.Action {
.ifLet(\.timeTableCore, action: /Action.timeTableCore) {
TimeTableCore()
}
.ifLet(\.weeklyTimeTableCore, action: /Action.weeklyTimeTableCore) {
WeeklyTimeTableCore()
}
.ifLet(\.$settingsCore, action: \.settingsCore) {
SettingsCore()
}
Expand Down
90 changes: 52 additions & 38 deletions Projects/Feature/MainFeature/Sources/MainView.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ComposableArchitecture
import DesignSystem
import FirebaseRemoteConfig
import MealFeature
import NoticeFeature
import SettingsFeature
Expand All @@ -14,6 +15,7 @@ public struct MainView: View {
@Environment(\.openURL) var openURL
@Environment(\.calendar) var calendar
@Dependency(\.userDefaultsClient) var userDefaultsClient
@RemoteConfigProperty(key: "enable_weekly_time_table", fallback: false) private var enableWeeklyTimeTable

public init(store: StoreOf<MainCore>) {
self.store = store
Expand Down Expand Up @@ -58,54 +60,63 @@ public struct MainView: View {
.tag(0)

VStack {
IfLetStore(
store.scope(state: \.timeTableCore, action: MainCore.Action.timeTableCore)
) { store in
TimeTableView(store: store)
if enableWeeklyTimeTable {
IfLetStore(
store.scope(
state: \.weeklyTimeTableCore,
action: MainCore.Action.weeklyTimeTableCore
)
) { store in
WeeklyTimeTableView(store: store)
}
} else {
IfLetStore(
store.scope(state: \.timeTableCore, action: MainCore.Action.timeTableCore)
) { store in
TimeTableView(store: store)
}
}
}
.tag(1)
}
.tabViewStyle(.page(indexDisplayMode: .never))

VStack {
if viewStore.isShowingReviewToast {
ReviewToast {
viewStore.send(.requestReview)
TWLog.event(ClickReviewEventLog())
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 16)
.padding(.bottom, viewStore.isExistNewVersion ? 72 : 16)
.animation(.default, value: viewStore.isShowingReviewToast)
.transition(.move(edge: .bottom).combined(with: .opacity))
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
viewStore.send(.hideReviewToast)
}
if viewStore.isShowingReviewToast {
ReviewToast {
viewStore.send(.requestReview)
TWLog.event(ClickReviewEventLog())
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 16)
.padding(.bottom, viewStore.isExistNewVersion ? 72 : 16)
.animation(.default, value: viewStore.isShowingReviewToast)
.transition(.move(edge: .bottom).combined(with: .opacity))
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
viewStore.send(.hideReviewToast)
}
}
}

if viewStore.isExistNewVersion {
Button {
let url = URL(
string: "https://apps.apple.com/app/id1629567018"
) ?? URL(string: "https://google.com")!
openURL(url)
} label: {
Circle()
.frame(width: 56, height: 56)
.foregroundColor(.extraBlack)
.overlay {
Image(systemName: "arrow.down.to.line")
.foregroundColor(.extraWhite)
.accessibilityHidden(true)
}
}
.padding([.bottom, .trailing], 16)
.accessibilityLabel("새 버전 업데이트")
.accessibilityHint("앱스토어로 이동하여 새 버전을 설치할 수 있습니다")
if viewStore.isExistNewVersion {
Button {
let url = URL(
string: "https://apps.apple.com/app/id1629567018"
) ?? URL(string: "https://google.com")!
openURL(url)
} label: {
Circle()
.frame(width: 56, height: 56)
.foregroundColor(.extraBlack)
.overlay {
Image(systemName: "arrow.down.to.line")
.foregroundColor(.extraWhite)
.accessibilityHidden(true)
}
}
.padding([.bottom, .trailing], 16)
.accessibilityLabel("새 버전 업데이트")
.accessibilityHint("앱스토어로 이동하여 새 버전을 설치할 수 있습니다")
}
}
}
Expand Down Expand Up @@ -208,6 +219,9 @@ public struct MainView: View {
.onAppear {
viewStore.send(.onAppear, animation: .default)
}
.onChange(of: enableWeeklyTimeTable, perform: { _ in
TWLog.setUserProperty(property: .enableWeeklyTimeTable, value: enableWeeklyTimeTable.description)
})
.onLoad {
viewStore.send(.onLoad)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public struct SchoolSettingCore: Reducer {
if major.isEmpty || schoolMajorList.isEmpty {
return "이대로하기"
} else if !major.isEmpty || schoolMajorList.isEmpty {
return "확인"
return "확인!"
}
return "다음"
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public struct TimeTableView: View {
.accessibilityLabel("시간표를 찾을 수 없습니다")
.accessibilitySortPriority(1)

if Date().month == 3 {
Text("3월 초중반에는 neis에 정규시간표가\n 등록되어있지 않을 수도 있어요.")
if Date().month == 3 || Date().month == 9 {
Text("학기 초에는 neis에 정규시간표가\n 등록되어있지 않을 수도 있어요.")
.multilineTextAlignment(.center)
.padding(.top, 14)
.foregroundColor(.textSecondary)
.accessibilityLabel("3월 초중반에는 정규시간표가 등록되어 있지 않을 수 있습니다")
.accessibilityLabel("학기 초에는 정규시간표가 등록되어 있지 않을 수 있습니다")
.accessibilitySortPriority(2)
}
}
Expand Down
Loading
Loading