Skip to content

Commit

Permalink
[FIX/#177] PlatProcessing 컴포넌트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkySide committed Nov 3, 2024
1 parent 21115f2 commit d627eb2
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 132 deletions.
6 changes: 5 additions & 1 deletion PLAT/PLAT/Component/PlatProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import SwiftUI

struct PlatProgressView: View {

let isLoading: Bool

var body: some View {
ZStack {
Rectangle()
Expand All @@ -21,9 +24,10 @@ struct PlatProgressView: View {
.tint(.primary)
}
.ignoresSafeArea()
.opacity(isLoading ? 1 : 0)
}
}

#Preview {
PlatProgressView()
PlatProgressView(isLoading: true)
}
29 changes: 17 additions & 12 deletions PLAT/PLAT/Component/ToastMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,25 @@ struct ToastMessage: View {
@Binding private(set) var isToastPresented: Bool

var body: some View {
HStack(spacing: 18) {
Image(systemName: SystemImage.exclamationmark)
.resizable()
.frame(width: 24, height: 24)
.foregroundStyle(.platPurple)
VStack {
Spacer()

Text(message)
.foregroundStyle(.white)
.font(.Body.body1)
HStack(spacing: 18) {
Image(systemName: SystemImage.exclamationmark)
.resizable()
.frame(width: 24, height: 24)
.foregroundStyle(.platPurple)

Text(message)
.foregroundStyle(.white)
.font(.Body.body1)
}
.padding(.horizontal, 24)
.padding(.vertical, 22)
.background(.platBlack)
.clipShape(RoundedRectangle(cornerRadius: 40))
}
.padding(.horizontal, 24)
.padding(.vertical, 22)
.background(.platBlack)
.clipShape(RoundedRectangle(cornerRadius: 40))
.padding(.bottom, 30)
.opacity(opacity)
.onChange(of: isToastPresented) { _, flag in
if flag { toggleToast() }
Expand Down
5 changes: 1 addition & 4 deletions PLAT/PLAT/Presentaion/Register/SelectStreamAccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ struct SelectStreamAccountView: View {
.navigationTitle("스트리밍 계정 선택하기")
.navigationBarTitleDisplayMode(.inline)
.navigationBarBackButtonHidden()
.overlay(
musicControlUseCase.state.isLoading
? AnyView(PlatProgressView()) : AnyView(EmptyView())
)
.overlay(PlatProgressView(isLoading: musicControlUseCase.state.isLoading))
.alert("일시적인 오류로 계정 연결에 실패했습니다. 다시 시도해주세요.", isPresented: $isConnectFailedAlertPresented) {
AlertActionButton(variant: .confim)
}
Expand Down
7 changes: 2 additions & 5 deletions PLAT/PLAT/Presentaion/Register/SignUpOrInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct SignUpOrInView: View {
@State private var isLoginFailedAlertPresented = false

var body: some View {
ZStack {
Group {
if authUseCase.state.authType == .signUp {
SignUpView(
isLoading: $isLoading,
Expand All @@ -31,11 +31,8 @@ struct SignUpOrInView: View {
isLoginFailedAlertPresented: $isLoginFailedAlertPresented
)
}

if isLoading {
PlatProgressView()
}
}
.overlay(PlatProgressView(isLoading: isLoading))
.tint(.white)
.toolbarRole(.editor)
.navigationBarTitleDisplayMode(.inline)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ struct TrackAppendSearchSheet: View {
}
}
}
.overlay(
PlatProgressView()
.opacity(isLoading ? 1 : 0)
)
.overlay(PlatProgressView(isLoading: isLoading))
.onSubmit {
recentSearchTermList.append(searchTerm)
UserDefaults.standard.recentSearchTermList = recentSearchTermList
Expand Down
Loading

0 comments on commit d627eb2

Please sign in to comment.