Skip to content

Commit 619550c

Browse files
authored
Merge pull request #11 from dydxprotocol/feat/asset-tab-update
feat: Update asset details to new style
2 parents e8ad744 + 7c5e1fe commit 619550c

File tree

24 files changed

+343
-307
lines changed

24 files changed

+343
-307
lines changed

ios/PlatformUI/PlatformUI.xcodeproj/project.pbxproj

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
27673BBE2C8FD24400689E3F /* AttributedString+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27673BBD2C8FD24400689E3F /* AttributedString+Ext.swift */; };
6262
277E7AC62BBF3BE8009F95DE /* InlineAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277E7AC52BBF3BE8009F95DE /* InlineAlert.swift */; };
6363
27E6A7322AB8D5F600026CB5 /* SwipeActionsViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E6A7312AB8D5F600026CB5 /* SwipeActionsViewModifier.swift */; };
64+
48D8EBF02EABDA74007630A1 /* UIKitAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48D8EBEF2EABDA71007630A1 /* UIKitAppearance.swift */; };
6465
6488BBDC296F6AEA0096502F /* TabItemViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6488BBDB296F6AEA0096502F /* TabItemViewModel.swift */; };
6566
64A4DC5F29677BCB008D8E20 /* PlatformOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64A4DC5E29677BCB008D8E20 /* PlatformOutput.swift */; };
6667
CEE5B6E4D97A1CD73E8B2718 /* Pods_iOS_PlatformUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 418D5C02425B3C680BF32DA4 /* Pods_iOS_PlatformUI.framework */; };
@@ -175,6 +176,7 @@
175176
27E6A7312AB8D5F600026CB5 /* SwipeActionsViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeActionsViewModifier.swift; sourceTree = "<group>"; };
176177
366BD14FE1ED4F2AF21D924E /* Pods-iOS-PlatformUI.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOS-PlatformUI.release.xcconfig"; path = "Target Support Files/Pods-iOS-PlatformUI/Pods-iOS-PlatformUI.release.xcconfig"; sourceTree = "<group>"; };
177178
418D5C02425B3C680BF32DA4 /* Pods_iOS_PlatformUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iOS_PlatformUI.framework; sourceTree = BUILT_PRODUCTS_DIR; };
179+
48D8EBEF2EABDA71007630A1 /* UIKitAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitAppearance.swift; sourceTree = "<group>"; };
178180
6488BBDB296F6AEA0096502F /* TabItemViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabItemViewModel.swift; sourceTree = "<group>"; };
179181
64A4DC5E29677BCB008D8E20 /* PlatformOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlatformOutput.swift; sourceTree = "<group>"; };
180182
7900D7C9D4E7016DDF14E98A /* Pods-iOS-PlatformUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOS-PlatformUITests.release.xcconfig"; path = "Target Support Files/Pods-iOS-PlatformUITests/Pods-iOS-PlatformUITests.release.xcconfig"; sourceTree = "<group>"; };
@@ -407,6 +409,7 @@
407409
02E2C92D28A1C8A400F7C3BE /* PlatformUI */ = {
408410
isa = PBXGroup;
409411
children = (
412+
48D8EBEA2EABDA61007630A1 /* Extensions */,
410413
0243990E2D45B0770073DCF3 /* ShimmerView */,
411414
0207FCA42D2BCECD004C2C9F /* KeyboardObserving */,
412415
02F16FDA28B491EE0085DC58 /* PlatformUI.swift */,
@@ -497,6 +500,14 @@
497500
path = Utility;
498501
sourceTree = "<group>";
499502
};
503+
48D8EBEA2EABDA61007630A1 /* Extensions */ = {
504+
isa = PBXGroup;
505+
children = (
506+
48D8EBEF2EABDA71007630A1 /* UIKitAppearance.swift */,
507+
);
508+
path = Extensions;
509+
sourceTree = "<group>";
510+
};
500511
50951D95B8B38B407429BEF2 /* Pods */ = {
501512
isa = PBXGroup;
502513
children = (
@@ -770,6 +781,7 @@
770781
02DE89A628A2F10A00728FF3 /* SampleThemeInput.swift in Sources */,
771782
023788F528B9924D00F212E1 /* PlatformButton.swift in Sources */,
772783
02E2C9C128A2C22B00F7C3BE /* SampleThemeLabel.swift in Sources */,
784+
48D8EBF02EABDA74007630A1 /* UIKitAppearance.swift in Sources */,
773785
02DDB6512DCBE05C00FFFF2C /* OTPFieldView.swift in Sources */,
774786
0243A73729BB8DBB00A083FE /* PlatformListViewModel.swift in Sources */,
775787
277E7AC62BBF3BE8009F95DE /* InlineAlert.swift in Sources */,
@@ -887,10 +899,7 @@
887899
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
888900
MTL_FAST_MATH = YES;
889901
ONLY_ACTIVE_ARCH = YES;
890-
OTHER_LDFLAGS = (
891-
"$(inherited)",
892-
" ",
893-
);
902+
OTHER_LDFLAGS = "$(inherited) ";
894903
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
895904
SDKROOT = iphoneos;
896905
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -964,10 +973,7 @@
964973
LDPLUSPLUS = "";
965974
MTL_ENABLE_DEBUG_INFO = NO;
966975
MTL_FAST_MATH = YES;
967-
OTHER_LDFLAGS = (
968-
"$(inherited)",
969-
" ",
970-
);
976+
OTHER_LDFLAGS = "$(inherited) ";
971977
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
972978
SDKROOT = iphoneos;
973979
SWIFT_COMPILATION_MODE = wholemodule;

ios/PlatformUI/PlatformUI/Components/Labels/SignedAmount.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ public class SignedAmountViewModel: PlatformViewModel, Hashable {
5555
}
5656

5757
public static var previewValue = SignedAmountViewModel(text: "2.02", sign: .plus, coloringOption: .allText, positiveTextStyleKey: "signed-plus", negativeTextStyleKey: "signed-minus")
58+
59+
public func copy(
60+
sign: PlatformUISign? = nil,
61+
coloringOption: ColoringOption? = nil,
62+
textMap: ((String?) -> String?)? = nil
63+
) -> SignedAmountViewModel {
64+
var newText = self.text
65+
if let foundTextMap = textMap {
66+
newText = foundTextMap(newText)
67+
}
68+
return SignedAmountViewModel(
69+
text: newText,
70+
sign: sign ?? self.sign,
71+
coloringOption: coloringOption ?? self.coloringOption,
72+
noneColor: noneColor,
73+
positiveTextStyleKey: positiveTextStyleKey,
74+
negativeTextStyleKey: negativeTextStyleKey
75+
)
76+
}
5877

5978
public override func createView(parentStyle: ThemeStyle = ThemeStyle.defaultStyle, styleKey: String? = nil) -> PlatformView {
6079
PlatformView(viewModel: self, parentStyle: parentStyle, styleKey: styleKey) { [weak self] style in

ios/PlatformUI/PlatformUI/DesignSystem/Theme/ThemeConfig.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public final class ThemeSettings: ObservableObject, SingletonProtocol {
1818
if themeConfig != oldValue {
1919
ThemeColorCache.shared.clear()
2020
ThemeFontCache.shared.clear()
21+
configureUIKitAppearance()
2122
}
2223
}
2324
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// UIKitAppearance.swift
3+
// PlatformUI
4+
//
5+
// Created by Sam Newby on 2025-10-24.
6+
//
7+
8+
import UIKit
9+
10+
public extension ThemeSettings {
11+
/// Configure global UIKit appearance customizations
12+
func configureUIKitAppearance() {
13+
// Segmented displays
14+
UISegmentedControl.appearance().selectedSegmentTintColor = ThemeColor.SemanticColor.layer1.uiColor
15+
UISegmentedControl.appearance().backgroundColor = ThemeColor.SemanticColor.layer0.uiColor.withAlphaComponent(0.5)
16+
UISegmentedControl.appearance().setTitleTextAttributes(
17+
[.foregroundColor: ThemeColor.SemanticColor.textPrimary.uiColor],
18+
for: .selected
19+
)
20+
UISegmentedControl.appearance().setTitleTextAttributes(
21+
[.foregroundColor: ThemeColor.SemanticColor.textTertiary.uiColor],
22+
for: .normal
23+
)
24+
}
25+
}

ios/dydx/dydxPresenters/dydxPresenters.xcodeproj/project.pbxproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
27DB2EA32AC1E7B20047BC39 /* dydxTradeRestrictedViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27DB2EA22AC1E7B20047BC39 /* dydxTradeRestrictedViewPresenter.swift */; };
236236
27E0735C2C20D2470034B963 /* dydxCancelPendingIsolatedOrdersViewBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E0735B2C20D2470034B963 /* dydxCancelPendingIsolatedOrdersViewBuilder.swift */; };
237237
314BBDE9F332ECA910BC414E /* Pods_iOS_dydxPresenters.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1551C00FFF41C29CFC5BD94 /* Pods_iOS_dydxPresenters.framework */; };
238+
48D8EBDF2EABD35B007630A1 /* dydxMarketAccountViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48D8EBD12EABD34A007630A1 /* dydxMarketAccountViewPresenter.swift */; };
238239
6448800B2AA248340068DD87 /* dydxAlertsWorker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64487FFE2AA248340068DD87 /* dydxAlertsWorker.swift */; };
239240
645299EF2AE86FB1000810E6 /* dydxUpdateViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 645299E22AE86FB1000810E6 /* dydxUpdateViewPresenter.swift */; };
240241
64529A4C2AE8705E000810E6 /* dydxUpdateWorker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64529A4B2AE8705E000810E6 /* dydxUpdateWorker.swift */; };
@@ -724,6 +725,7 @@
724725
27C027522AFD761300E92CCB /* dydxProfileSecondaryButtonsViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxProfileSecondaryButtonsViewPresenter.swift; sourceTree = "<group>"; };
725726
27DB2EA22AC1E7B20047BC39 /* dydxTradeRestrictedViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxTradeRestrictedViewPresenter.swift; sourceTree = "<group>"; };
726727
27E0735B2C20D2470034B963 /* dydxCancelPendingIsolatedOrdersViewBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxCancelPendingIsolatedOrdersViewBuilder.swift; sourceTree = "<group>"; };
728+
48D8EBD12EABD34A007630A1 /* dydxMarketAccountViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxMarketAccountViewPresenter.swift; sourceTree = "<group>"; };
727729
64487FFE2AA248340068DD87 /* dydxAlertsWorker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = dydxAlertsWorker.swift; sourceTree = "<group>"; };
728730
645299E22AE86FB1000810E6 /* dydxUpdateViewPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = dydxUpdateViewPresenter.swift; sourceTree = "<group>"; };
729731
64529A4B2AE8705E000810E6 /* dydxUpdateWorker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dydxUpdateWorker.swift; sourceTree = "<group>"; };
@@ -1354,6 +1356,7 @@
13541356
0274B34328F113FD005AF69E /* Components */ = {
13551357
isa = PBXGroup;
13561358
children = (
1359+
48D8EBD12EABD34A007630A1 /* dydxMarketAccountViewPresenter.swift */,
13571360
0274B34728F1140D005AF69E /* dydxMarketPriceCandlesViewPresenter.swift */,
13581361
0208632428F51EC400C9D3A0 /* dydxMarketDepthChartViewPresenter.swift */,
13591362
029CBE7028F5FDF600259C1D /* dydxMarketFundingChartViewPresenter.swift */,
@@ -2548,6 +2551,7 @@
25482551
02048B122D35E3DF00394CBE /* dydxSimpleUIPositionListViewPresenter.swift in Sources */,
25492552
02CA62872A7EBE08006067DB /* dydxPortfolioFeesViewPresenter.swift in Sources */,
25502553
276FE4B42CC1A02E00607646 /* SettingsStore+Ext.swift in Sources */,
2554+
48D8EBDF2EABD35B007630A1 /* dydxMarketAccountViewPresenter.swift in Sources */,
25512555
0208632528F51EC400C9D3A0 /* dydxMarketDepthChartViewPresenter.swift in Sources */,
25522556
026BB3F02E418225009F33AB /* dydxWalletSecurityViewBuilder.swift in Sources */,
25532557
02F99F3B29E4CB300009B3E8 /* dydxTransferSearchViewBuilder.swift in Sources */,
@@ -2869,10 +2873,7 @@
28692873
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
28702874
MTL_FAST_MATH = YES;
28712875
ONLY_ACTIVE_ARCH = YES;
2872-
OTHER_LDFLAGS = (
2873-
"$(inherited)",
2874-
" ",
2875-
);
2876+
OTHER_LDFLAGS = "$(inherited) ";
28762877
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
28772878
SDKROOT = iphoneos;
28782879
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -2946,10 +2947,7 @@
29462947
LDPLUSPLUS = "";
29472948
MTL_ENABLE_DEBUG_INFO = NO;
29482949
MTL_FAST_MATH = YES;
2949-
OTHER_LDFLAGS = (
2950-
"$(inherited)",
2951-
" ",
2952-
);
2950+
OTHER_LDFLAGS = "$(inherited) ";
29532951
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
29542952
SDKROOT = iphoneos;
29552953
SWIFT_COMPILATION_MODE = wholemodule;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// dydxMarketAccountViewPresenter.swift
3+
// dydxPresenters
4+
//
5+
// Created by Sam Newby on 2025-10-24.
6+
//
7+
8+
import dydxViews
9+
import RoutingKit
10+
11+
protocol dydxMarketAccountViewPresenterProtocol: HostedViewPresenterProtocol {
12+
var viewModel: dydxMarketAccountViewModel? { get }
13+
}
14+
15+
class dydxMarketAccountPresenter: HostedViewPresenter<dydxMarketAccountViewModel>, dydxMarketAccountViewPresenterProtocol {
16+
private let sharedAccountPresenter = SharedAccountPresenter()
17+
18+
override init() {
19+
let viewModel = dydxMarketAccountViewModel()
20+
21+
sharedAccountPresenter.$viewModel.assign(to: &viewModel.$sharedAccountViewModel)
22+
23+
super.init()
24+
25+
self.viewModel = viewModel
26+
27+
viewModel.depositAction = {
28+
Router.shared?.navigate(to: RoutingRequest(path: "/transfer/deposit", params: nil), animated: true, completion: nil)
29+
}
30+
}
31+
32+
override func start() {
33+
super.start()
34+
35+
sharedAccountPresenter.start()
36+
}
37+
}

ios/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/Components/dydxMarketConfigsViewPresenter.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,10 @@ class dydxMarketConfigsViewPresenter: HostedViewPresenter<dydxMarketConfigsViewM
6464
dydxMarketConfigsViewModel.Item(title: DataLocalizer.localize(path: "APP.GENERAL.STEP_SIZE"),
6565
value: marketConfigs?.stepSize?.doubleValue != nil ? "\(marketConfigs?.stepSize?.doubleValue ?? 0)" : "-",
6666
token: marketConfigs?.stepSize?.doubleValue != nil ? token : nil),
67-
dydxMarketConfigsViewModel.Item(title: DataLocalizer.localize(path: "APP.GENERAL.MINIMUM_ORDER_SIZE"),
68-
value: marketConfigs?.minOrderSize?.doubleValue != nil ? "\(marketConfigs?.minOrderSize?.doubleValue ?? 0)" : "-",
69-
token: marketConfigs?.minOrderSize?.doubleValue != nil ? token : nil),
70-
dydxMarketConfigsViewModel.Item(title: DataLocalizer.localize(path: "APP.GENERAL.MAXIMUM_LEVERAGE"),
71-
value: maxLeverageText ?? "-"),
7267
dydxMarketConfigsViewModel.Item(title: DataLocalizer.localize(path: "APP.GENERAL.MAINTENANCE_MARGIN_FRACTION"),
7368
value: dydxFormatter.shared.percent(number: marketConfigs?.maintenanceMarginFraction?.doubleValue, digits: 4) ?? "-"),
7469
dydxMarketConfigsViewModel.Item(title: DataLocalizer.localize(path: "APP.GENERAL.INITIAL_MARGIN_FRACTION"),
75-
value: dydxFormatter.shared.percent(number: marketConfigs?.initialMarginFraction?.doubleValue, digits: 4) ?? "-"),
76-
dydxMarketConfigsViewModel.Item(title: DataLocalizer.localize(path: "APP.GENERAL.BASE_POSITION_NOTIONAL"),
77-
value: dydxFormatter.shared.localFormatted(number: marketConfigs?.basePositionNotional?.doubleValue, digits: 0) ?? "-")
70+
value: dydxFormatter.shared.percent(number: marketConfigs?.initialMarginFraction?.doubleValue, digits: 4) ?? "-")
7871
]
7972
}
8073
}

0 commit comments

Comments
 (0)