Skip to content

Commit 26fbc6d

Browse files
committed
IOS-7952: Replace general Background and View color with MEGAAppColor
1 parent 1b8a4bb commit 26fbc6d

File tree

9 files changed

+19
-16
lines changed

9 files changed

+19
-16
lines changed

.swiftlint.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ custom_rules:
4343
name: "Avoid empty lines at the top of the file"
4444
message: "No empty lines are allowed at the top of the file"
4545

46-
disallow_preview_macro:
47-
regex: '#Preview'
48-
name: "Disallow #Preview macro"
49-
message: "Using the Preview macro will break our archiving, use PreviewProvider instead"
50-
5146
# Currently we use `only_rules` so that we can validate each and every default rule.
5247
# Once everything has been set, we can start using the `disabled_rules` and `opt_in_rules`.
5348

iMEGA/Cloud drive/MediaDiscovery/SwiftUI/Empty/EmptyMediaDiscoveryContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct EmptyMediaDiscoveryContentView: View {
4343
.foregroundColor(Color.white)
4444
.frame(width: 288, height: 50)
4545
})
46-
.background(Color.turquoise)
46+
.background(MEGAAppColor.View.turquoise.color)
4747
.cornerRadius(8, corners: .allCorners)
4848
.shadow(color: Color.black.opacity(0.15), radius: 3, x: 0, y: 1)
4949
}

iMEGA/Extensions/MEGAShare/Views/ShareAttachmentCellView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct ShareAttachmentCellView: View {
1616
TextField("", text: $viewModel.fileName)
1717
.font(.system(size: 15))
1818
.autocorrectionDisabled()
19-
.foregroundColor(Color.textForeground)
19+
.foregroundColor(MEGAAppColor.View.textForeground.color)
2020
.fixedSize()
2121
.onReceive(NotificationCenter.default.publisher(for: UITextField.textDidBeginEditingNotification),
2222
perform: { notif in
@@ -43,6 +43,6 @@ struct ShareAttachmentCellView: View {
4343
.padding(.horizontal, 10)
4444
}
4545
.frame(height: 60)
46-
.background(Color.cellBackground)
46+
.background(MEGAAppColor.View.cellBackground.color)
4747
}
4848
}

iMEGA/My Account/Account Hall/MyAccountHallPlanView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct MyAccountHallPlanView: View {
3232
viewModel.dispatch(.didTapUpgradeButton)
3333
} label: {
3434
Text(Strings.Localizable.upgrade)
35-
.foregroundColor(Color.turquoise)
35+
.foregroundColor(MEGAAppColor.View.turquoise.color)
3636
.font(.subheadline.bold())
3737
.frame(height: 50)
3838
.frame(maxWidth: 300)
@@ -41,11 +41,11 @@ struct MyAccountHallPlanView: View {
4141
.contentShape(Rectangle())
4242
.overlay(
4343
RoundedRectangle(cornerRadius: 10)
44-
.stroke(Color.turquoise, lineWidth: 2)
44+
.stroke(MEGAAppColor.View.turquoise.color, lineWidth: 2)
4545
)
4646
}
4747
.padding()
4848
}
49-
.background(Color.backgroundCell)
49+
.background(MEGAAppColor.Background.background_cell.color)
5050
}
5151
}

iMEGA/My Account/Settings/Appearance/Views/AppearanceListFooterView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct AppearanceListFooterWithLinkView: View {
1212
.foregroundColor(Color.chatListSectionTitle)
1313
Link(destination: linkUrl) {
1414
Text(linkMessage)
15-
.foregroundColor(Color.turquoise)
15+
.foregroundColor(MEGAAppColor.View.turquoise.color)
1616
}
1717
}
1818
.frame(maxWidth: .infinity, alignment: .leading)

iMEGA/My Account/Upgrade Account/Views/Upgrade Plan View/UpgradeAccountPlanViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ final class UpgradeAccountPlanViewModel: ObservableObject {
189189
tappableText: tappableText,
190190
linkString: "https://mega.nz/pro",
191191
textColor: Color.upgradeAccountPrimaryText,
192-
linkColor: Color.turquoise)
192+
linkColor: MEGAAppColor.View.turquoise.color)
193193
}
194194

195195
func createAccountPlanViewModel(_ plan: AccountPlanEntity) -> AccountPlanViewModel {

iMEGA/Utils/AppColor/MEGAAppColor.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,10 @@ enum MEGAAppColor {
505505
DIContainer.featureFlagProvider.isFeatureFlagEnabled(for: .designToken) ? designTokenColor : legacyColor
506506
}
507507

508+
var color: Color {
509+
DIContainer.featureFlagProvider.isFeatureFlagEnabled(for: .designToken) ? designTokenColor.swiftUI : legacyColor.swiftUI
510+
}
511+
508512
private var designTokenColor: UIColor {
509513
switch self {
510514
case .background_cell: TokenColors.Background.blur
@@ -527,6 +531,10 @@ enum MEGAAppColor {
527531
DIContainer.featureFlagProvider.isFeatureFlagEnabled(for: .designToken) ? designTokenColor : legacyColor
528532
}
529533

534+
var color: Color {
535+
DIContainer.featureFlagProvider.isFeatureFlagEnabled(for: .designToken) ? designTokenColor.swiftUI : legacyColor.swiftUI
536+
}
537+
530538
private var designTokenColor: UIColor {
531539
switch self {
532540
case .cellBackground: TokenColors.Background.blur

iMEGA/Utils/Shared Views/ViewControllers/CustomModalAlert/Extensions/CustomModalAlertViewController+CookieDialog.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extension CustomModalAlertViewController {
7676
string: detailText,
7777
attributes: [
7878
.font: UIFont.preferredFont(style: .callout, weight: .regular),
79-
.foregroundColor: UIColor.textForeground,
79+
.foregroundColor: MEGAAppColor.View.textForeground.uiColor,
8080
.paragraphStyle: paragraph
8181
]
8282
)
@@ -85,7 +85,7 @@ extension CustomModalAlertViewController {
8585
return detailTextAttributedString
8686
}
8787
detailTextAttributedString.addAttributes(
88-
[.foregroundColor: UIColor.turquoise, .link: urlLink],
88+
[.foregroundColor: MEGAAppColor.View.turquoise.uiColor, .link: urlLink],
8989
range: cookiePolicyRange
9090
)
9191

iMEGA/Utils/Shared Views/ViewControllers/CustomModalAlert/Extensions/CustomModalAlertViewController+Transfer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ extension CustomModalAlertViewController {
9494
return attributedString
9595
}
9696
let urlRange = NSString(string: fullMessage).range(of: tappableString)
97-
attributedString.addAttributes([.foregroundColor: UIColor.turquoise, .link: urlLink], range: urlRange)
97+
attributedString.addAttributes([.foregroundColor: MEGAAppColor.View.turquoise.uiColor, .link: urlLink], range: urlRange)
9898
return attributedString
9999
}
100100

0 commit comments

Comments
 (0)