Simplify LicensesView documentation pattern
This commit is contained in:
parent
9a0ebe2f55
commit
7c04a25fc2
@ -493,13 +493,14 @@ SettingsNavigationRow(
|
||||
|
||||
A reusable view for displaying open source licenses used in your app.
|
||||
|
||||
**Step 1: Define licenses in your app**
|
||||
**Create an app-specific wrapper view with licenses**
|
||||
|
||||
```swift
|
||||
import SwiftUI
|
||||
import Bedrock
|
||||
|
||||
extension License {
|
||||
static let appLicenses: [License] = [
|
||||
struct AppLicensesView: View {
|
||||
private static let licenses: [License] = [
|
||||
License(
|
||||
name: "MijickCamera",
|
||||
url: "https://github.com/Mijick/Camera",
|
||||
@ -513,16 +514,10 @@ extension License {
|
||||
description: "In-app subscriptions made easy."
|
||||
)
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Step 2: Create app-specific wrapper view**
|
||||
|
||||
```swift
|
||||
struct AppLicensesView: View {
|
||||
|
||||
var body: some View {
|
||||
LicensesView(
|
||||
licenses: License.appLicenses,
|
||||
licenses: Self.licenses,
|
||||
backgroundColor: AppSurface.overlay,
|
||||
cardBackgroundColor: AppSurface.card,
|
||||
cardBorderColor: AppBorder.subtle,
|
||||
@ -532,7 +527,7 @@ struct AppLicensesView: View {
|
||||
}
|
||||
```
|
||||
|
||||
**Step 3: Navigate to it from settings**
|
||||
**Navigate to it from settings**
|
||||
|
||||
```swift
|
||||
SettingsNavigationRow(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user