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
10 changes: 6 additions & 4 deletions Keychy/Keychy/Core/Components/Alerts/LoadingAlert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ import SwiftUI
import Lottie

enum LoadingType {
case short
case short30
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

개인적으로 short30, short40 보다는 피그마에서처럼 shortS, shortM이 좀 더 사용하기엔 직관적인 것 같지만
개발자(?) 입장에서 어떻게 보면 단순하게 크기가 30, 40이니까 이것도 좋네요. 통과ㅎㅎㅎ

case short40
case longWithKeychy
case longWithPresent

var lottieFileName: String {
switch self {
case .short: return "shotLoading"
case .short30, .short40: return "shotLoading"
case .longWithKeychy: return "longLoadingKeychy"
case .longWithPresent: return "longLoadingPresent"
}
}

var frameSize: CGFloat {
switch self {
case .short: return 48
case .short30: return 30
case .short40: return 40
case .longWithKeychy: return 122
case .longWithPresent: return 122
}
Expand All @@ -51,7 +53,7 @@ struct LoadingAlert: View {
)
.frame(width: type.frameSize, height: type.frameSize)

if type != .short, let message = message {
if type != .short30 && type != .short40, let message = message {
Text(message)
.typography(.suit17SB)
.textOutline(color: .white100, width: 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct ItemDetailImage: View {

// 로딩 중앙 배치
if isLoading {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
isLoading = false
Expand Down Expand Up @@ -173,8 +173,7 @@ struct SimpleAnimatedImage: View {
if isLoading {
Color.gray50
.overlay {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.5)
LoadingAlert(type: .short40, message: nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ extension BundleCreateView {
} label: {
HStack(spacing: 5) {
if isPurchasing {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.8)
LoadingAlert(type: .short40, message: nil)
} else {
Image(.purchaseSheet)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ extension BundleEditView {
} label: {
HStack(spacing: 5) {
if isPurchasing {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.8)
LoadingAlert(type: .short40, message: nil)
} else {
Image(.purchaseSheet)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extension BundleEditView {

if isKeyringSheetLoading {
VStack {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.padding(.vertical, 24)
Text("키링을 불러오고 있어요")
.typography(.suit15R)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ struct BackgroundSelectableCell: View {
.scaledToFill()
.clipped()
} else if state.isLoading {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.5)
LoadingAlert(type: .short30, message: nil)
}
}
.frame(width: threeSquareGridCellSize, height: threeSquareGridCellSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ struct CarabinerSelectableCell: View {
.scaledToFit()
.clipped()
} else if state.isLoading {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.5)
LoadingAlert(type: .short30, message: nil)
} else {
Color.clear
.aspectRatio(1, contentMode: .fit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extension KeyringBundleItem {
return Group {
if isCapturing {
// 캡처 중 ProgressView
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
} else if let cachedImage = cachedImage {
cachedImage
.resizable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extension CollectionKeyringDetailView {
}

if showCopyingAlert {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.zIndex(101)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct CollectionKeyringDetailView: View {
Color.black20
.ignoresSafeArea()

LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.zIndex(200)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct CollectionKeyringPackageView: View {
Color.black20
.ignoresSafeArea()

LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.zIndex(101)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ extension KeyringEditView {
Color.black20
.overlay {
VStack(spacing: 8) {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.4)
LoadingAlert(type: .short40, message: nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,8 @@ extension PackagedKeyringView {
)
} else {
// 이미지 로딩 중
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.frame(width: 195, height: 300)
.scaleEffect(0.6)
}
}
}
Expand Down Expand Up @@ -299,9 +298,8 @@ extension PackagedKeyringView {
.scaledToFit()
.frame(width: 205, height: 205)
} else {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.frame(width: 205, height: 205)
.scaleEffect(0.6)
}
}
.offset(x: -3, y: -24)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ struct CollectionCellView: View {
if isLoading && cachedImage == nil {
Color.gray50
.overlay {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.7)
LoadingAlert(type: .short40, message: nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension KeyringCollectView {
}

private func loadingOverlay(geometry: GeometryProxy) -> some View {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.position(
x: geometry.size.width / 2,
y: geometry.size.height / 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct KeyringCollectView: View {
private func contentView(heightRatio: CGFloat, isSmallScreen: Bool) -> some View {
VStack(spacing: 0) {
if viewModel.isLoading {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.frame(maxWidth: .infinity, maxHeight: .infinity)

} else if let keyring = viewModel.keyring {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extension KeyringReceiveView {
}

private func loadingOverlay(geometry: GeometryProxy) -> some View {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.position(
x: geometry.size.width / 2,
y: geometry.size.height / 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct KeyringReceiveView: View {
private func contentView(heightRatio: CGFloat, isSmallScreen: Bool) -> some View {
VStack(spacing: 0) {
if viewModel.isLoading {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.frame(maxWidth: .infinity, maxHeight: .infinity)

} else if viewModel.isAlreadyReceived {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension FestivalKeyringDetailView {
}

if showCopyingAlert {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.zIndex(101)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct FestivalKeyringDetailView: View {
Color.black20
.ignoresSafeArea()

LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.zIndex(200)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ extension Showcase25BoardView {
// 다른 사람이 수정 중인 경우
let maskedName = viewModel.maskedNickname(editingKeyring.editingUserNickname)
ZStack {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.5)
LoadingAlert(type: .short30, message: nil)
VStack {
Spacer()
Text("\(maskedName)님\n수정중")
Expand Down Expand Up @@ -103,8 +102,7 @@ extension Showcase25BoardView {
Image(systemName: "photo")
.foregroundStyle(.gray300)
} else {
LoadingAlert(type: .short, message: nil)
.scaleEffect(0.5)
LoadingAlert(type: .short30, message: nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct NotificationGiftView: View {
if viewModel.hasNetworkError {
networkErrorView
} else if viewModel.isLoading || viewModel.isCapturing {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
} else if let error = viewModel.loadError {
VStack {
Text("선물 정보를 불러올 수 없습니다")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ extension ChangeNameView {
Group {
// 업데이트 중 로딩
if viewModel.isUpdating {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}

// 성공 Alert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ extension MyPageView {
private var alerts: some View {
Group {
if viewModel.showLoadingAlert {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct ProfileSetupCompleteView: View {
.blur(radius: isSaving ? 15 : 0)

if isSaving {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
.background(.white100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct CoinChargeView<Route: Hashable>: View {

// 코인 구매 로딩
if isCoinPurchasing {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
.task {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ extension PreviewGuiding {
// 로딩 중앙 배치
LazyImage(url: URL(string: guidingImageURL)) { state in
if state.isLoading {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ struct TemplatePreviewBody: View {

// 구매 중 로딩
if showPurchasingLoading {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}

// 구매 성공 알림
Expand Down Expand Up @@ -187,7 +187,7 @@ extension TemplatePreviewBody {
.scaledToFit()
.frame(width: 386, height: 386)
} else {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
.frame(maxHeight: 500)
Expand Down Expand Up @@ -226,7 +226,7 @@ extension TemplatePreviewBody {
}
)
} else {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ struct KeyringCustomizingView<VM: KeyringViewModelProtocol>: View {

// MARK: - 구매 중 로딩
if showPurchaseProgress {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.zIndex(101)
}

// MARK: - 합성 중 로딩
if viewModel.isComposing {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.zIndex(101)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct AcrylicPhotoCropView: View {

// 로딩 인디케이터
if isImageLoading {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}

customNavigationBar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct ClearSketchCropView: View {
if let bodyImage = viewModel.bodyImage {
cropCanvasView(image: bodyImage, geometry: geometry)
} else {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct FramePreviewView: View {

// 로딩 중일 때
if !isFrameLoaded {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
}
Expand Down Expand Up @@ -227,7 +227,7 @@ struct FramePreviewView: View {
// 프레임 크기 계산
LazyImage(url: URL(string: frame.frameURL)) { state in
if state.isLoading {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
.frame(height: targetFrameHeight)
} else if let image = state.image {
let frameAspect = (state.imageContainer?.image.size.width ?? 1) / (state.imageContainer?.image.size.height ?? 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct SpeechBubbleFramePreviewView: View {

// 로딩 중일 때
if !isFrameLoaded {
LoadingAlert(type: .short, message: nil)
LoadingAlert(type: .short40, message: nil)
}
}
}
Expand Down
Loading