Skip to content

Commit

Permalink
remove governance and staking cards, replace strings (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx authored Jan 4, 2024
1 parent bac09f6 commit 7133f9b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,22 @@ private class dydxTradingRewardsViewPresenter: HostedViewPresenter<dydxTradingRe
Router.shared?.navigate(to: URL(string: "https://community.chaoslabs.xyz/dydx-v4/risk/leaderboard"), completion: nil)
}

viewModel.governanceViewModel = .init(
title: DataLocalizer.shared?.localize(path: "APP.TRADING_REWARDS.GOVERNANCE", params: nil) ?? "",
description: DataLocalizer.shared?.localize(path: "APP.TRADING_REWARDS.GOVERNANCE_LINK_DESCRIPTION", params: nil) ?? "") {
// comment out as part of https://linear.app/dydx/issue/TRCL-3445/remove-governance-and-staking-cards
// non-zero chance we add back
// these vars and their corresponding files can be fully deleted if rewards is no longer relevant
// viewModel.governanceViewModel = .init(
// title: DataLocalizer.shared?.localize(path: "APP.GENERAL.GOVERNANCE", params: nil) ?? "",
// description: DataLocalizer.shared?.localize(path: "APP.GENERAL.GOVERNANCE_DESCRIPTION", params: nil) ?? "") {
// TODO: configure in env json
// Router.shared?.navigate (to: , completion: nil)
}
// }

viewModel.stakingViewModel = .init(
title: DataLocalizer.shared?.localize(path: "APP.TRADING_REWARDS.STAKING", params: nil) ?? "",
description: DataLocalizer.shared?.localize(path: "APP.TRADING_REWARDS.STAKING_LINK_DESCRIPTION", params: nil) ?? "") {
// viewModel.stakingViewModel = .init(
// title: DataLocalizer.shared?.localize(path: "APP.GENERAL.STAKING", params: nil) ?? "",
// description: DataLocalizer.shared?.localize(path: "APP.GENERAL.STAKING_DESCRIPTION", params: nil) ?? "") {
// TODO: configure in env json
// Router.shared?.navigate (to: , completion: nil)
}
// }

helpPresenter.$viewModel.assign(to: &viewModel.$help)
historyPresenter.$viewModel.assign(to: &viewModel.$history)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class dydxProfileRewardsViewModel: dydxTitledCardViewModel {
override func createContentView(parentStyle: ThemeStyle = ThemeStyle.defaultStyle, styleKey: String? = nil) -> AnyView? {
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 10) {
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.PROFILES_PAGE.REWARDS_LAST_7_DAYS", params: nil) ?? "", value: last7DaysRewardsAmount)
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.GENERAL.TIME_STRINGS.THIS_WEEK", params: nil) ?? "", value: last7DaysRewardsAmount)
if let allTimeRewardsAmount = allTimeRewardsAmount {
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.PROFILES_PAGE.REWARDS_ALL_TIME", params: nil) ?? "", value: allTimeRewardsAmount)
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.GENERAL.TIME_STRINGS.ALL_TIME", params: nil) ?? "", value: allTimeRewardsAmount)
}
}
Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class dydxRewardsSummaryViewModel: dydxTitledCardViewModel {
override func createContentView(parentStyle: ThemeStyle = ThemeStyle.defaultStyle, styleKey: String? = nil) -> AnyView? {
HStack(spacing: 18) {
HStack {
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.PROFILES_PAGE.REWARDS_LAST_7_DAYS", params: nil) ?? "", primaryValue: last7DaysRewardsAmount, secondaryValue: last7DaysRewardsPeriod)
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.GENERAL.TIME_STRINGS.THIS_WEEK", params: nil) ?? "", primaryValue: last7DaysRewardsAmount, secondaryValue: last7DaysRewardsPeriod)
if let allTimeRewardsAmount = allTimeRewardsAmount {
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.PROFILES_PAGE.REWARDS_ALL_TIME", params: nil) ?? "", primaryValue: allTimeRewardsAmount, secondaryValue: nil)
titleValueStack(title: DataLocalizer.shared?.localize(path: "APP.GENERAL.TIME_STRINGS.ALL_TIME", params: nil) ?? "", primaryValue: allTimeRewardsAmount, secondaryValue: nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ public class dydxTradingRewardsViewModel: PlatformViewModel {
@Published public var rewardsSummary: dydxRewardsSummaryViewModel = dydxRewardsSummaryViewModel()
@Published public var help: dydxRewardsHelpViewModel? = dydxRewardsHelpViewModel()
@Published public var history: dydxRewardsHistoryViewModel? = dydxRewardsHistoryViewModel()
@Published public var governanceViewModel: dydxRewardsLearnMoreViewModel?
@Published public var stakingViewModel: dydxRewardsLearnMoreViewModel?
// removed as part of https://linear.app/dydx/issue/TRCL-3445/remove-governance-and-staking-cards
// non-zero chance we add back
// these vars and their corresponding files can be fully deleted if rewards is no longer relevant
// @Published public var governanceViewModel: dydxRewardsLearnMoreViewModel?
// @Published public var stakingViewModel: dydxRewardsLearnMoreViewModel?

public init() { }

Expand All @@ -37,8 +40,9 @@ public class dydxTradingRewardsViewModel: PlatformViewModel {
self.rewardsSummary.createView(parentStyle: style)
self.help?.createView(parentStyle: style)
self.history?.createView(parentStyle: style)
self.governanceViewModel?.createView(parentStyle: style)
self.stakingViewModel?.createView(parentStyle: style)
// see comment near top
// self.governanceViewModel?.createView(parentStyle: style)
// self.stakingViewModel?.createView(parentStyle: style)
Spacer(minLength: 80)
}
}
Expand Down

0 comments on commit 7133f9b

Please sign in to comment.