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

[C-4080] Mobile cooldown and claim all #8263

Merged
merged 7 commits into from
May 1, 2024
Merged

[C-4080] Mobile cooldown and claim all #8263

merged 7 commits into from
May 1, 2024

Conversation

isaacsolo
Copy link
Contributor

@isaacsolo isaacsolo commented Apr 29, 2024

Description

Add cooldowns to mobile rewards and a claim all feature. These features are behind the rewards cooldown feature flag. The only part that's missing should be performing the actual claim all from C-4285.

Some changes extended to other parts of rewards code, like harmonizing buttons or texts and fixing some layout.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.
Ran local client against staging. Confirmed cooldown reward claim works.

Copy link

changeset-bot bot commented Apr 29, 2024

⚠️ No Changeset found

Latest commit: 3f31e08

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@isaacsolo isaacsolo changed the title Is mobile cooldown Mobile cooldown and claim all Apr 29, 2024
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/is-mobile-cooldown

@isaacsolo isaacsolo changed the title Mobile cooldown and claim all [C-4080] Mobile cooldown and claim all Apr 29, 2024
@isaacsolo isaacsolo marked this pull request as ready for review April 29, 2024 21:35
Copy link
Contributor

@dylanjeffers dylanjeffers left a comment

Choose a reason for hiding this comment

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

awesome work!!

</Text>
<Text
style={[
styles.subheader,
Copy link
Contributor

Choose a reason for hiding this comment

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

same here ideally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replied in comment above regarding the margin but was able to remove the custom color styling

}, [])

