From f97778084aa24ebde13da0786e203bc58146f722 Mon Sep 17 00:00:00 2001 From: Jihyun247 <59338503+Jihyun247@users.noreply.github.com> Date: Mon, 25 Nov 2024 02:18:04 +0900 Subject: [PATCH] =?UTF-8?q?[SCRUM-56]=20=EC=97=90=EB=9F=AC=20=EB=B0=8F=20?= =?UTF-8?q?=EB=A1=9C=EB=94=A9=20=EB=8C=80=EC=9D=91=20=EB=A6=AC=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A7=81=20(#58)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NetworkError/NetworkErrorCore.swift | 1 + .../RequestError/RequestErrorCore.swift | 4 +-- .../Feature/Feature/Sources/AppCore.swift | 1 - .../Feature/Feature/Sources/AppView.swift | 23 +++----------- .../Feature/Sources/Loading/LoadingView.swift | 31 +++++++++++++++++++ .../Sources/Onboarding/OnboardingView.swift | 4 +++ 6 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 Projects/Feature/Feature/Sources/Loading/LoadingView.swift diff --git a/Projects/Feature/ErrorFeature/Sources/NetworkError/NetworkErrorCore.swift b/Projects/Feature/ErrorFeature/Sources/NetworkError/NetworkErrorCore.swift index ea62eac..daf9615 100644 --- a/Projects/Feature/ErrorFeature/Sources/NetworkError/NetworkErrorCore.swift +++ b/Projects/Feature/ErrorFeature/Sources/NetworkError/NetworkErrorCore.swift @@ -28,6 +28,7 @@ public struct NetworkErrorCore { private func core(_ state: inout State, _ action: Action) -> EffectOf { switch action { case .tryAgain: + //TODO: 11.25 재시도 로직 return .none } } diff --git a/Projects/Feature/ErrorFeature/Sources/RequestError/RequestErrorCore.swift b/Projects/Feature/ErrorFeature/Sources/RequestError/RequestErrorCore.swift index 9dc5c4c..767bd62 100644 --- a/Projects/Feature/ErrorFeature/Sources/RequestError/RequestErrorCore.swift +++ b/Projects/Feature/ErrorFeature/Sources/RequestError/RequestErrorCore.swift @@ -35,8 +35,8 @@ public struct RequestErrorCore { case .moveToHome: return .none case .moveToCustomerService: - guard let feedbackURL = URL(string: "https://forms.gle/wEUPH9Tvxgua4hCZ9") else { return .none } - return .run { _ in await self.openURL(feedbackURL) } + guard let kakaoChannelURL = URL(string: "http://pf.kakao.com/_FvuAn") else { return .none } + return .run { _ in await self.openURL(kakaoChannelURL) } } } } diff --git a/Projects/Feature/Feature/Sources/AppCore.swift b/Projects/Feature/Feature/Sources/AppCore.swift index a271976..8646daa 100644 --- a/Projects/Feature/Feature/Sources/AppCore.swift +++ b/Projects/Feature/Feature/Sources/AppCore.swift @@ -161,7 +161,6 @@ public struct AppCore { case .networkError: return .none - // TODO: state 초기화 방법 변경 필요 + 온보딩 첫페이지로 돌아가면 온보딩 carousel 이미지 안뜸 case .requestError(.presented(.moveToHome)): if state.onboarding != nil { state.onboarding = OnboardingCore.State() diff --git a/Projects/Feature/Feature/Sources/AppView.swift b/Projects/Feature/Feature/Sources/AppView.swift index 5d3cf25..67a3827 100644 --- a/Projects/Feature/Feature/Sources/AppView.swift +++ b/Projects/Feature/Feature/Sources/AppView.swift @@ -15,7 +15,6 @@ import OnboardingFeature import ErrorFeature import ComposableArchitecture -import Lottie public struct AppView: View { @Bindable var store: StoreOf @@ -46,23 +45,8 @@ public struct AppView: View { } .transition(.opacity) .animation(.easeInOut, value: store.home == nil) - .onLoad { - store.send(.onLoad) - } .fullScreenCover(isPresented: $store.isLoading) { - VStack { - Spacer() - ZStack { - RoundedRectangle(cornerRadius: Alias.BorderRadius.medium) - .foregroundStyle(Alias.Color.Background.inverse) - .opacity(Global.Opacity._90d) - LottieView(animation: AnimationAsset.lotiSpinner.animation) - .playing(loopMode: .loop) - } - .frame(width: 82, height: 82) - Spacer() - } - .presentationBackground(.clear) + LoadingView() } .fullScreenCover( item: $store.scope( @@ -81,8 +65,11 @@ public struct AppView: View { NetworkErrorView(store: store) } .transaction(value: store.isLoading) { transaction in - // TODO: 11/24, LoadingView 분리 + fullscreen animation disable + // TODO: 11.25 로딩 이외 다른 fullScreen들도 disabled됨 transaction.disablesAnimations = true } + .onLoad { + store.send(.onLoad) + } } } diff --git a/Projects/Feature/Feature/Sources/Loading/LoadingView.swift b/Projects/Feature/Feature/Sources/Loading/LoadingView.swift new file mode 100644 index 0000000..b8cc6bf --- /dev/null +++ b/Projects/Feature/Feature/Sources/Loading/LoadingView.swift @@ -0,0 +1,31 @@ +// +// LoadingView.swift +// Feature +// +// Created by 김지현 on 11/25/24. +// Copyright © 2024 PomoNyang. All rights reserved. +// + +import SwiftUI + +import DesignSystem + +import Lottie + +struct LoadingView: View { + var body: some View { + VStack { + Spacer() + ZStack { + RoundedRectangle(cornerRadius: Alias.BorderRadius.medium) + .foregroundStyle(Alias.Color.Background.inverse) + .opacity(Global.Opacity._90d) + LottieView(animation: AnimationAsset.lotiSpinner.animation) + .playing(loopMode: .loop) + } + .frame(width: 82, height: 82) + Spacer() + } + .presentationBackground(.clear) + } +} diff --git a/Projects/Feature/OnboardingFeature/Sources/Onboarding/OnboardingView.swift b/Projects/Feature/OnboardingFeature/Sources/Onboarding/OnboardingView.swift index a606c7b..b3ebbaf 100644 --- a/Projects/Feature/OnboardingFeature/Sources/Onboarding/OnboardingView.swift +++ b/Projects/Feature/OnboardingFeature/Sources/Onboarding/OnboardingView.swift @@ -66,6 +66,10 @@ public struct OnboardingView: View { .background(Alias.Color.Background.primary) .setFrameMeasure(space: .global, identifier: backgroundFrame) .getFrameMeasure { value in + /* TODO: 11.25 + Onboarding 재 초기화 시 FrameMeasure 관련 모디파이어를 안거침 . ,, 파악중 + getFrameMeasure -> OnDisappear 시에도 거치는 이유는 ? + */ guard let background = value[backgroundFrame] else { return } store.width = background.width }