experiments

This commit is contained in:
eevee committed 2025-06-18 00:51:01 +03:00
1 parent 92e6cc7900
commit a994490604
36 files changed
+264 -64

No files matched your search

@@ -0,0 +1,25 @@
import SwiftUI
struct DynamicIconModifier: ViewModifier {
var systemName: String
var color: Color
@Binding var condition: Bool
func body(content: Content) -> some View {
HStack {
if condition {
Image(systemName: systemName)
.font(.title2)
.foregroundColor(color)
}
content
}
}
}
extension View {
func icon(_ systemName: String, color: Color, when condition: Binding<Bool>) -> some View {
modifier(DynamicIconModifier(systemName: systemName, color: color, condition: condition))
}
}