const onClaim = useCallback(() => {
if (challenge) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is fine, sometimes i like to do if (!challenge) return cause then the rest can be one indentation less


return (
<AppDrawer
modalName='ClaimAllRewards'
Copy link
Contributor

Choose a reason for hiding this comment

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

use the MODAL_NAME constant throughout

isGestureSupported={false}
title={config.title}
>
<ScrollView>
Copy link
Contributor

Choose a reason for hiding this comment

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

double check if drawer has scrollview already

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i don't think it does but lmk otherwise

{messages.totalReadyToClaim}
</Text>
</Flex>
<View style={styles.pillContainer}>
Copy link
Contributor

Choose a reason for hiding this comment

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

is there an off-the-shelf pill component we can use? lets chat about a plan here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think we talked about this before when doing web and decided to just copy + paste the existing one to make it consistent but lmk if we should do something else

<div className={wm(styles.pendingPillContainer)}>
<span className={styles.pillMessage}>
{cooldownAmount} {messages.pending}
</span>
</div>
) : null}

formatCooldownChallenges(cooldownChallenges)
)}
</Text>
{claimableAmount > 0 ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

this works, i could also see us having a single Button, with messages and variant terneries

Copy link
Contributor

@sddioulde sddioulde left a comment

Choose a reason for hiding this comment

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

nice. looks good to me. one of those features that has many UI edge cases. gotta QA QA QA both on native mobile and web

<View style={styles.claimRewardsContainer}>
{claimableAmount > 0 && onClaim
? isCooldownChallenge && isRewardsCooldownEnabled
? [renderCooldownSummaryTable()]
Copy link
Contributor

Choose a reason for hiding this comment

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

curious about the array here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeaa it's not necessary i was just modifying the existing code which had an array, removed

const challenge = userChallenges ? userChallenges[modalType] : null

// Claim rewards button config
const formatLabel = useCallback((item: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

could be nice. somewhere in common. cause web is doing sthg similar too

@isaacsolo isaacsolo merged commit 22280c6 into main May 1, 2024
12 checks passed
@isaacsolo isaacsolo deleted the is-mobile-cooldown branch May 1, 2024 17:03
audius-infra pushed a commit that referenced this pull request May 4, 2024
[9f44712] Reapply "Convert swagger.json to OAS 3.0 before generating SDK types (#8274)" (#8324) (#8344) Marcus Pasell
[2ea74f3] Fix issues with text-link variant (#8343) Dylan Jeffers
[f005b25] [PAY-2860] SDK Services Config - Configure SDK using environment (#8329) Marcus Pasell
[11a0813] Disable add to playlist for prem tracks if not purchased (#8336) Reed
[33b1916] [C-4335] Migrate all user and collection cards (#8338) Dylan Jeffers
[dafaa21] [QA-1241] Fix hidden track add to playlist allowing non hidden items (#8340) JD Francis
[4c95031] [QA-956] Add deleted tile for tracks/albums/playlists (#8333) JD Francis
[b8f5990] Add error message to upload flow (#8334) JD Francis
[22894e8] [QA-957] Fix android overflowing text on access & sale modal (#8313) JD Francis
[86f6447] [PAY-2812] Change spend to earn challenge copy (#8332) Reed
[d4c4264] Close modal on done (#8331) Saliou Diallo
[ded4933] [PAY-2861] CollectionCard fixes (#8330) Dylan Jeffers
[36277cd] Revert "Convert swagger.json to OAS 3.0 before generating SDK types (#8274)" (#8324) Marcus Pasell
[146b2e0] [QA-1212] Fix chromecast (#8323) Raymond Jacobson
[0b33e68] [PAY-2738] Public album with prem track always shows buy button (#8321) Reed
[d897a98] [C-4333] Migrate follow-users to new sign-up flow (#8312) Dylan Jeffers
[3129a3a] [PAY-2799] Show preview button for collections (#8271) Reed
[8c58601] Modify /etc/hosts on CI machines before api test (#8319) Danny
[3586f41] [PAY-2859] Fix bugs in edit app flow (#8320) Raymond Jacobson
[1bf3e97] [PAY-2801] Purchased selectable filter in library albums (#8318) Reed
[6db35c6] [C-4285] Add claim all rewards button functionality (#8292) Saliou Diallo
[a20d85a] [PAY-2728] Implement edit app flow (#8256) Raymond Jacobson
[714a3d1] [C-4288] Migrate to new cards in profile, search, and library (#8300) Dylan Jeffers
[4dceb61] Upgrade dapp-store to 0.8.1 (#8311) Dylan Jeffers
[4d37233] [PAY-2794] Use UserLink for purchases/sales tables (#8306) Reed
[fc2aef3] [PAY-2772] Fix collection description text size (#8309) Reed
[c35bfe1] [PAY-2822] Convert LockedContentDetailsTile to Harmony (#8308) Reed
[f7a921e] [PAY-2781] Poll for track access on album purchase (#8296) Reed
[621c3ee] Convert swagger.json to OAS 3.0 before generating SDK types (#8274) Marcus Pasell
[09789c1] Retrigger logic for android notification permissions post-manifest fix (#8305) JD Francis
[b9c042a] [PAY-2815] Show unlocked icon if dm content is purchased (#8303) Andrew Mendelsohn
[722e933] [PAY-2779] Fix validation for albumTrackPrice (#8302) Andrew Mendelsohn
[963bec4] Fix EditCollection playwright test (#8304) Andrew Mendelsohn
[7e0aa7e] [PAY-2823] Edit Album access control fixes (#8298) Andrew Mendelsohn
[b42b6fd] [QA-971] Fix smart collections (#8299) Raymond Jacobson
[eceb876] [PAY-2791] Show only own albums in artist dashboard (#8297) Reed
[87ce027] [Web] [Harmony] Add accounts managing you modal [C-4295] [C-4292] (#8258) nicoback2
[7a3567c] [C-4238, C-4318] Add ssr small bundle flow for mobile track page (#8293) Kyle Shanks
[c7c3752] [PAY-2800] Fix mobile navigate to album on purchase success (#8295) Reed
[f113a91] [PAY-2802] Auto-favorite tracks in purchased album (#8294) Reed
[d32934f] [C-4284] Fix rewards in mobile web (#8291) Saliou Diallo
[45c4bc6] [PAY-2775] Remove suggested tracks for albums (#8288) Andrew Mendelsohn
[22280c6] [C-4080] Mobile cooldown and claim all (#8263) Isaac Solo
[80cca19] Jail broken test (#8289) Raymond Jacobson
[d7c8e34] [PAY-2766] Analytics events for premium albums (#8262) JD Francis
[c3ee4a8] [PAY-2817] Web collections show reposts, remove artist column (#8272) Reed
[6f8bab6] Fix lint items (#8285) Raymond Jacobson
[e8debc0] [PAY-2703] Redesign mobile collection and track screen tiles (#8255) Andrew Mendelsohn
[a3964a8] Bump android build number for release-client-v1.5.78 (#8286) Raymond Jacobson
[8481f8d] [C-4327] Fix track ordering within playlist/album (#8284) Raymond Jacobson
[5165172] Bump android version for manifest changes (#8283) JD Francis
[4e60f97] [C-4312] Add UserCard (#8276) Dylan Jeffers
[35ed4ec] [ONC-82] Fix android notif permissions (#8279) JD Francis
[82e1c67] [C-4323] Improve Avatar (#8273) Dylan Jeffers
[909db7c] [C-4316, C-4317] SSR work to render webplayer and track page for web (#8268) Kyle Shanks
[7417a40] Generate sdk after ursm code removal (#8275) Raymond Jacobson
[62b5a08] Update Add Funds copy and loading state (#8266) Saliou Diallo
[4503cc7] PROTO-1328: always default to discovery relay (#8247) alecsavvy
[f42c6cd] Fix text-input spacing (#8270) Dylan Jeffers
[75fd847] [C-4270] Fix text-link transition (#8260) Dylan Jeffers
[df0349a] [PAY-2761] Add managed users endpoints (#8238) Randy Schott
[5b4c998] [ONC-84] Add try/catch (#8264) Raymond Jacobson
[2b5f89c] Fix clipped text in TracksTable name column (#8265) Reed
[c3256fa] [C-4275] Add google-inspectiontool to crawler regex (#8261) Sebastian Klingler
[5750045] [C-4033] Prevent useTabs from redirecting on page load (#8259) Sebastian Klingler
[b17ff70] [PAY-2758] Allow gated tracks to be added to playlists (#8227) Reed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants