From 23e153dfd8e3aa02e26250ec09a511a43bf080f5 Mon Sep 17 00:00:00 2001 From: tomokisun Date: Wed, 29 Nov 2023 09:03:49 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/AboutFeature/About.swift | 28 +++++++++------ .../Sources/ActivityFeature/Activity.swift | 7 ++-- .../GodPackage/Sources/AddFeature/Add.swift | 14 ++++---- .../InboxDetailFeature/InboxDetail.swift | 21 ++++++----- .../Sources/InboxFeature/Inbox.swift | 28 ++++++++------- .../InviteFriendFeature/InviteFriend.swift | 14 ++++---- .../ProfileEditFeature/ProfileEdit.swift | 14 ++++---- .../Sources/ProfileFeature/Profile.swift | 35 +++++++++++-------- .../ProfileShareFeature/ProfileShare.swift | 9 ++--- 9 files changed, 99 insertions(+), 71 deletions(-) diff --git a/Packages/GodPackage/Sources/AboutFeature/About.swift b/Packages/GodPackage/Sources/AboutFeature/About.swift index d9d925ed..f0b77af6 100644 --- a/Packages/GodPackage/Sources/AboutFeature/About.swift +++ b/Packages/GodPackage/Sources/AboutFeature/About.swift @@ -229,25 +229,33 @@ public struct AboutView: View { } .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } - .confirmationDialog(store: store.scope(state: \.$confirmationDialog, action: { .confirmationDialog($0) })) + .confirmationDialog( + store: store.scope( + state: \.$confirmationDialog, + action: \.confirmationDialog + ) + ) .fullScreenCover( - store: store.scope(state: \.$destination, action: AboutLogic.Action.destination), - state: /AboutLogic.Destination.State.howItWorks, - action: AboutLogic.Destination.Action.howItWorks, + store: store.scope( + state: \.$destination.howItWorks, + action: \.destination.howItWorks + ), content: HowItWorksView.init(store:) ) .sheet( - store: store.scope(state: \.$destination, action: AboutLogic.Action.destination), - state: /AboutLogic.Destination.State.emailSheet, - action: AboutLogic.Destination.Action.emailSheet + store: store.scope( + state: \.$destination.emailSheet, + action: \.destination.emailSheet + ) ) { store in EmailSheetView(store: store) .presentationBackground(Color.clear) } .sheet( - store: store.scope(state: \.$destination, action: AboutLogic.Action.destination), - state: /AboutLogic.Destination.State.deleteAccount, - action: AboutLogic.Destination.Action.deleteAccount + store: store.scope( + state: \.$destination.deleteAccount, + action: \.destination.deleteAccount + ) ) { store in NavigationStack { DeleteAccountView(store: store) diff --git a/Packages/GodPackage/Sources/ActivityFeature/Activity.swift b/Packages/GodPackage/Sources/ActivityFeature/Activity.swift index 5b341897..761ca33b 100644 --- a/Packages/GodPackage/Sources/ActivityFeature/Activity.swift +++ b/Packages/GodPackage/Sources/ActivityFeature/Activity.swift @@ -118,9 +118,10 @@ public struct ActivityView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .sheet( - store: store.scope(state: \.$destination, action: { .destination($0) }), - state: /ActivityLogic.Destination.State.profile, - action: ActivityLogic.Destination.Action.profile + store: store.scope( + state: \.$destination.profile, + action: \.destination.profile + ) ) { store in NavigationStack { ProfileExternalView(store: store) diff --git a/Packages/GodPackage/Sources/AddFeature/Add.swift b/Packages/GodPackage/Sources/AddFeature/Add.swift index 956d5157..1645f0c8 100644 --- a/Packages/GodPackage/Sources/AddFeature/Add.swift +++ b/Packages/GodPackage/Sources/AddFeature/Add.swift @@ -426,15 +426,17 @@ public struct AddView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .sheet( - store: store.scope(state: \.$destination, action: AddLogic.Action.destination), - state: /AddLogic.Destination.State.message, - action: AddLogic.Destination.Action.message, + store: store.scope( + state: \.$destination.message, + action: \.destination.message + ), content: CupertinoMessageView.init ) .sheet( - store: store.scope(state: \.$destination, action: AddLogic.Action.destination), - state: /AddLogic.Destination.State.profileExternal, - action: AddLogic.Destination.Action.profileExternal + store: store.scope( + state: \.$destination.profileExternal, + action: \.destination.profileExternal + ) ) { store in NavigationStack { ProfileExternalView(store: store) diff --git a/Packages/GodPackage/Sources/InboxDetailFeature/InboxDetail.swift b/Packages/GodPackage/Sources/InboxDetailFeature/InboxDetail.swift index d9ae5981..b6781e08 100644 --- a/Packages/GodPackage/Sources/InboxDetailFeature/InboxDetail.swift +++ b/Packages/GodPackage/Sources/InboxDetailFeature/InboxDetail.swift @@ -349,25 +349,28 @@ public struct InboxDetailView: View { store.send(.closeButtonTapped) } .fullScreenCover( - store: store.scope(state: \.$destination, action: InboxDetailLogic.Action.destination), - state: /InboxDetailLogic.Destination.State.initialName, - action: InboxDetailLogic.Destination.Action.initialName + store: store.scope( + state: \.$destination.initialName, + action: \.destination.initialName + ) ) { store in InitialNameView(store: store) .presentationBackground(Color.clear) } .fullScreenCover( - store: store.scope(state: \.$destination, action: InboxDetailLogic.Action.destination), - state: /InboxDetailLogic.Destination.State.fullName, - action: InboxDetailLogic.Destination.Action.fullName + store: store.scope( + state: \.$destination.fullName, + action: \.destination.fullName + ) ) { store in FullNameView(store: store) .presentationBackground(Color.clear) } .fullScreenCover( - store: store.scope(state: \.$destination, action: InboxDetailLogic.Action.destination), - state: /InboxDetailLogic.Destination.State.godMode, - action: InboxDetailLogic.Destination.Action.godMode, + store: store.scope( + state: \.$destination.godMode, + action: \.destination.godMode + ), content: GodModeView.init(store:) ) } diff --git a/Packages/GodPackage/Sources/InboxFeature/Inbox.swift b/Packages/GodPackage/Sources/InboxFeature/Inbox.swift index 2b0c2c35..50a92a49 100644 --- a/Packages/GodPackage/Sources/InboxFeature/Inbox.swift +++ b/Packages/GodPackage/Sources/InboxFeature/Inbox.swift @@ -365,29 +365,33 @@ public struct InboxView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .sheet( - store: store.scope(state: \.$destination, action: { .destination($0) }), - state: /InboxLogic.Destination.State.activatedGodMode, - action: InboxLogic.Destination.Action.activatedGodMode + store: store.scope( + state: \.$destination.activatedGodMode, + action: \.destination.activatedGodMode + ) ) { store in ActivatedGodModeView(store: store) .presentationDetents([.fraction(0.4)]) } .fullScreenCover( - store: store.scope(state: \.$destination, action: { .destination($0) }), - state: /InboxLogic.Destination.State.godMode, - action: InboxLogic.Destination.Action.godMode, + store: store.scope( + state: \.$destination.godMode, + action: \.destination.godMode + ), content: GodModeView.init(store:) ) .fullScreenCover( - store: store.scope(state: \.$destination, action: { .destination($0) }), - state: /InboxLogic.Destination.State.fromGodTeam, - action: InboxLogic.Destination.Action.fromGodTeam, + store: store.scope( + state: \.$destination.fromGodTeam, + action: \.destination.fromGodTeam + ), content: FromGodTeamView.init(store:) ) .fullScreenCover( - store: store.scope(state: \.$destination, action: { .destination($0) }), - state: /InboxLogic.Destination.State.inboxDetail, - action: InboxLogic.Destination.Action.inboxDetail, + store: store.scope( + state: \.$destination.inboxDetail, + action: \.destination.inboxDetail + ), content: InboxDetailView.init(store:) ) } diff --git a/Packages/GodPackage/Sources/InviteFriendFeature/InviteFriend.swift b/Packages/GodPackage/Sources/InviteFriendFeature/InviteFriend.swift index 3e47af27..14b10853 100644 --- a/Packages/GodPackage/Sources/InviteFriendFeature/InviteFriend.swift +++ b/Packages/GodPackage/Sources/InviteFriendFeature/InviteFriend.swift @@ -271,14 +271,16 @@ public struct InviteFriendView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .alert( - store: store.scope(state: \.$destination, action: InviteFriendLogic.Action.destination), - state: /InviteFriendLogic.Destination.State.alert, - action: InviteFriendLogic.Destination.Action.alert + store: store.scope( + state: \.$destination.alert, + action: \.destination.alert + ) ) .sheet( - store: store.scope(state: \.$destination, action: InviteFriendLogic.Action.destination), - state: /InviteFriendLogic.Destination.State.activity, - action: InviteFriendLogic.Destination.Action.activity + store: store.scope( + state: \.$destination.activity, + action: \.destination.activity + ) ) { _ in ActivityView( activityItems: [viewStore.shareURL], diff --git a/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift b/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift index f2a7b127..dc4e9bff 100644 --- a/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift +++ b/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift @@ -458,18 +458,20 @@ public struct ProfileEditView: View { .onAppear { store.send(.onAppear) } .alert(store: store.scope(state: \.$alert, action: ProfileEditLogic.Action.alert)) .sheet( - store: store.scope(state: \.$destination, action: ProfileEditLogic.Action.destination), - state: /ProfileEditLogic.Destination.State.manageAccount, - action: ProfileEditLogic.Destination.Action.manageAccount + store: store.scope( + state: \.$destination.manageAccount, + action: \.destination.manageAccount + ) ) { store in NavigationStack { ManageAccountView(store: store) } } .sheet( - store: store.scope(state: \.$destination, action: ProfileEditLogic.Action.destination), - state: /ProfileEditLogic.Destination.State.deleteAccount, - action: ProfileEditLogic.Destination.Action.deleteAccount + store: store.scope( + state: \.$destination.deleteAccount, + action: \.destination.deleteAccount + ) ) { store in NavigationStack { DeleteAccountView(store: store) diff --git a/Packages/GodPackage/Sources/ProfileFeature/Profile.swift b/Packages/GodPackage/Sources/ProfileFeature/Profile.swift index 74ab61c1..b3af859c 100644 --- a/Packages/GodPackage/Sources/ProfileFeature/Profile.swift +++ b/Packages/GodPackage/Sources/ProfileFeature/Profile.swift @@ -256,14 +256,16 @@ public struct ProfileView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .alert( - store: store.scope(state: \.$destination, action: ProfileLogic.Action.destination), - state: /ProfileLogic.Destination.State.alert, - action: ProfileLogic.Destination.Action.alert + store: store.scope( + state: \.$destination.alert, + action: \.destination.alert + ) ) .sheet( - store: store.scope(state: \.$destination, action: ProfileLogic.Action.destination), - state: /ProfileLogic.Destination.State.profileEdit, - action: ProfileLogic.Destination.Action.profileEdit + store: store.scope( + state: \.$destination.profileEdit, + action: \.destination.profileEdit + ) ) { store in NavigationStack { ProfileEditView(store: store) @@ -271,26 +273,29 @@ public struct ProfileView: View { .interactiveDismissDisabled() } .sheet( - store: store.scope(state: \.$destination, action: ProfileLogic.Action.destination), - state: /ProfileLogic.Destination.State.shop, - action: ProfileLogic.Destination.Action.shop + store: store.scope( + state: \.$destination.shop, + action: \.destination.shop + ) ) { store in NavigationStack { ShopView(store: store) } } .sheet( - store: store.scope(state: \.$destination, action: ProfileLogic.Action.destination), - state: /ProfileLogic.Destination.State.profileShare, - action: ProfileLogic.Destination.Action.profileShare + store: store.scope( + state: \.$destination.profileShare, + action: \.destination.profileShare + ) ) { store in ProfileShareView(store: store) .presentationBackground(Color.clear) } .sheet( - store: store.scope(state: \.$destination, action: ProfileLogic.Action.destination), - state: /ProfileLogic.Destination.State.external, - action: ProfileLogic.Destination.Action.external + store: store.scope( + state: \.$destination.external, + action: \.destination.external + ) ) { store in NavigationStack { ProfileExternalView(store: store) diff --git a/Packages/GodPackage/Sources/ProfileShareFeature/ProfileShare.swift b/Packages/GodPackage/Sources/ProfileShareFeature/ProfileShare.swift index be3969ae..88a78d65 100644 --- a/Packages/GodPackage/Sources/ProfileShareFeature/ProfileShare.swift +++ b/Packages/GodPackage/Sources/ProfileShareFeature/ProfileShare.swift @@ -223,13 +223,14 @@ public struct ProfileShareView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .sheet( - store: store.scope(state: \.$message, action: { .message($0) }), + store: store.scope(state: \.$message, action: \.message), content: CupertinoMessageView.init ) .fullScreenCover( - store: store.scope(state: \.$destination, action: { .destination($0) }), - state: /ProfileShareLogic.Destination.State.shareProfileToInstagramPopup, - action: ProfileShareLogic.Destination.Action.shareProfileToInstagramPopup + store: store.scope( + state: \.$destination.shareProfileToInstagramPopup, + action: \.destination.shareProfileToInstagramPopup + ) ) { store in ShareProfileToInstagramPopupView(store: store) .backgroundClearSheet() From 3ea59149dbc09b3fe49648d5217d9e282b50e9f8 Mon Sep 17 00:00:00 2001 From: tomokisun Date: Wed, 29 Nov 2023 09:18:24 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Packages/GodPackage/Sources/OnboardFeature/OneTimeCode.swift | 2 +- Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift | 2 +- .../GodPackage/Sources/OnboardFeature/UsernameSetting.swift | 2 +- Packages/GodPackage/Sources/OnboardFeature/Welcome.swift | 2 +- Packages/GodPackage/Sources/PollFeature/Poll.swift | 2 +- Packages/GodPackage/Sources/PollFeature/PollQuestion.swift | 2 +- .../GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift | 2 +- .../Sources/ProfileExternalFeature/ProfileExternal.swift | 2 +- Packages/GodPackage/Sources/ShopFeature/Shop.swift | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Packages/GodPackage/Sources/OnboardFeature/OneTimeCode.swift b/Packages/GodPackage/Sources/OnboardFeature/OneTimeCode.swift index 33b808c8..470a2996 100644 --- a/Packages/GodPackage/Sources/OnboardFeature/OneTimeCode.swift +++ b/Packages/GodPackage/Sources/OnboardFeature/OneTimeCode.swift @@ -215,7 +215,7 @@ public struct OneTimeCodeView: View { .foregroundStyle(Color.white) .multilineTextAlignment(.center) } - .alert(store: store.scope(state: \.$alert, action: OneTimeCodeLogic.Action.alert)) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .onAppear { focus = true store.send(.onAppear) diff --git a/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift b/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift index b92eb64d..043acc0f 100644 --- a/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift +++ b/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift @@ -155,7 +155,7 @@ public struct PhoneNumberView: View { .multilineTextAlignment(.center) } .navigationBarBackButtonHidden() - .alert(store: store.scope(state: \.$alert, action: PhoneNumberLogic.Action.alert)) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .sheet( store: store.scope(state: \.$help, action: PhoneNumberLogic.Action.help), content: { store in diff --git a/Packages/GodPackage/Sources/OnboardFeature/UsernameSetting.swift b/Packages/GodPackage/Sources/OnboardFeature/UsernameSetting.swift index 9b06ce51..1a0b3b50 100644 --- a/Packages/GodPackage/Sources/OnboardFeature/UsernameSetting.swift +++ b/Packages/GodPackage/Sources/OnboardFeature/UsernameSetting.swift @@ -134,7 +134,7 @@ public struct UsernameSettingView: View { .foregroundStyle(Color.white) .background(Color.godService) .multilineTextAlignment(.center) - .alert(store: store.scope(state: \.$alert, action: UsernameSettingLogic.Action.alert)) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .onAppear { focus = true store.send(.onAppear) diff --git a/Packages/GodPackage/Sources/OnboardFeature/Welcome.swift b/Packages/GodPackage/Sources/OnboardFeature/Welcome.swift index 23bf17e3..16f3851c 100644 --- a/Packages/GodPackage/Sources/OnboardFeature/Welcome.swift +++ b/Packages/GodPackage/Sources/OnboardFeature/Welcome.swift @@ -138,7 +138,7 @@ public struct WelcomeView: View { } } .background(Color.godBlack) - .alert(store: store.scope(state: \.$alert, action: WelcomeLogic.Action.alert)) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .onAppear { store.send(.onAppear) } .toolbar { Button { diff --git a/Packages/GodPackage/Sources/PollFeature/Poll.swift b/Packages/GodPackage/Sources/PollFeature/Poll.swift index be097e7b..07fffcd1 100644 --- a/Packages/GodPackage/Sources/PollFeature/Poll.swift +++ b/Packages/GodPackage/Sources/PollFeature/Poll.swift @@ -215,7 +215,7 @@ public struct PollView: View { } .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } - .alert(store: store.scope(state: \.$alert, action: PollLogic.Action.alert)) + .alert(store: store.scope(state: \.$alert, action: \.alert)) } } } diff --git a/Packages/GodPackage/Sources/PollFeature/PollQuestion.swift b/Packages/GodPackage/Sources/PollFeature/PollQuestion.swift index a82f0e77..72956edb 100644 --- a/Packages/GodPackage/Sources/PollFeature/PollQuestion.swift +++ b/Packages/GodPackage/Sources/PollFeature/PollQuestion.swift @@ -258,7 +258,7 @@ public struct PollQuestionView: View { .padding(.horizontal, 36) .background(viewStore.backgroundColor) .task { await store.send(.onTask).finish() } - .alert(store: store.scope(state: \.$alert, action: { .alert($0) })) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .frame(height: UIScreen.main.bounds.height) .onTapGesture { if !viewStore.voteChoices.isEmpty { diff --git a/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift b/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift index dc4e9bff..610e6412 100644 --- a/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift +++ b/Packages/GodPackage/Sources/ProfileEditFeature/ProfileEdit.swift @@ -456,7 +456,7 @@ public struct ProfileEditView: View { } .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } - .alert(store: store.scope(state: \.$alert, action: ProfileEditLogic.Action.alert)) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .sheet( store: store.scope( state: \.$destination.manageAccount, diff --git a/Packages/GodPackage/Sources/ProfileExternalFeature/ProfileExternal.swift b/Packages/GodPackage/Sources/ProfileExternalFeature/ProfileExternal.swift index c7fd100f..0a0adc5a 100644 --- a/Packages/GodPackage/Sources/ProfileExternalFeature/ProfileExternal.swift +++ b/Packages/GodPackage/Sources/ProfileExternalFeature/ProfileExternal.swift @@ -138,7 +138,7 @@ public struct ProfileExternalView: View { .navigationBarTitleDisplayMode(.inline) .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } - .alert(store: store.scope(state: \.$alert, action: { .alert($0) })) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .confirmationDialog(store: store.scope(state: \.$confirmationDialog, action: { .confirmationDialog($0) })) .toolbar { ToolbarItem(placement: .topBarLeading) { diff --git a/Packages/GodPackage/Sources/ShopFeature/Shop.swift b/Packages/GodPackage/Sources/ShopFeature/Shop.swift index 811baf28..bd25fe80 100644 --- a/Packages/GodPackage/Sources/ShopFeature/Shop.swift +++ b/Packages/GodPackage/Sources/ShopFeature/Shop.swift @@ -222,7 +222,7 @@ public struct ShopView: View { .navigationBarTitleDisplayMode(.inline) .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } - .alert(store: store.scope(state: \.$alert, action: ShopLogic.Action.alert)) + .alert(store: store.scope(state: \.$alert, action: \.alert)) .fullScreenCover( store: store.scope( state: \.$pickFriend, From a7d8fd4030cad725b19770ef28d963ca8cfe0d5f Mon Sep 17 00:00:00 2001 From: tomokisun Date: Wed, 29 Nov 2023 09:23:52 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GodPackage/Sources/AddFeature/Add.swift | 12 ++--- .../Sources/AddFeature/FriendRequests.swift | 2 +- .../AddFeature/FriendsOfFriendsPanel.swift | 2 +- .../Sources/AddFeature/FromSchoolPanel.swift | 2 +- .../Sources/AddFeature/InvitationsLeft.swift | 2 +- .../Sources/AppFeature/AppLogic.swift | 2 +- .../DeleteAccountFeature/DeleteAccount.swift | 7 +-- .../GodPackage/Sources/GodFeature/God.swift | 2 +- .../Sources/InboxFeature/Inbox.swift | 4 +- .../ManageAccountFeature/ManageAccount.swift | 2 +- .../NavigationFeature/RootNavigation.swift | 46 ++++--------------- .../Sources/OnboardFeature/AddFriends.swift | 2 +- .../Sources/OnboardFeature/Onboard.swift | 4 +- .../Sources/OnboardFeature/PhoneNumber.swift | 2 +- .../GodPackage/Sources/PollFeature/Poll.swift | 2 +- .../ShareProfileToInstagramPopup.swift | 2 +- .../GodPackage/Sources/ShopFeature/Shop.swift | 7 +-- 17 files changed, 31 insertions(+), 71 deletions(-) diff --git a/Packages/GodPackage/Sources/AddFeature/Add.swift b/Packages/GodPackage/Sources/AddFeature/Add.swift index 1645f0c8..82404e16 100644 --- a/Packages/GodPackage/Sources/AddFeature/Add.swift +++ b/Packages/GodPackage/Sources/AddFeature/Add.swift @@ -364,7 +364,7 @@ public struct AddView: View { ZStack { VStack(spacing: 0) { IfLetStore( - store.scope(state: \.contactsReEnable, action: AddLogic.Action.contactsReEnable), + store.scope(state: \.contactsReEnable, action: \.contactsReEnable), then: ContactsReEnableView.init(store:) ) SearchField(text: viewStore.$searchQuery) @@ -395,26 +395,26 @@ public struct AddView: View { if viewStore.searchResult.isEmpty { IfLetStore( - store.scope(state: \.friendRequestPanel, action: AddLogic.Action.friendRequestPanel), + store.scope(state: \.friendRequestPanel, action: \.friendRequestPanel), then: FriendRequestsView.init(store:) ) IfLetStore( - store.scope(state: \.friendsOfFriendsPanel, action: AddLogic.Action.friendsOfFriendsPanel), + store.scope(state: \.friendsOfFriendsPanel, action: \.friendsOfFriendsPanel), then: FriendsOfFriendsPanelView.init(store:) ) IfLetStore( - store.scope(state: \.fromSchoolPanel, action: AddLogic.Action.fromSchoolPanel), + store.scope(state: \.fromSchoolPanel, action: \.fromSchoolPanel), then: FromSchoolPanelView.init(store:) ) InvitationsLeftView( store: store.scope( state: \.invitationsLeft, - action: AddLogic.Action.invitationsLeft + action: \.invitationsLeft ) ) } else { ForEachStore( - store.scope(state: \.searchResult, action: AddLogic.Action.searchResult) + store.scope(state: \.searchResult, action: \.searchResult) ) { FriendRowCardView(store: $0) } diff --git a/Packages/GodPackage/Sources/AddFeature/FriendRequests.swift b/Packages/GodPackage/Sources/AddFeature/FriendRequests.swift index 08b21e40..99e0d25e 100644 --- a/Packages/GodPackage/Sources/AddFeature/FriendRequests.swift +++ b/Packages/GodPackage/Sources/AddFeature/FriendRequests.swift @@ -68,7 +68,7 @@ public struct FriendRequestsView: View { FriendHeader(title: "FRIEND REQUESTS") ForEachStore( - store.scope(state: \.requests, action: FriendRequestsLogic.Action.requests) + store.scope(state: \.requests, action: \.requests) ) { cardStore in WithViewStore(cardStore, observe: { $0 }) { viewStore in FriendRequestCardView(store: cardStore) diff --git a/Packages/GodPackage/Sources/AddFeature/FriendsOfFriendsPanel.swift b/Packages/GodPackage/Sources/AddFeature/FriendsOfFriendsPanel.swift index b0d9b553..47dde759 100644 --- a/Packages/GodPackage/Sources/AddFeature/FriendsOfFriendsPanel.swift +++ b/Packages/GodPackage/Sources/AddFeature/FriendsOfFriendsPanel.swift @@ -57,7 +57,7 @@ public struct FriendsOfFriendsPanelView: View { FriendHeader(title: "FRIENDS OF FRIENDS") ForEachStore( - store.scope(state: \.friendsOfFriends, action: FriendsOfFriendsPanelLogic.Action.friendsOfFriends) + store.scope(state: \.friendsOfFriends, action: \.friendsOfFriends) ) { cardStore in WithViewStore(cardStore, observe: { $0 }) { viewStore in FriendRowCardView(store: cardStore) diff --git a/Packages/GodPackage/Sources/AddFeature/FromSchoolPanel.swift b/Packages/GodPackage/Sources/AddFeature/FromSchoolPanel.swift index d59f8853..4ff98abd 100644 --- a/Packages/GodPackage/Sources/AddFeature/FromSchoolPanel.swift +++ b/Packages/GodPackage/Sources/AddFeature/FromSchoolPanel.swift @@ -51,7 +51,7 @@ public struct FromSchoolPanelView: View { FriendHeader(title: "FROM SCHOOL") ForEachStore( - store.scope(state: \.users, action: FromSchoolPanelLogic.Action.users) + store.scope(state: \.users, action: \.users) ) { cardStore in WithViewStore(cardStore, observe: { $0 }) { viewStore in FriendRowCardView(store: cardStore) diff --git a/Packages/GodPackage/Sources/AddFeature/InvitationsLeft.swift b/Packages/GodPackage/Sources/AddFeature/InvitationsLeft.swift index b645ff6c..20a23af1 100644 --- a/Packages/GodPackage/Sources/AddFeature/InvitationsLeft.swift +++ b/Packages/GodPackage/Sources/AddFeature/InvitationsLeft.swift @@ -128,7 +128,7 @@ public struct InvitationsLeftView: View { } .task { await store.send(.onTask).finish() } .sheet( - store: store.scope(state: \.$message, action: { .message($0) }), + store: store.scope(state: \.$message, action: \.message }), content: CupertinoMessageView.init ) } diff --git a/Packages/GodPackage/Sources/AppFeature/AppLogic.swift b/Packages/GodPackage/Sources/AppFeature/AppLogic.swift index 587fc231..47ccb032 100644 --- a/Packages/GodPackage/Sources/AppFeature/AppLogic.swift +++ b/Packages/GodPackage/Sources/AppFeature/AppLogic.swift @@ -150,7 +150,7 @@ public struct AppView: View { } public var body: some View { - SwitchStore(store.scope(state: \.view, action: AppLogic.Action.view)) { initialState in + SwitchStore(store.scope(state: \.view, action: \.view)) { initialState in switch initialState { case .launch: CaseLet( diff --git a/Packages/GodPackage/Sources/DeleteAccountFeature/DeleteAccount.swift b/Packages/GodPackage/Sources/DeleteAccountFeature/DeleteAccount.swift index f4b7f0b6..61aaa80b 100644 --- a/Packages/GodPackage/Sources/DeleteAccountFeature/DeleteAccount.swift +++ b/Packages/GodPackage/Sources/DeleteAccountFeature/DeleteAccount.swift @@ -223,12 +223,7 @@ public struct DeleteAccountView: View { } } } - .confirmationDialog( - store: store.scope( - state: \.$confirmationDialog, - action: DeleteAccountLogic.Action.confirmationDialog - ) - ) + .confirmationDialog(store: store.scope(state: \.$confirmationDialog, action: \.confirmationDialog)) } } } diff --git a/Packages/GodPackage/Sources/GodFeature/God.swift b/Packages/GodPackage/Sources/GodFeature/God.swift index 82e811c2..e598f02f 100644 --- a/Packages/GodPackage/Sources/GodFeature/God.swift +++ b/Packages/GodPackage/Sources/GodFeature/God.swift @@ -207,7 +207,7 @@ public struct GodView: View { } public var body: some View { - SwitchStore(store.scope(state: \.child, action: GodLogic.Action.child)) { initialState in + SwitchStore(store.scope(state: \.child, action: \.child)) { initialState in switch initialState { case .poll: CaseLet( diff --git a/Packages/GodPackage/Sources/InboxFeature/Inbox.swift b/Packages/GodPackage/Sources/InboxFeature/Inbox.swift index 50a92a49..17c7cee9 100644 --- a/Packages/GodPackage/Sources/InboxFeature/Inbox.swift +++ b/Packages/GodPackage/Sources/InboxFeature/Inbox.swift @@ -313,7 +313,7 @@ public struct InboxView: View { BannerCard(banner: banner) } IfLetStore( - store.scope(state: \.notificationsReEnable, action: InboxLogic.Action.notificationsReEnable), + store.scope(state: \.notificationsReEnable, action: \.notificationsReEnable), then: NotificationsReEnableView.init(store:) ) List { @@ -323,7 +323,7 @@ public struct InboxView: View { } } - FromGodTeamCard(store: store.scope(state: \.fromGodTeamCard, action: InboxLogic.Action.fromGodTeamCard)) + FromGodTeamCard(store: store.scope(state: \.fromGodTeamCard, action: \.fromGodTeamCard)) Spacer() .listRowSeparator(.hidden) diff --git a/Packages/GodPackage/Sources/ManageAccountFeature/ManageAccount.swift b/Packages/GodPackage/Sources/ManageAccountFeature/ManageAccount.swift index 898550d7..01e2dabe 100644 --- a/Packages/GodPackage/Sources/ManageAccountFeature/ManageAccount.swift +++ b/Packages/GodPackage/Sources/ManageAccountFeature/ManageAccount.swift @@ -94,7 +94,7 @@ public struct ManageAccountView: View { } .navigationTitle(Text("Manage Account", bundle: .module)) .navigationBarTitleDisplayMode(.inline) - .confirmationDialog(store: store.scope(state: \.$confirmationDialog, action: { .confirmationDialog($0) })) + .confirmationDialog(store: store.scope(state: \.$confirmationDialog, action: \.confirmationDialog)) .toolbar { ToolbarItem(placement: .navigationBarLeading) { Button { diff --git a/Packages/GodPackage/Sources/NavigationFeature/RootNavigation.swift b/Packages/GodPackage/Sources/NavigationFeature/RootNavigation.swift index 61dc4624..46b89707 100644 --- a/Packages/GodPackage/Sources/NavigationFeature/RootNavigation.swift +++ b/Packages/GodPackage/Sources/NavigationFeature/RootNavigation.swift @@ -141,56 +141,26 @@ public struct RootNavigationView: View { public var body: some View { WithViewStore(store, observe: { $0 }) { viewStore in TabView(selection: viewStore.$selectedTab) { - AddView( - store: store.scope( - state: \.add, - action: RootNavigationLogic.Action.add - ) - ) + AddView(store: store.scope(state: \.add, action: \.add)) .padding(.top, 52) .tag(RootNavigationLogic.Tab.add) - ActivityView( - store: store.scope( - state: \.activity, - action: RootNavigationLogic.Action.activity - ) - ) + ActivityView(store: store.scope(state: \.activity, action: \.activity)) .padding(.top, 52) .tag(RootNavigationLogic.Tab.activity) - InboxView( - store: store.scope( - state: \.inbox, - action: RootNavigationLogic.Action.inbox - ) - ) + InboxView(store: store.scope(state: \.inbox, action: \.inbox)) .padding(.top, 52) .tag(RootNavigationLogic.Tab.inbox) - GodView( - store: store.scope( - state: \.god, - action: RootNavigationLogic.Action.god - ) - ) + GodView(store: store.scope(state: \.god, action: \.god)) .tag(RootNavigationLogic.Tab.god) - ProfileView( - store: store.scope( - state: \.profile, - action: RootNavigationLogic.Action.profile - ) - ) + ProfileView(store: store.scope(state: \.profile, action: \.profile)) .padding(.top, 52) .tag(RootNavigationLogic.Tab.profile) - AboutView( - store: store.scope( - state: \.about, - action: RootNavigationLogic.Action.about - ) - ) + AboutView(store: store.scope(state: \.about, action: \.about)) .padding(.top, 52) .tag(RootNavigationLogic.Tab.about) } @@ -205,12 +175,12 @@ public struct RootNavigationView: View { } .overlay { IfLetStore( - store.scope(state: \.tutorial, action: RootNavigationLogic.Action.tutorial), + store.scope(state: \.tutorial, action: \.tutorial), then: TutorialView.init(store:) ) } .sheet( - store: store.scope(state: \.$friendRequestSheet, action: RootNavigationLogic.Action.friendRequestSheet) + store: store.scope(state: \.$friendRequestSheet, action: \.friendRequestSheet) ) { store in FriendRequestSheetView(store: store) .presentationBackground(Color.clear) diff --git a/Packages/GodPackage/Sources/OnboardFeature/AddFriends.swift b/Packages/GodPackage/Sources/OnboardFeature/AddFriends.swift index 5f26b44e..32d8902a 100644 --- a/Packages/GodPackage/Sources/OnboardFeature/AddFriends.swift +++ b/Packages/GodPackage/Sources/OnboardFeature/AddFriends.swift @@ -399,7 +399,7 @@ public struct AddFriendsView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .sheet( - store: store.scope(state: \.$message, action: { .message($0) }), + store: store.scope(state: \.$message, action: \.message), content: CupertinoMessageView.init ) .toolbar { diff --git a/Packages/GodPackage/Sources/OnboardFeature/Onboard.swift b/Packages/GodPackage/Sources/OnboardFeature/Onboard.swift index 458fc07e..a1bbc17c 100644 --- a/Packages/GodPackage/Sources/OnboardFeature/Onboard.swift +++ b/Packages/GodPackage/Sources/OnboardFeature/Onboard.swift @@ -176,8 +176,8 @@ public struct OnboardView: View { } public var body: some View { - NavigationStackStore(store.scope(state: \.path, action: { .path($0) })) { - WelcomeView(store: store.scope(state: \.welcome, action: OnboardLogic.Action.welcome)) + NavigationStackStore(store.scope(state: \.path, action: \.path)) { + WelcomeView(store: store.scope(state: \.welcome, action: \.welcome)) } destination: { store in switch store { case .gradeSetting: diff --git a/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift b/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift index 043acc0f..ebe52f0f 100644 --- a/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift +++ b/Packages/GodPackage/Sources/OnboardFeature/PhoneNumber.swift @@ -157,7 +157,7 @@ public struct PhoneNumberView: View { .navigationBarBackButtonHidden() .alert(store: store.scope(state: \.$alert, action: \.alert)) .sheet( - store: store.scope(state: \.$help, action: PhoneNumberLogic.Action.help), + store: store.scope(state: \.$help, action: \.help), content: { store in PhoneNumberHelpView(store: store) .presentationDetents([.medium]) diff --git a/Packages/GodPackage/Sources/PollFeature/Poll.swift b/Packages/GodPackage/Sources/PollFeature/Poll.swift index 07fffcd1..8fc93225 100644 --- a/Packages/GodPackage/Sources/PollFeature/Poll.swift +++ b/Packages/GodPackage/Sources/PollFeature/Poll.swift @@ -182,7 +182,7 @@ public struct PollView: View { ScrollView(showsIndicators: false) { LazyVStack(spacing: 0) { ForEachStore( - store.scope(state: \.pollQuestions, action: PollLogic.Action.pollQuestions) + store.scope(state: \.pollQuestions, action: \.pollQuestions) ) { store in WithViewStore(store, observe: \.id) { id in PollQuestionView(store: store) diff --git a/Packages/GodPackage/Sources/ProfileShareFeature/ShareProfileToInstagramPopup.swift b/Packages/GodPackage/Sources/ProfileShareFeature/ShareProfileToInstagramPopup.swift index 57d08dae..0e5e1c58 100644 --- a/Packages/GodPackage/Sources/ProfileShareFeature/ShareProfileToInstagramPopup.swift +++ b/Packages/GodPackage/Sources/ProfileShareFeature/ShareProfileToInstagramPopup.swift @@ -91,7 +91,7 @@ public struct ShareProfileToInstagramPopupView: View { SwitchStore( store.scope( state: \.currentPage, - action: ShareProfileToInstagramPopupLogic.Action.page + action: \.page ) ) { store in switch store { diff --git a/Packages/GodPackage/Sources/ShopFeature/Shop.swift b/Packages/GodPackage/Sources/ShopFeature/Shop.swift index bd25fe80..3c42c7ed 100644 --- a/Packages/GodPackage/Sources/ShopFeature/Shop.swift +++ b/Packages/GodPackage/Sources/ShopFeature/Shop.swift @@ -223,12 +223,7 @@ public struct ShopView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .alert(store: store.scope(state: \.$alert, action: \.alert)) - .fullScreenCover( - store: store.scope( - state: \.$pickFriend, - action: ShopLogic.Action.pickFriend - ) - ) { store in + .fullScreenCover(store: store.scope(state: \.$pickFriend, action: \.pickFriend)) { store in NavigationStack { PickFriendToAddYourNameTheirPollView(store: store) } From 914fb27a6c8ea6bb7f9e99034fddf14ef41eaa14 Mon Sep 17 00:00:00 2001 From: tomokisun Date: Wed, 29 Nov 2023 09:25:07 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Packages/GodPackage/Sources/ShopFeature/Shop.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Packages/GodPackage/Sources/ShopFeature/Shop.swift b/Packages/GodPackage/Sources/ShopFeature/Shop.swift index 3c42c7ed..4a05d823 100644 --- a/Packages/GodPackage/Sources/ShopFeature/Shop.swift +++ b/Packages/GodPackage/Sources/ShopFeature/Shop.swift @@ -223,7 +223,9 @@ public struct ShopView: View { .task { await store.send(.onTask).finish() } .onAppear { store.send(.onAppear) } .alert(store: store.scope(state: \.$alert, action: \.alert)) - .fullScreenCover(store: store.scope(state: \.$pickFriend, action: \.pickFriend)) { store in + .fullScreenCover( + store: store.scope(state: \.$pickFriend, action: \.pickFriend) + ) { store in NavigationStack { PickFriendToAddYourNameTheirPollView(store: store) }