@@ -9,6 +9,8 @@ import UIKit
9
9
import SwiftUI
10
10
11
11
public struct LicenseListView : View {
12
+ @Environment ( \. licenseListViewStyle) private var licenseListViewStyle : LicenseListViewStyle
13
+
12
14
let libraries : [ Library ]
13
15
let useUINavigationController : Bool
14
16
let navigationHandler : ( ( Library ) -> Void ) ?
@@ -28,10 +30,11 @@ public struct LicenseListView: View {
28
30
}
29
31
libraries = ( dict [ " libraries " ] as? [ [ String : Any ] ] ) ? . compactMap ( { info -> Library ? in
30
32
guard let name = info [ " name " ] as? String ,
33
+ let url = info [ " url " ] as? String ,
31
34
let body = info [ " licenseBody " ] as? String else {
32
35
return nil
33
36
}
34
- return Library ( name: name, licenseBody: body)
37
+ return Library ( name: name, url : url , licenseBody: body)
35
38
} ) ?? [ ]
36
39
}
37
40
@@ -62,11 +65,17 @@ public struct LicenseListView: View {
62
65
@ViewBuilder
63
66
func libraryNavigationLink( _ library: Library ) -> some View {
64
67
if #available( iOS 15 , * ) {
65
- NavigationLink ( destination: LicenseView ( library: library) ) {
68
+ NavigationLink {
69
+ LicenseView ( library: library)
70
+ . licenseListViewStyle ( licenseListViewStyle)
71
+ } label: {
66
72
Text ( library. name)
67
73
}
68
74
} else {
69
- NavigationLink ( destination: LegacyLicenseView ( library: library) ) {
75
+ NavigationLink {
76
+ LegacyLicenseView ( library: library)
77
+ . licenseListViewStyle ( licenseListViewStyle)
78
+ } label: {
70
79
Text ( library. name)
71
80
}
72
81
}
0 commit comments