mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
lrclib api option, many improvements and refactoring
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user