Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

ensu ios: guard Rive import with fallback illustration

Prateek Sunal1150f1c7da21
diff --git a/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swift b/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swift
index 50c1826bb7..441349e4b5 100644
--- a/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swift
+++ b/mobile/native/darwin/Apps/ensu/ensu/Components/EnsuBrandIllustration.swift
@@ -1,4 +1,6 @@
import SwiftUI
+
+#if canImport(RiveRuntime)
import RiveRuntime
struct EnsuBrandIllustration: View {
@@ -35,3 +37,38 @@ struct EnsuBrandIllustration: View {
.accessibilityLabel("Ensu")
}
}
+
+#else
+
+struct EnsuBrandIllustration: View {
+ var width: CGFloat = 92
+ var height: CGFloat = 42
+ var animated: Bool = true
+
+ @State private var isAnimating = false
+
+ var body: some View {
+ let activePhase = animated ? isAnimating : true
+
+ Image("EnsuLogoForeground")
+ .resizable()
+ .scaledToFit()
+ .frame(width: width, height: height, alignment: .leading)
+ .scaleEffect(activePhase ? 1 : 0.94)
+ .opacity(activePhase ? 1 : 0.84)
+ .animation(
+ animated ? .easeInOut(duration: 0.9).repeatForever(autoreverses: true) : nil,
+ value: isAnimating
+ )
+ .onAppear {
+ guard animated else { return }
+ isAnimating = true
+ }
+ .onDisappear {
+ isAnimating = false
+ }
+ .accessibilityLabel("Ensu")
+ }
+}
+
+#endif