-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathReleaseDateView.swift
More file actions
44 lines (36 loc) · 1.1 KB
/
ReleaseDateView.swift
File metadata and controls
44 lines (36 loc) · 1.1 KB
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
//
// ReleaseDateView.swift
// Xcodes
//
// Created by Duong Thai on 11/10/2023.
// Copyright © 2023 Robots and Pencils. All rights reserved.
//
import SwiftUI
struct ReleaseDateView: View {
let date: Date?
let url: URL?
var body: some View {
if let date = date {
VStack(alignment: .leading) {
Text("ReleaseDate")
.font(.headline)
Text("\(date, style: .date)")
.font(.subheadline)
if let url {
ReleaseNotesView(url: url)
.padding(.top, 2)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding()
.background(.background)
.clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous))
} else {
EmptyView()
}
}
}
#Preview {
ReleaseDateView(date: Date(), url: URL(string: "https://www.xcodes.app")!)
.padding()
}