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-3319 : Trading Rewards Details Screen History Card #41

Merged

Conversation

mike-dydx
Copy link
Contributor

@mike-dydx mike-dydx commented Dec 7, 2023

Links (dYdX Internal Use Only)

Linear Ticket: TRCL-3319 : Trading Rewards Details Screen History Card

Figma Design: card


Description / Intuition

  • standardizes spacing between items for PlatformListViewModel. Is 0 when intraItemSeparator is true, 10px otherwise.
  • adds the trading history card to trading rewards screen
  • adds the custom filter header (monthly, weekly, daily) to the card
  • able to expand by 10 rows at a time
  • expand button disappears when there is no more data to expand

Before/After Screenshots or Videos

Light Dark

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring or Technical Debt
  • Documentation update
  • Other (please describe: )

@mike-dydx mike-dydx force-pushed the mike/trcl-3319-trading-rewards-details-screen-history-card branch from 2c45e2b to fc56bcc Compare December 7, 2023 23:17
@mike-dydx mike-dydx force-pushed the mike/trcl-3319-trading-rewards-details-screen-history-card branch from 5d9c02e to f8412cf Compare December 7, 2023 23:44
@mike-dydx mike-dydx requested review from johnqh and ruixhuang December 7, 2023 23:46
@mike-dydx mike-dydx self-assigned this Dec 7, 2023
@mike-dydx mike-dydx marked this pull request as ready for review December 8, 2023 00:11
ForEach(list, id: \.id) { [weak self] item in
Group {
let cell =
VStack(spacing: intraItemSeparator ? 0 : 10) {
Copy link
Contributor Author

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

import PlatformUI
import Utilities

public class dydxRewardsRewardView: PlatformViewModel {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to dydxRewardsRewardViewModel for consistency?

The Xcode template can be used to generate the view models with consistent syntax.

.wrappedInAnyView()
}

let headerViewModel: PlatformViewModel = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private?

/// - Parameters:
/// - foreground: the font to apply
/// - range: the range to modify, `nil` if the entire string should be modified
mutating func themeFont(fontType: ThemeFont.FontType = .text, fontSize: ThemeFont.FontSize = .medium, to range: Range<AttributedString.Index>? = nil) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer keeping those modifier functions immutable, so we have a consistent syntax/pattern. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

benefit i was thinking is that modifying in place skips the copy step, so potentially faster (incrementally), but since attributedstring is a struct, might be a copy on write anyways

@mike-dydx mike-dydx force-pushed the mike/trcl-3319-trading-rewards-details-screen-history-card branch from 3982efb to 777bbea Compare December 8, 2023 20:51
@ruixhuang ruixhuang merged commit 64eeec7 into main Dec 8, 2023
2 checks passed
@ruixhuang ruixhuang deleted the mike/trcl-3319-trading-rewards-details-screen-history-card branch December 8, 2023 21:36
mike-dydx added a commit that referenced this pull request Aug 20, 2024
* show help card in trading rewards

* add padding

* set up trading rewards title card

* add list items to the reward history card

* add view more button and header

* add more periods

* fix CD compilation

* address comments
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* show help card in trading rewards

* add padding

* set up trading rewards title card

* add list items to the reward history card

* add view more button and header

* add more periods

* fix CD compilation

* address comments
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* show help card in trading rewards

* add padding

* set up trading rewards title card

* add list items to the reward history card

* add view more button and header

* add more periods

* fix CD compilation

* address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants