Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not render svgs #185

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Utilities
public enum dydxBoolFeatureFlag: String, CaseIterable {
case push_notification
case force_mainnet
case enable_trading_rewards
case enable_app_rating
case enable_isolated_margins

Expand All @@ -25,7 +24,7 @@ public enum dydxBoolFeatureFlag: String, CaseIterable {
switch self {
case .enable_app_rating:
return Self.obj.parser.asBoolean(FeatureService.shared?.flag(feature: rawValue))?.boolValue ?? true
case .push_notification, .force_mainnet, .enable_trading_rewards, .enable_isolated_margins:
case .push_notification, .force_mainnet, .enable_isolated_margins:
return Self.obj.parser.asBoolean(FeatureService.shared?.flag(feature: rawValue))?.boolValue ?? false
}
}
Expand Down
20 changes: 0 additions & 20 deletions dydx/dydxPresenters/dydxPresenters/_Features/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,6 @@
]
}
},
{
"title":{
"text":"Enable Trading Rewards"
},
"field":{
"field":"enable_trading_rewards",
"optional":true,
"type" : "text",
"options" : [
{
"text": "yes",
"value" : "1"
},
{
"text": "no",
"value" : "0"
}
]
}
},
{
"title":{
"text":"Push Notification"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,21 @@ private extension dydxTransferSearchItemViewModel {
}
self.isSelected = selected
if let iconUrl = option.iconUrl, let url = URL(string: iconUrl) {
self.icon = PlatformIconViewModel(
type: .url(url: url, placeholderContent: {
Text(option.localizedString?.prefix(1) ?? "")
.frame(width: 32, height: 32)
.themeColor(foreground: .textTertiary)
.themeColor(background: .layer5)
.borderAndClip(style: .circle, borderColor: .layer7, lineWidth: 1)
.wrappedInAnyView()
}),
size: CGSize(width: 32, height: 32))
let type: PlatformIconViewModel.IconType
let placeholderText = Text(option.localizedString?.prefix(1) ?? "")
.frame(width: 32, height: 32)
.themeColor(foreground: .textTertiary)
.themeColor(background: .layer5)
.borderAndClip(style: .circle, borderColor: .layer7, lineWidth: 1)
.wrappedInAnyView()
// SwiftUI does not process svgs well
if url.absoluteString.ends(with: ".svg") {
self.icon = placeholderText.wrappedViewModel
} else {
self.icon = PlatformIconViewModel(
type: .url(url: url, placeholderContent: { placeholderText }),
size: CGSize(width: 32, height: 32))
}
}
self.onTapAction = onTapAction
}
Expand Down
6 changes: 2 additions & 4 deletions dydx/dydxViews/dydxViews/_v4/Profile/dydxProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ public class dydxProfileViewModel: PlatformViewModel {
HStack(spacing: 14) {
self.fees?
.createView(parentStyle: style)
if dydxBoolFeatureFlag.enable_trading_rewards.isEnabled {
self.rewards?
.createView(parentStyle: style)
}
self.rewards?
.createView(parentStyle: style)
}

self.history?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Utilities

public class dydxTransferSearchItemViewModel: PlatformViewModel {
@Published public var onTapAction: (() -> Void)?
@Published public var icon: PlatformIconViewModel?
@Published public var icon: PlatformViewModel?
@Published public var text: String?
@Published public var tokenText: TokenTextViewModel?
@Published public var isSelected: Bool = false
Expand Down
Loading