Newer Older
41 lines | 1.122kb
Bogdan Timofte authored a week ago
1
//
2
//  SidebarLinkCardView.swift
3
//  USB Meter
4
//
5

            
6
import SwiftUI
7

            
8
struct SidebarLinkCardView: View {
9
    let title: String
Bogdan Timofte authored a week ago
10
    let subtitle: String?
Bogdan Timofte authored a week ago
11
    let symbol: String
12
    let tint: Color
13

            
14
    var body: some View {
15
        HStack(spacing: 14) {
16
            Image(systemName: symbol)
17
                .font(.system(size: 18, weight: .semibold))
18
                .foregroundColor(tint)
19
                .frame(width: 42, height: 42)
20
                .background(Circle().fill(tint.opacity(0.18)))
21

            
Bogdan Timofte authored a week ago
22
            VStack(alignment: .leading, spacing: subtitle == nil ? 0 : 4) {
Bogdan Timofte authored a week ago
23
                Text(title)
24
                    .font(.headline)
Bogdan Timofte authored a week ago
25
                if let subtitle {
26
                    Text(subtitle)
27
                        .font(.caption)
28
                        .foregroundColor(.secondary)
29
                }
Bogdan Timofte authored a week ago
30
            }
31

            
32
            Spacer()
33

            
34
            Image(systemName: "chevron.right")
35
                .font(.footnote.weight(.bold))
36
                .foregroundColor(.secondary)
37
        }
38
        .padding(14)
39
        .meterCard(tint: tint, fillOpacity: 0.16, strokeOpacity: 0.22, cornerRadius: 18)
40
    }
Bogdan Timofte authored a week ago
41
}