Skip to content

Commit

Permalink
🔀 Merge branch 'ladislas/feature/contentkit-activity-optional-subtitle'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Feb 26, 2024
2 parents 8f023a1 + 06ced38 commit 7aa1ee6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct ActivityDetailsView: View {
Section("Details (in: \(l10n.language.identifier))") {
Text(self.activity.details.title)
.font(.title)
Text(self.activity.details.subtitle)
Text(self.activity.details.subtitle ?? "no subtitle")
.font(.title2)
Markdown(self.activity.details.description)
.markdownTheme(.gitHub)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ l10n:
icon: sample_6

title: Activité d'exemple 6
subtitle: pour le développement
subtitle: null

short_description: >
Nunc Corinthiaci anilem, rerum primo et ambos fata? Et Drya aliis abest, *adeunt
Expand Down Expand Up @@ -74,7 +74,7 @@ l10n:
icon: sample_6

title: Sample activity 6
subtitle: for development
subtitle: null

short_description: >
Nunc Corinthiaci anilem, rerum primo et ambos fata? Et Drya aliis abest, *adeunt
Expand Down
2 changes: 1 addition & 1 deletion Modules/ContentKit/Sources/Activity/Activity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public extension Activity {

public let icon: String
public let title: String
public let subtitle: String
public let subtitle: String?
public let shortDescription: String
public let description: String
public let instructions: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ public struct ActivityDetailsView: View {
.font(.largeTitle)
.bold()

Text(self.activity.details.subtitle)
.font(.title2)
.foregroundColor(.secondary)
if let subtitle = self.activity.details.subtitle {
Text(subtitle)
.font(.title2)
.foregroundColor(.secondary)
}

Text(self.activity.details.shortDescription)
.font(.subheadline)
Expand Down
3 changes: 2 additions & 1 deletion Specs/jtd/activity.jtd.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
"type": "string"
},
"subtitle": {
"type": "string"
"type": "string",
"nullable": true
},
"short_description": {
"type": "string"
Expand Down

0 comments on commit 7aa1ee6

Please sign in to comment.