Skip to content

Commit

Permalink
chore: configureable resume button (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedbashir authored Oct 25, 2024
1 parent 42e7f0f commit 0baac65
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Core/Core/View/Base/UnitButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ public struct UnitButtonView: View {
HStack {
Text(type.stringValue())
.foregroundColor(
type == .continueLesson ? Theme.Colors.accentColor :
type == .continueLesson ? Theme.Colors.resumeButtonText :
Theme.Colors.styledButtonText)
.padding(.leading, 20)
.font(Theme.Fonts.labelLarge)
CoreAssets.arrowLeft.swiftUIImage.renderingMode(.template)
.foregroundColor(
type == .continueLesson
? Theme.Colors.accentColor
? Theme.Colors.resumeButtonText
: Theme.Colors.styledButtonText
)
.rotationEffect(Angle.degrees(180))
Expand Down Expand Up @@ -187,7 +187,7 @@ public struct UnitButtonView: View {
case .continueLesson, .nextSection, .reload, .finish, .custom:
Theme.Shapes.buttonShape
.fill(
type == .continueLesson ? Theme.Colors.background :
type == .continueLesson ? Theme.Colors.resumeButtonBG :
bgColor ?? Theme.Colors.accentButtonColor)

.shadow(color: (type == .first
Expand Down
6 changes: 6 additions & 0 deletions Theme/Theme/Assets.xcassets/Colors/ResumeButton/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.408",
"red" : "0.235"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF8",
"green" : "0x78",
"red" : "0x53"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
2 changes: 2 additions & 0 deletions Theme/Theme/SwiftGen/ThemeAssets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public enum ThemeAssets {
public static let progressDone = ColorAsset(name: "ProgressDone")
public static let progressSkip = ColorAsset(name: "ProgressSkip")
public static let selectedAndDone = ColorAsset(name: "SelectedAndDone")
public static let resumeButtonBG = ColorAsset(name: "ResumeButtonBG")
public static let resumeButtonText = ColorAsset(name: "ResumeButtonText")
public static let secondaryButtonBGColor = ColorAsset(name: "SecondaryButtonBGColor")
public static let secondaryButtonBorderColor = ColorAsset(name: "SecondaryButtonBorderColor")
public static let secondaryButtonTextColor = ColorAsset(name: "SecondaryButtonTextColor")
Expand Down
2 changes: 2 additions & 0 deletions Theme/Theme/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public struct Theme {
public private(set) static var primaryCardUpgradeBG = ThemeAssets.primaryCardCourseUpgradeBG.swiftUIColor
public private(set) static var primaryCardProgressBG = ThemeAssets.primaryCardProgressBG.swiftUIColor
public private(set) static var courseProgressBG = ThemeAssets.courseProgressBG.swiftUIColor
public private(set) static var resumeButtonBG = ThemeAssets.resumeButtonBG.swiftUIColor
public private(set) static var resumeButtonText = ThemeAssets.resumeButtonText.swiftUIColor

public static func update(
accentColor: Color = ThemeAssets.accentColor.swiftUIColor,
Expand Down

0 comments on commit 0baac65

Please sign in to comment.