feat(refresh): Lottie 새로고침 표시를 적용한다
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import SwiftUI
|
||||
|
||||
import Lottie
|
||||
|
||||
struct LottieRefreshIndicator: View {
|
||||
let isAnimating: Bool
|
||||
|
||||
@Environment(\.accessibilityReduceMotion) private var accessibilityReduceMotion
|
||||
|
||||
var body: some View {
|
||||
let animation = LottieView(animation: .named("pull-to-refresh"))
|
||||
.configure(\.contentMode, to: .scaleAspectFit)
|
||||
.resizable()
|
||||
|
||||
Group {
|
||||
if accessibilityReduceMotion {
|
||||
animation.currentFrame(1)
|
||||
} else if isAnimating {
|
||||
animation.looping()
|
||||
} else {
|
||||
animation.currentFrame(0)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: SodaSpacing.s48, maxHeight: SodaSpacing.s48)
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user