Skip to content

Commit

Permalink
SharedMarketViewModel's tokenSymbol and tokenFullName renamed to …
Browse files Browse the repository at this point in the history
…`assetId` and `assetName`
  • Loading branch information
mike-dydx committed Aug 19, 2024
1 parent 892af07 commit 05c1cb8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class SharedMarketPresenter: HostedViewPresenter<SharedMarketViewModel>, SharedM

static func createViewModel(market: PerpetualMarket, asset: Asset?) -> SharedMarketViewModel {
let viewModel = SharedMarketViewModel()
viewModel.tokenSymbol = asset?.id ?? market.assetId
viewModel.tokenFullName = asset?.name ?? market.assetId
viewModel.assetId = asset?.id ?? market.assetId
viewModel.assetName = asset?.name ?? market.displayId
if let imageUrl = asset?.resources?.imageUrl {
viewModel.logoUrl = URL(string: imageUrl)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public class dydxMarketResourcesViewModel: PlatformViewModel {
HStack {
VStack(alignment: .leading) {
HStack(spacing: 4) {
Text(sharedMarketViewModel.tokenFullName ?? "")
Text(sharedMarketViewModel.assetName ?? "")
.themeColor(foreground: .textPrimary)
.themeFont(fontType: .plus, fontSize: .medium)
}
Text(sharedMarketViewModel.tokenSymbol ?? "")
Text(sharedMarketViewModel.assetId ?? "")
.themeFont(fontType: .base, fontSize: .small)
}
Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public class dydxMarketInfoHeaderViewModel: PlatformViewModel {
.createView(parentStyle: parentStyle, styleKey: styleKey)
VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 4) {
Text(sharedMarketViewModel?.tokenFullName ?? "")
Text(sharedMarketViewModel?.assetName ?? "")
.themeColor(foreground: .textSecondary)
.themeFont(fontType: .base, fontSize: .large)
TokenTextViewModel(symbol: sharedMarketViewModel?.tokenSymbol ?? "")
TokenTextViewModel(symbol: sharedMarketViewModel?.assetId ?? "")
.createView(parentStyle: parentStyle.themeFont(fontSize: .smallest), styleKey: styleKey)
}
HStack(alignment: .center, spacing: 4) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ open class dydxMarketAssetItemViewModel: PlatformViewModel {
HStack {
VStack(alignment: .leading) {
HStack(spacing: 4) {
Text(sharedMarketViewModel?.tokenSymbol ?? "")
Text(sharedMarketViewModel?.assetId ?? "")
.themeColor(foreground: .textPrimary)
.themeFont(fontType: .plus, fontSize: .medium)
.layoutPriority(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import PlatformUI
import Utilities

public final class SharedMarketViewModel: PlatformViewModel, Equatable {
@Published public var tokenSymbol: String?
@Published public var tokenFullName: String?
@Published public var assetId: String?
@Published public var assetName: String?
@Published public var logoUrl: URL?
@Published public var volume24H: String?
@Published public var indexPrice: String?
Expand All @@ -27,8 +27,8 @@ public final class SharedMarketViewModel: PlatformViewModel, Equatable {

public static var previewValue: SharedMarketViewModel = {
let vm = SharedMarketViewModel()
vm.tokenSymbol = "ETH"
vm.tokenFullName = "Ethereum"
vm.assetId = "ETH"
vm.assetName = "Ethereum"
vm.logoUrl = URL(string: "https://media.dydx.exchange/currencies/eth.png")
vm.volume24H = "$223M"
vm.indexPrice = "$1.00"
Expand All @@ -45,8 +45,8 @@ public final class SharedMarketViewModel: PlatformViewModel, Equatable {

public static func == (lhs: SharedMarketViewModel, rhs: SharedMarketViewModel) -> Bool {
lhs.id == rhs.id &&
lhs.tokenSymbol == rhs.tokenSymbol &&
lhs.tokenFullName == rhs.tokenFullName &&
lhs.assetId == rhs.assetId &&
lhs.assetName == rhs.assetName &&
lhs.logoUrl == rhs.logoUrl &&
lhs.volume24H == rhs.volume24H &&
lhs.indexPrice == rhs.indexPrice &&
Expand Down

0 comments on commit 05c1cb8

Please sign in to comment.