pr suggestions

This commit is contained in:
Mauro Romito
2025-06-05 16:53:10 +02:00
committed by Mauro
parent 248e88e718
commit 26a7d5ac82
13 changed files with 41 additions and 23 deletions
@@ -0,0 +1,35 @@
//
// Copyright 2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Compound
import SwiftUI
struct HorizontalHighlightGradient: ViewModifier {
let borderColor: Color
let primaryColor: Color
let secondaryColor: Color
func body(content: Content) -> some View {
ZStack(alignment: .top) {
VStack(spacing: 0) {
borderColor
.frame(height: 1)
LinearGradient(colors: [primaryColor, secondaryColor],
startPoint: .top,
endPoint: .bottom)
}
content
.layoutPriority(1)
}
}
}
extension View {
func highlight(borderColor: Color, primaryColor: Color, secondaryColor: Color) -> some View {
modifier(HorizontalHighlightGradient(borderColor: borderColor, primaryColor: primaryColor, secondaryColor: secondaryColor))
}
}