Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 2 additions & 8 deletions ios/PlatformUIJedio/PlatformUIJedio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1185,10 +1185,7 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -1262,10 +1259,7 @@
LDPLUSPLUS = "";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,7 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
Expand Down Expand Up @@ -439,10 +436,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
3 changes: 1 addition & 2 deletions ios/Utilities/Utilities/_Extensions/Date+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ public extension Date {

var englishDatetimeString: String {
let formatter = type(of: self).localFormatter
formatter.dateStyle = .short
formatter.timeStyle = .short
formatter.dateFormat = "HH:mm MMMM dd, yyyy"
return formatter.string(from: self)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class dydxPortfolioFillsViewPresenter: HostedViewPresenter<dydxPortfolioFillsVie
super.init()

self.viewModel = viewModel

viewModel?.onboardAction = {
Router.shared?.navigate(to: RoutingRequest(path: "/onboard"), animated: true, completion: { /* [weak self] */ _, _ in
})
Expand Down Expand Up @@ -80,7 +80,7 @@ class dydxPortfolioFillsViewPresenter: HostedViewPresenter<dydxPortfolioFillsVie
item.type = DataLocalizer.localize(path: fill.resources.typeStringKey ?? "-")
item.size = dydxFormatter.shared.localFormatted(number: fill.size, digits: configs.displayStepSizeDecimals?.intValue ?? 1)
item.token?.symbol = asset.displayableAssetId
item.date = Date(milliseconds: fill.createdAtMilliseconds)
item.date = Date(milliseconds: fill.createdAtMilliseconds).englishDatetimeString
if let tickSize = configs.displayTickSizeDecimals?.intValue {
item.price = dydxFormatter.shared.dollar(number: fill.price, digits: tickSize)
item.fee = dydxFormatter.shared.dollar(number: fill.fee, digits: tickSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class dydxPortfolioFundingViewPresenter: HostedViewPresenter<dydxPortfolioFundin
super.init()

self.viewModel = viewModel

viewModel?.onboardAction = {
Router.shared?.navigate(to: RoutingRequest(path: "/onboard"), animated: true, completion: { /* [weak self] */ _, _ in
})
Expand Down Expand Up @@ -68,7 +68,7 @@ class dydxPortfolioFundingViewPresenter: HostedViewPresenter<dydxPortfolioFundin
let item = cache[funding] ?? dydxPortfolioFundingItemViewModel()
cache[funding] = item

item.time = dydxFormatter.shared.interval(time: Date(milliseconds: funding.createdAtMilliseconds))
item.time = Date(milliseconds: funding.createdAtMilliseconds).englishDatetimeString
let amount = dydxFormatter.shared.dollar(number: abs(funding.payment), size: "0.0001")
if funding.payment >= 0.0 {
item.amount = SignedAmountViewModel(text: amount, sign: .plus, coloringOption: .signOnly)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class dydxPortfolioOrdersViewPresenter: HostedViewPresenter<dydxPortfolioOrdersV
super.init()

self.viewModel = viewModel

viewModel?.onboardAction = {
Router.shared?.navigate(to: RoutingRequest(path: "/onboard"), animated: true, completion: { /* [weak self] */ _, _ in
})
Expand Down Expand Up @@ -80,9 +80,9 @@ class dydxPortfolioOrdersViewPresenter: HostedViewPresenter<dydxPortfolioOrdersV
item.id = order.id
item.type = DataLocalizer.localize(path: order.resources.typeStringKey ?? "-")
if order.side == Abacus.OrderSide.buy {
item.sideText.side = .buy
item.sideText = SideTextViewModel(side: .buy, coloringOption: .withBackground)
} else {
item.sideText.side = .sell
item.sideText = SideTextViewModel(side: .sell, coloringOption: .withBackground)
}
item.status = DataLocalizer.localize(path: order.resources.statusStringKey ?? "-")
item.canCancel = order.status.canCancel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private class dydxTradeStatusViewPresenter: HostedViewPresenter<dydxTradeStatusV
viewModel?.orderViewModel.size = dydxFormatter.shared.localFormatted(number: lastOrder.size, digits: configs.stepSizeDecimals?.intValue ?? 1)
viewModel?.orderViewModel.token?.symbol = asset.displayableAssetId
if let createdAt = lastOrder.createdAtMilliseconds?.uint64Value {
viewModel?.orderViewModel.date = Date(milliseconds: createdAt)
viewModel?.orderViewModel.date = Date(milliseconds: createdAt).englishDatetimeString
}
if let tickSize = configs.tickSizeDecimals?.intValue {
viewModel?.orderViewModel.price = dydxFormatter.shared.dollar(number: lastOrder.price, digits: tickSize)
Expand Down Expand Up @@ -205,7 +205,7 @@ private class dydxTradeStatusViewPresenter: HostedViewPresenter<dydxTradeStatusV
viewModel?.orderViewModel.token?.symbol = token
}

viewModel?.orderViewModel.date = submissionDate
viewModel?.orderViewModel.date = submissionDate?.englishDatetimeString
if let tickSize = configs?.tickSizeDecimals?.intValue {
if let price = tradeInput.summary?.price {
viewModel?.orderViewModel.price = dydxFormatter.shared.dollar(number: price, digits: tickSize)
Expand Down Expand Up @@ -239,7 +239,7 @@ private class dydxTradeStatusViewPresenter: HostedViewPresenter<dydxTradeStatusV
if let token = asset?.displayableAssetId ?? configsAndAsset?.assetId {
viewModel?.orderViewModel.token?.symbol = token
}
viewModel?.orderViewModel.date = submissionDate
viewModel?.orderViewModel.date = submissionDate?.englishDatetimeString
if let tickSize = configs?.tickSizeDecimals?.intValue {
viewModel?.orderViewModel.price = dydxFormatter.shared.dollar(number: closePositionInput.summary?.price, digits: tickSize)
viewModel?.orderViewModel.fee = dydxFormatter.shared.dollar(number: closePositionInput.summary?.fee, digits: tickSize)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "circle_stack.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ios/dydx/dydxViews/dydxViews/Shared/OrderStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class OrderStatusModel: PlatformViewModel {
case .green:
return ThemeSettings.positiveColor.color
case .blank:
return ThemeColor.SemanticColor.textPrimary.color
return ThemeColor.SemanticColor.layer2.color
case .yellow:
return ThemeColor.SemanticColor.colorYellow.color
}
Expand All @@ -46,7 +46,7 @@ public class OrderStatusModel: PlatformViewModel {
return AnyView(
ZStack {
Circle()
.fill(ThemeColor.SemanticColor.layer0.color ?? .clear)
.fill(ThemeColor.SemanticColor.colorFadedPurple.color)
.frame(width: 16, height: 16)
Circle()
.fill(self.status?.color ?? .clear)
Expand Down
38 changes: 37 additions & 1 deletion ios/dydx/dydxViews/dydxViews/Shared/PlaceholderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@ import Utilities

public class PlaceholderViewModel: PlatformViewModel {
@Published public var text: String?
@Published public var subText: String?
@Published public var icon: PlatformIconViewModel.IconType?
private let useUpdatedStyle: Bool

public init(text: String? = nil) {
public init(
text: String? = nil,
subText: String? = nil,
icon: PlatformIconViewModel.IconType? = nil,
useUpdatedStyle: Bool = false
) {
self.text = text
self.subText = subText
self.icon = icon
self.useUpdatedStyle = useUpdatedStyle
}

public static var previewValue: PlaceholderViewModel {
Expand All @@ -26,6 +37,31 @@ public class PlaceholderViewModel: PlatformViewModel {
PlatformView(viewModel: self, parentStyle: parentStyle, styleKey: styleKey) { [weak self] style in
guard let self = self else { return AnyView(PlatformView.nilView) }

if useUpdatedStyle {
return VStack(alignment: .center) {
if let icon = self.icon {
PlatformIconViewModel(
type: icon,
size: .init(width: 24, height: 24),
templateColor: .textTertiary
)
.createView(parentStyle: parentStyle)
.opacity(0.75)
}
Text(self.text ?? "")
.themeColor(foreground: .textTertiary)
.themeFont(fontType: .plus, fontSize: .small)
Text(self.subText ?? "")
.themeColor(foreground: .textTertiary)
.themeFont(fontSize: .smaller)
.opacity(0.75)
}
.padding(.vertical, 20)
.frame(maxWidth: .infinity)
.border(borderWidth: 1, cornerRadius: 12, borderColor: ThemeColor.SemanticColor.layer3.color)
.wrappedInAnyView()
}

let main = Text(self.text ?? "")
.themeFont(fontSize: .small)
.themeColor(foreground: .textTertiary)
Expand Down
Loading