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

Rewards V2 #1772

Merged
merged 127 commits into from
Sep 30, 2024
Merged

Rewards V2 #1772

merged 127 commits into from
Sep 30, 2024

Conversation

corlard3y
Copy link
Collaborator

@corlard3y corlard3y commented Jul 29, 2024

Pull Request Template

#1744

Description

  • Rewards V2 activities
  • Daily activities, Bonus Activities, Staking Activities
  • Rewards Notification Component

Type of Change

  • Bug fix
  • New feature
  • Code refactor
  • Documentation update
  • Other (please describe):

Checklist

  • Quick PR: Is this a quick PR? Can be approved before finishing a coffee.
    • Quick PR label added
  • Not Merge Ready: Is this PR dependent on some other PR/tasks and not ready to be merged right now.
    • DO NOT Merge PR label added

Frontend Guidelines

Build & Testing

  • No errors in the build terminal
  • Engineer has tested the changes on their local environment
  • Engineer has tested the changes on deploy preview

Screenshots/Video with Explanation

  • Before: Explain the previous behavior

  • After: What's changed now

Additional Context

  • Total points not fixed yet by BE
  • Bonus activities claim rewards returning errors from BE
  • Illustrations for some of the rewards are not ready yet
  • Bonus activities error messages positioning has not been decided
  • Stake Push Activites are not implemented yet

Review & Approvals

  • Self-review completed
  • Code review by at least one other engineer
  • Documentation updates if applicable

Notes

Copy link

All looks good.

@corlard3y corlard3y added the DO NOT MERGE If the PR/task is dependent on some other task add this label to the PR. label Jul 29, 2024
Copy link

github-actions bot commented Jul 29, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-09-30 13:33 UTC

Copy link

All looks good.

Copy link

All looks good.

Copy link

All looks good.

Copy link

All looks good.

Copy link

All looks good.

@rohitmalhotra1420
Copy link
Collaborator

When I load the page for the very first time then it shows me headings only for a second. This is not the correct behaviour. I should be able to see the skeleton states.
Screenshot 2024-07-30 at 3 45 06 PM

@rohitmalhotra1420
Copy link
Collaborator

The alignment of the activity description, points icons is off in the first item as it only has 1 line of heading while rest of the items have 2 line heading. We need to fix this.

Screenshot 2024-07-30 at 3 46 27 PM

@rohitmalhotra1420
Copy link
Collaborator

If I have already claimed the Discord and Twitter Activity. Then I logout. Then when I click on the verify button of the X or discord. It asks me for connecting my wallet. Then It opens the dicord auth page in new tab or X auth page in new window and also converts the verify button to claimed at the same time.

@rohitmalhotra1420
Copy link
Collaborator

Screenshot 2024-07-30 at 3 52 41 PM Icons are not updated for every activity.

Copy link

All looks good.

Copy link

All looks good.

Copy link

In the "src/App.tsx" file:

  1. Typo: 'provess' on line 208 should be 'process'.
  2. Incomplete comment: The comment on line 150 is incomplete and should be removed.
  3. Unreachable code: The commented code on lines 143-145 and 211-215 is unnecessary and should be removed.
  4. Inconsistent naming: The function 'setcurrentTime' on line 44 should be 'setCurrentTime' to follow naming conventions.
  5. Typos: 'setcurrentTime' should be 'setCurrentTime' on lines 75 and 162.
  6. Typo: 'Provonent' on line 68 should be 'provider'.
  7. Logic issue: The check for 'appConfig?.appEnv === 'prod'' on lines 101-111 is repeated and could be better organized.
  8. Misspelling: 'Continous' on line 154 should be 'Continuous'.
  9. Variable naming: 'setSidebarCollapsed' on line 79 is not being used and can be removed.

In the "src/blocks/icons/components/BnbMonotone.tsx" file:

  1. Syntax error: There is a syntax error on lines 45-54, where the 'path' tag is not properly closed.

In the "src/blocks/icons/components/Clockwise.tsx" file:

  1. Syntax error: There is a syntax error on lines 40-57, where the paths are not properly closed.

Other files seem to be incomplete and need to be reviewed in full.

Copy link

All looks good.

Copy link

File: src/App.tsx

1. Typo in the import statement: 'styled, { ThemeProvider } from 'styled-components';' should be 'styled, ThemeProvider } from 'styled-components';
2. Typo in the state variable name: 'setcurrentTime' should be 'setCurrentTime'.
3. Typo in the handleJoyrideCallback function call: 'handleJoyrideCallback' should be 'handleJoyrideCallback()'.
4. Missing closing curly brace for the 'if' block after 'console.enable('warn', false);' block.
5. Missing closing curly brace for the 'if' block after 'return state.user;'.
6. Unused variable 'spaceUI' after its declaration within the 'useMemo' function.
7. Incorrect assignment inside the 'useMemo' dependency array: 'appConfig?.appEnv' should be 'appConfig.appEnv'.
8. Unused variable 'isSidebarHidden' declared but not used.
9. Missing closing curly brace for the 'if' block after 'do componentDidMount logic' comment.
10. Typo in the 'date.now' variable assignment: 'setcurrentTime(now)' should be 'setCurrentTime(now)'.
11. The 'callback' prop in the Joyride component should be 'callbacks' instead of 'callback'.
12. The 'default' export is 'Provess App', should be 'Export App'.
13. Possible logic issue: 'if (!account) return;' condition leads to an early return without further logic execution.

All looks good.


