Impressia/Vernissage/Widgets/LoadingIndicator.swift

29 lines
719 B
Swift
Raw Normal View History

2023-01-06 13:05:21 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import SwiftUI
2023-01-15 13:03:54 +01:00
import ActivityIndicatorView
2023-01-06 13:05:21 +01:00
struct LoadingIndicator: View {
2023-01-15 13:03:54 +01:00
@Binding var isVisible: Bool
init(isVisible: Binding<Bool> = .constant(true)) {
self._isVisible = isVisible
}
2023-01-09 10:06:21 +01:00
2023-01-06 13:05:21 +01:00
var body: some View {
2023-01-15 13:03:54 +01:00
ActivityIndicatorView(isVisible: $isVisible, type: .equalizer(count: 5))
.frame(width: 36.0, height: 24.0)
.foregroundColor(.lightGrayColor)
2023-01-06 13:05:21 +01:00
}
}
struct LoadingIndicator_Previews: PreviewProvider {
static var previews: some View {
2023-01-15 13:03:54 +01:00
LoadingIndicator(isVisible: .constant(true))
2023-01-06 13:05:21 +01:00
}
}