Skip to content

Commit

Permalink
rename: 모든 뉴스 케이스 allNews로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
greetings1012 committed Nov 17, 2023
1 parent d594c84 commit a2dec30
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Targets/D3N/Sources/App/RootStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ struct RootStore: Reducer {
case mainTab(MainTabStore.State)

init() {
// if LocalStorageManager.load(.isOnBoardingNeeded) != false {
// self = .onboarding(.init())
// } else {
if LocalStorageManager.load(.isOnBoardingNeeded) != false {
self = .onboarding(.init())
} else {
self = .mainTab(.init())
// }
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public struct AllNewsNavigationStackStore: Reducer {
public enum State: Equatable {
case quizMain(QuizMainStore.State)
case quizResult(QuizResultStore.State)
case newsList(AllNewsStore.State)
case allNews(AllNewsStore.State)
}

public enum Action: Equatable {
case quizMain(QuizMainStore.Action)
case quizResult(QuizResultStore.Action)
case newsList(AllNewsStore.Action)
case allNews(AllNewsStore.Action)
}

public var body: some Reducer<State, Action> {
Expand All @@ -51,7 +51,7 @@ public struct AllNewsNavigationStackStore: Reducer {
Scope(state: /State.quizResult, action: /Action.quizResult) {
QuizResultStore()
}
Scope(state: /State.newsList, action: /Action.newsList) {
Scope(state: /State.allNews, action: /Action.allNews) {
AllNewsStore()
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@ public struct AllNewsNavigationStackStore: Reducer {
return .send(.popToRoot)
}

case let .path(.element(id: _, action: .newsList(.delegate(action)))):
case let .path(.element(id: _, action: .allNews(.delegate(action)))):
switch action {
case let .select(newsEntity):
state.path.append(.quizMain(.init(newsEntity: newsEntity)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public struct AllNewsNavigationStackView: View {
then: QuizResultView.init(store:)
)

case .newsList:
case .allNews:
CaseLet(
/AllNewsNavigationStackStore.Path.State.newsList,
action: TodayNavigationStackStore.Path.Action.newsList,
/AllNewsNavigationStackStore.Path.State.allNews,
action: TodayNavigationStackStore.Path.Action.allNews,
then: AllNewsView.init(store:)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public struct TodayNavigationStackStore: Reducer {
case detail(TodayDetailStore.State)
case quizMain(QuizMainStore.State)
case quizResult(QuizResultStore.State)
case newsList(AllNewsStore.State)
case allNews(AllNewsStore.State)
}

public enum Action: Equatable {
case detail(TodayDetailStore.Action)
case quizMain(QuizMainStore.Action)
case quizResult(QuizResultStore.Action)
case newsList(AllNewsStore.Action)
case allNews(AllNewsStore.Action)
}

public var body: some Reducer<State, Action> {
Expand All @@ -56,7 +56,7 @@ public struct TodayNavigationStackStore: Reducer {
Scope(state: /State.quizResult, action: /Action.quizResult) {
QuizResultStore()
}
Scope(state: /State.newsList, action: /Action.newsList) {
Scope(state: /State.allNews, action: /Action.allNews) {
AllNewsStore()
}
}
Expand All @@ -76,7 +76,7 @@ public struct TodayNavigationStackStore: Reducer {
state.path.append(.quizMain(.init(newsEntity: newsEntity)))
return .none
case .allNewsButtonTapped:
state.path.append(.newsList(.init()))
state.path.append(.allNews(.init()))
return .none
}

Expand All @@ -93,7 +93,7 @@ public struct TodayNavigationStackStore: Reducer {
return .send(.popToRoot)
}

case let .path(.element(id: _, action: .newsList(.delegate(action)))):
case let .path(.element(id: _, action: .allNews(.delegate(action)))):
switch action {
case let .select(newsEntity):
state.path.append(.quizMain(.init(newsEntity: newsEntity)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public struct TodayNavigationStackView: View {
then: QuizResultView.init(store:)
)

case .newsList:
case .allNews:
CaseLet(
/TodayNavigationStackStore.Path.State.newsList,
action: TodayNavigationStackStore.Path.Action.newsList,
/TodayNavigationStackStore.Path.State.allNews,
action: TodayNavigationStackStore.Path.Action.allNews,
then: AllNewsView.init(store:)
)
}
Expand Down

0 comments on commit a2dec30

Please sign in to comment.