-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathTagView.swift
48 lines (42 loc) · 1.06 KB
/
TagView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// TagView.swift
// Strongbox
//
// Created by Strongbox on 27/07/2024.
// Copyright © 2024 Mark McGuill. All rights reserved.
//
import Foundation
import SwiftUI
struct TagView: View {
var title: String
var font: Font
var body: some View {
HStack(spacing: 2) {
Image(systemName: "tag")
.font(.subheadline)
Text(title)
.lineLimit(1)
.font(font)
}
.padding(.trailing, 10)
.padding(.leading, 6)
.padding(.vertical, 4)
.foregroundStyle(.white)
.background(.blue)
.clipShape(Capsule())
.shadow(radius: 1)
}
}
#Preview {
#if os(iOS)
let font2 = Font(FontManager.sharedInstance().easyReadFont)
#else
let font2 = Font(FontManager.shared.easyReadFont)
#endif
return VStack {
TagView(title: "Test", font: font2)
TagView(title: "Test with a long title", font: font2)
TagView(title: "Super Word", font: font2)
TagView(title: "Testing #1", font: font2)
}
}