File: src/blocks/icons/components/Clockwise.tsx

1. Incorrect path data for the clock hand paths.
2. Missing closing tag for the 'defs' element.
3. The 'stroke-width' attribute should use camelCase as 'strokeWidth'.
4. Typo in the 'fill' attribute for the 'rect': 'fill="white"' should be 'fill: white'.
5. The 'transform' attribute should use camelCase as 'transform'.

All looks good.


File: src/blocks/icons/components/Lock.tsx

1. Incorrect path data for the lock path.
2. Missing closing tag for the 'defs' element.
3. The 'fill' attribute should use camelCase as 'fill="currentColor"'.
4. Typo in the 'transform' attribute for the 'rect': 'transform="translate(0.115723)"' should be 'transform: translate(0.115723)'.

All looks good.


File: src/blocks/icons/components/Stopwatch.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/icons/index.ts

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/ActivePushPoints.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/AlphaAccessNFT.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/BlueBonusActivitySubscribers.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/CheckCircle.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/CreateChannelPoints.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/GatedGroupPoints.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/GradientBonusActivitySubscribers.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/GreyBonusActivitySubscribers.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/MultipleRewardsCoin.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/Multiplier.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/NotificationImg.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/OrangeBonusActivitySubscribers.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/RewardsCoin.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/RockstarNFT.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/SetupProfilePoints.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushBlueCoin.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushBlueMultiplier.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushGradientCoin.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushGradientMultiplier.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushGreyCoin.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushGreyMultiplier.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushOrangeCoin.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushOrangeDoubleStarMultiplier.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushOrangeMultiplier.tsx

1. File is empty. No content found.

All looks good.


File: src/blocks/illustrations/components/StakePushPurpleCoin.tsx

1. File is empty. No content found.

All looks good.

Copy link

All looks good.

Copy link

I will start reviewing the code now. Let's begin with the given files.

File: src/App.tsx

  1. There is a typo in the variable declaration setcurrentTime. It should be setCurrentTime.
  2. The closing brace for the if statement starting with if (appConfig?.appEnv === 'prod') { seems to be missing.
  3. There is a typo in the function name Provess App, it should be Process App.
  4. There are some commented-out code blocks that should be removed.
  5. There is an unused variable dotenv imported but not used.

After fixing the issues:

import { FC, useContext, useEffect, useMemo, useState } from 'react';
import ReactGA from 'react-ga';
import { CallBackProps } from 'react-joyride';
import { useDispatch, useSelector } from 'react-redux';
import { useLocation } from 'react-router-dom';
import styled, { ThemeProvider, createGlobalStyle } from 'styled-components';
import { ChatUIProvider, darkChatTheme, IChatTheme } from '@pushprotocol/uiweb';
import InitState from 'components/InitState';
import { AppContext } from 'contexts/AppContext';
import NavigationContextProvider from 'contexts/NavigationContext';
import { useAccount, useInactiveListener } from 'hooks';
import { resetAdminSlice } from 'redux/slices/adminSlice';
import { resetChannelCreationSlice } from 'redux/slices/channelCreationSlice';
import { resetNotificationsSlice } from 'redux/slices/notificationSlice';
import { resetCanSendSlice } from 'redux/slices/sendNotificationSlice';
import { resetSpamSlice } from 'redux/slices/spamSlice';
import { resetUserSlice } from 'redux/slices/userSlice';
import UserJourneySteps from 'segments/userJourneySteps';
import Header from 'structure/Header';
import MasterInterfacePage from 'structure/MasterInterfacePage';
import Navigation from 'structure/Navigation';
import { setIndex, setRun, setWelcomeNotifsEmpty } from './redux/slices/userJourneySlice';
import GLOBALS from 'config/Globals';
import { themeDark, themeLight } from 'config/Themization';
import { appConfig } from 'config/index.js';
import { GlobalContext } from 'contexts/GlobalContext';
import { useUpdateTheme } from '@web3-onboard/react';
import { darkTheme, lightTheme } from 'config/spaceTheme';
import SpaceComponentContextProvider from 'contexts/SpaceComponentsContext';
import SpaceContextProvider from 'contexts/SpaceContext';
import { SpaceWidgetSection } from 'sections/space/SpaceWidgetSection';
import { blocksColors, getBlocksCSSVariables, Notification } from 'blocks';
import APP_PATHS from 'config/AppPaths';
import { useRewardsNotification } from 'common';

...
// Other code here

All looks good.

### File: src/blocks/icons/components/Clockwise.tsx
No issues found.

All looks good.

### File: src/blocks/icons/components/Lock.tsx
No issues found.

All looks good.

### File: src/blocks/icons/components/Stopwatch.tsx
This file is empty. Please fill in the content and then the review can be done.

### File: src/blocks/icons/index.ts
This file seems to be missing content. If there are supposed to be exports in this file, please ensure they are present for review.

### File: src/blocks/illustrations/components/ActivePushPoints.tsx - src/blocks/illustrations/components/StakePushPurpleCoin.tsx
These files are not reviewed as they haven't been provided in full.

Overall, most parts of the code look good with some minor issues that have been pointed out and addressed. Let me know if you need further assistance with the Stopwatch file or any other part of the code.

@rohitmalhotra1420 rohitmalhotra1420 merged commit 652e7f8 into main Sep 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE If the PR/task is dependent on some other task add this label to the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

😈 [Feature Enhancement] - <Rewards V2 phase>
5 participants