Skip to content

Commit

Permalink
fix: rtl for "CompletionStatus" Enum in CourseDates
Browse files Browse the repository at this point in the history
  • Loading branch information
RawanMatar89 committed May 23, 2024
1 parent 7fb0186 commit 7374fb2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Course/Course/Domain/Model/CourseDates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,23 @@ public enum CompletionStatus: String {
case thisWeek = "This Week"
case nextWeek = "Next Week"
case upcoming = "Upcoming"

var localized: String {
switch self {
case .completed:
return CourseLocalization.CourseDates.completed
case .pastDue:
return CourseLocalization.CourseDates.pastDue
case .today:
return CourseLocalization.CourseDates.today
case .thisWeek:
return CourseLocalization.CourseDates.today
case .nextWeek:
return CourseLocalization.CourseDates.today
case .upcoming:
return CourseLocalization.CourseDates.today
}
}
}

extension Array {
Expand Down
4 changes: 3 additions & 1 deletion Course/Course/Presentation/Dates/CourseDatesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ struct CompletedBlocks: View {
}) {
HStack {
VStack(alignment: .leading) {
Text(CompletionStatus.completed.rawValue)
Text(CompletionStatus.completed.localized)
.font(Theme.Fonts.titleSmall)
.foregroundColor(Theme.Colors.textPrimary)

Expand Down Expand Up @@ -286,6 +286,7 @@ struct CompletedBlocks: View {
Spacer()
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
.resizable()
.scaledToFit()
.frame(width: 6.55, height: 11.15)
Expand Down Expand Up @@ -325,6 +326,7 @@ struct BlockStatusView: View {
Spacer()
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
.resizable()

Check failure on line 330 in Course/Course/Presentation/Dates/CourseDatesView.swift

View workflow job for this annotation

GitHub Actions / Tests

value of type 'some View' has no member 'resizable'

Check failure on line 330 in Course/Course/Presentation/Dates/CourseDatesView.swift

View workflow job for this annotation

GitHub Actions / Tests

value of type 'some View' has no member 'resizable'
.scaledToFit()
.frame(width: 6.55, height: 11.15)
Expand Down

0 comments on commit 7374fb2

Please sign in to comment.