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

TRCL-3445 : Remove governance and staking cards #50

Merged
merged 1 commit into from
Jan 4, 2024
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
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