-
Notifications
You must be signed in to change notification settings - Fork 2
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-3319 : Trading Rewards Details Screen History Card #41
Merged
ruixhuang
merged 8 commits into
main
from
mike/trcl-3319-trading-rewards-details-screen-history-card
Dec 8, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
22df492
show help card in trading rewards
mike-dydx dda505a
add padding
mike-dydx 48d3b3d
set up trading rewards title card
mike-dydx d87d7c7
add list items to the reward history card
mike-dydx fc56bcc
add view more button and header
mike-dydx f8412cf
add more periods
mike-dydx 6251057
fix CD compilation
mike-dydx 777bbea
address comments
mike-dydx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mponents/dydxRewardsHelpViewBuilder.swift → ...onents/dydxRewardsHelpViewPresenter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
...ydxPresenters/_v4/Profile/TradingRewards/Components/dydxRewardsHistoryViewPresenter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// | ||
// dydxRewardsHistoryViewPresenter.swift | ||
// dydxPresenters | ||
// | ||
// Created by Michael Maguire on 12/6/23. | ||
// | ||
|
||
import dydxViews | ||
import PlatformParticles | ||
import ParticlesKit | ||
import RoutingKit | ||
import Utilities | ||
|
||
public protocol dydxRewardsHistoryViewPresenterProtocol: HostedViewPresenterProtocol { | ||
var viewModel: dydxRewardsHistoryViewModel? { get } | ||
} | ||
|
||
public class dydxRewardsHistoryViewPresenter: HostedViewPresenter<dydxRewardsHistoryViewModel>, dydxRewardsHistoryViewPresenterProtocol { | ||
|
||
enum Period: CaseIterable { | ||
case monthly | ||
case weekly | ||
case daily | ||
|
||
var text: String? { | ||
switch self { | ||
case .monthly: return DataLocalizer.shared?.localize(path: "APP.GENERAL.TIME_STRINGS.MONTHLY", params: nil) | ||
case .weekly: return DataLocalizer.shared?.localize(path: "APP.GENERAL.TIME_STRINGS.WEEKLY", params: nil) | ||
case .daily: return DataLocalizer.shared?.localize(path: "APP.GENERAL.TIME_STRINGS.DAILY", params: nil) | ||
} | ||
} | ||
} | ||
|
||
override init() { | ||
super.init() | ||
|
||
viewModel = dydxRewardsHistoryViewModel() | ||
|
||
viewModel?.filters = Period.allCases.compactMap { period in | ||
guard let text = period.text else { return nil } | ||
return .text(text) | ||
} | ||
|
||
viewModel?.onSelectionChanged = { index in | ||
let period = Period.allCases[index] | ||
// TODO filter abacus results by period | ||
// Router.shared?.navigate(to: .init(url: ...), animated: true, completion: nil) | ||
} | ||
|
||
// TODO get todos from abacus | ||
viewModel?.items = [ | ||
.init(period: "period 1 -> period 2", amount: "1.000"), | ||
.init(period: "period 2 -> period 3", amount: "2.000"), | ||
.init(period: "period 3 -> period 4", amount: "3.000"), | ||
.init(period: "period 4 -> period 5", amount: "4.000"), | ||
.init(period: "period 5 -> period 6", amount: "5.000"), | ||
.init(period: "period 6 -> period 7", amount: "6.000"), | ||
.init(period: "period 7 -> period 8", amount: "7.000"), | ||
.init(period: "period 8 -> period 9", amount: "8.000"), | ||
.init(period: "period 9 -> period 10", amount: "9.000"), | ||
.init(period: "period 10 -> period 11", amount: "10.000"), | ||
.init(period: "period 11 -> period 12", amount: "11.000"), | ||
.init(period: "period 12 -> period 2", amount: "1.000"), | ||
.init(period: "period 13 -> period 3", amount: "2.000"), | ||
.init(period: "period 14 -> period 4", amount: "3.000"), | ||
.init(period: "period 15 -> period 5", amount: "4.000"), | ||
.init(period: "period 16 -> period 6", amount: "5.000"), | ||
.init(period: "period 17 -> period 7", amount: "6.000"), | ||
.init(period: "period 18 -> period 8", amount: "7.000"), | ||
.init(period: "period 19 -> period 9", amount: "8.000"), | ||
.init(period: "period 20 -> period 10", amount: "9.000"), | ||
.init(period: "period 21 -> period 11", amount: "10.000"), | ||
.init(period: "period 22 -> period 3", amount: "2.000"), | ||
.init(period: "period 23 -> period 4", amount: "3.000"), | ||
.init(period: "period 24 -> period 5", amount: "4.000"), | ||
.init(period: "period 25 -> period 6", amount: "5.000"), | ||
.init(period: "period 26 -> period 7", amount: "6.000"), | ||
.init(period: "period 27 -> period 8", amount: "7.000"), | ||
.init(period: "period 28 -> period 9", amount: "8.000"), | ||
.init(period: "period 29 -> period 10", amount: "9.000") | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only change here is putting these in a vstack to standardize spacing between items