-
-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathWhatsNewView.swift
107 lines (92 loc) · 2.96 KB
/
WhatsNewView.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//
// WhatsNewView.swift
//
//
// Created by Strongbox on 22/12/2024.
//
import Foundation
import MarkdownUI
import SwiftUI
struct WhatsNewView: View {
let messages: [WhatsNewMessage]
var dismiss: () -> Void
var body: some View {
VStack {
VStack {
Group {
HStack {
Image(systemName: "gift")
.font(Font.system(size: 30, weight: .bold))
.minimumScaleFactor(0.2)
Text("whats_new_title")
.font(Font.system(size: 40, weight: .bold))
.minimumScaleFactor(0.2)
.lineLimit(1)
}
}
.foregroundStyle(
LinearGradient(
colors: [.blue, .green, .yellow],
startPoint: .leading,
endPoint: .trailing
)
)
Text("whats_new_subtitle")
.font(.subheadline)
}
.padding([.horizontal, .top])
List {
ForEach(messages) { message in
Section {
Markdown(message.markdownBody)
}
header: {
Text(message.version)
.font(.headline)
}
}
}
Button {
dismiss()
} label: {
Text("OK")
.font(.headline)
}
.padding()
}
.overlay(alignment: .topTrailing) {
Button {
dismiss()
}
label: {
Image(systemName: "x.circle")
.foregroundStyle(.gray)
.font(.system(size: 22))
}
.padding([.trailing, .top])
}
}
}
#Preview {
let markdownBody =
"""
#### Apple Watch App
- You can now sync individual entries from your databases to your Apple Watch.
- Install the Strongbox App on your watch to get started...
#### 2FA Code Improvements
- We've improved 2FA Code display and animation. We hope you'll like it!
"""
let markdownBody2 =
"""
#### Some Other Feature
- You can now sync individual entries from your databases to your Apple Watch.
- Install the Strongbox App on your watch to get started...
#### And Also...
- We've improved 2FA Code display and animation. We hope you'll like it!
"""
let messages: [WhatsNewMessage] = [
WhatsNewMessage(sequenceNumber: 0, version: "1.60.29", markdownBody: markdownBody2),
WhatsNewMessage(sequenceNumber: 1, version: "1.60.30", markdownBody: markdownBody),
]
return WhatsNewView(messages: messages.reversed()) {}
}