~ knotless Search/
↑↓ move↵ open⇧↵ all results

geesawra.industries/old-fella

Old people's social media app

0
1
main
25 lines · 728 B Raw History
import SwiftUI

enum ImageBorderStyle {
    static let width: CGFloat = 1.75
}

extension EnvironmentValues {
    @Entry var showsTimelineImageBorders = false
}

struct ImageBorder<BorderShape: InsettableShape>: View {
    @Environment(\.colorScheme) private var colorScheme
    @Environment(\.showsTimelineImageBorders) private var showsBorder
    let shape: BorderShape
    let colors: AvatarRingColors

    var body: some View {
        if showsBorder {
            let color = colorScheme == .dark ? colors.dark : colors.light
            shape.strokeBorder(Color(uiColor: color.color), lineWidth: ImageBorderStyle.width)
                .allowsHitTesting(false)
                .accessibilityHidden(true)
        }
    }
}