Skip to content

Commit

Permalink
#92 Fix TimelineStyle targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailgulek committed Jun 24, 2022
1 parent d065cb3 commit d7a7e02
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 68 deletions.
94 changes: 49 additions & 45 deletions ElementX.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions ElementX/Sources/Screens/RoomScreen/View/Style/TimelineStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,4 @@ import Foundation
enum TimelineStyle: String, CaseIterable {
case plain
case bubbled

var shortDescription: String {
switch self {
case .plain:
return ElementL10n.roomTimelineStylePlainShortDescription
case .bubbled:
return ElementL10n.roomTimelineStyleBubbledShortDescription
}
}
}

extension TimelineStyle: CustomStringConvertible {
var description: String {
switch self {
case .plain:
return ElementL10n.roomTimelineStylePlainLongDescription
case .bubbled:
return ElementL10n.roomTimelineStyleBubbledLongDescription
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ class TimelineStyler: ObservableObject, Identifiable {
static let bubbled = TimelineStyler(style: .bubbled)

var shortDescription: String {
style.shortDescription
switch style {
case .plain:
return ElementL10n.roomTimelineStylePlainShortDescription
case .bubbled:
return ElementL10n.roomTimelineStyleBubbledShortDescription
}
}

@ViewBuilder
Expand Down Expand Up @@ -54,7 +59,12 @@ class TimelineStyler: ObservableObject, Identifiable {

extension TimelineStyler: CustomStringConvertible {
var description: String {
style.description
switch style {
case .plain:
return ElementL10n.roomTimelineStylePlainLongDescription
case .bubbled:
return ElementL10n.roomTimelineStyleBubbledLongDescription
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion ElementX/Sources/Screens/Settings/View/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct Settings: View {
HStack {
Text(ElementL10n.settingsTimelineStyle)
Spacer()
Text(ElementSettings.shared.timelineStyle.shortDescription)
Text(timelineStyler.shortDescription)
Image(systemName: "chevron.right")
.font(.body)
}
Expand Down
1 change: 1 addition & 0 deletions UITests/SupportingFiles/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ targets:
- path: ../SupportingFiles
- path: ../../Tools/Scripts/Templates/SimpleScreenExample/Tests/UI
- path: ../../ElementX/Sources/BuildSettings.swift
- path: ../../ElementX/Sources/Screens/RoomScreen/View/Style/TimelineStyle.swift
- path: ../../ElementX/Sources/UITestScreenIdentifier.swift
1 change: 1 addition & 0 deletions UnitTests/SupportingFiles/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ targets:
- path: ../../Tools/Scripts/Templates/SimpleScreenExample/Tests/Unit
- path: ../Resources
- path: ../../ElementX/Sources/BuildSettings.swift
- path: ../../ElementX/Sources/Screens/RoomScreen/View/Style/TimelineStyle.swift

0 comments on commit d7a7e02

Please sign in to comment.