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

Update Rewards Dashboard flow #1699

Merged
merged 12 commits into from
Jul 10, 2024
Merged

Conversation

corlard3y
Copy link
Collaborator

@corlard3y corlard3y commented Jul 5, 2024

Pull Request Template

#1694

Description

  • Problem/Feature:
  • Add Unlock Profile Button on dashboard(referral section), so users can now see dashboard and other pages when user is not registered yet. Registration will only be done when you click on unlock profile button.
  • Add onClick function to unlock profile to call useGenerateUserId hook.
  • Also the unlock profile modal sub heading will be different for only this case: Unlock your profile to proceed.

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

Screenshot 2024-07-05 at 03 41 31

Additional Context

Review & Approvals

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

Notes

@corlard3y corlard3y linked an issue Jul 5, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jul 5, 2024

In File: src/contexts/AppContext.tsx:

  1. There are missing closing brackets for the useState hooks for 'connectedPeerID' and 'blockedLoading'.
  2. There is a missing closing curly brace for the useSelector function.
  3. There is a missing closing curly brace for the 'connectWallet' function.
  4. The 'retrieveUserPGPKeyFromStorage' function is missing a closing curly brace for the if statement.
  5. The 'isPGPKey' function is missing a closing curly brace for the if statement.
  6. The 'handleConnectWallet' function is missing a closing curly brace for the if statement.
  7. The 'getUser' function is defined but not implemented.

In File: src/modules/rewards/Rewards.tsx:

  1. The 'useState' hook for 'isUserProfileUnlocked' is used incorrectly. It should be either 'useState' or 'useContext(AppContext)'.
  2. There are missing implementation details for some functions like 'handleUser'.
  3. There is a typo in the useEffect dependency array as 'status == 'success'' which should be 'status === 'success''.
  4. There are some formatting issues with the Button component.

In File: src/modules/rewards/components/ActivityStatusButton.tsx:

  1. The closing brace for the ActivityStatusButton component is missing.

In File: src/modules/rewards/components/DashboardSection.tsx:

  1. There is a missing closing brace for the Box component.
  2. There is a missing closing brace for the DashboardSection component.

In File: src/modules/rewards/components/ReferralSection.tsx:

  1. The file is empty, and the content needs to be added.

In File: src/modules/rewards/hooks/useGenerateUserId.tsx:

  1. The file is empty, and the content needs to be added.

In File: src/primaries/Profile.tsx:

  1. The file is not specified in the content provided, so it is unclear what needs to be reviewed.

In File: src/types/context.ts:

  1. The file is not specified in the content provided, so it is unclear what needs to be reviewed.

Overall, these are the identified issues and areas for improvement in the provided files.

Copy link

github-actions bot commented Jul 5, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-07-10 06:00 UTC

Copy link

github-actions bot commented Jul 5, 2024

All looks good.

Copy link
Collaborator

@rohitmalhotra1420 rohitmalhotra1420 left a comment

Choose a reason for hiding this comment

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

@corlard3y given it a top level review. Let's connect on a call for a functional review.

@@ -34,12 +42,13 @@ export enum PROFILESTATE {
type UnlockProfileModalProps = {
InnerComponentProps: {
type: UNLOCK_PROFILE_TYPE | undefined;
label?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
label?: string;
description?: string;

@@ -31,12 +32,15 @@ const UnlockProfileWrapper = ({ type = DEFAULT_PROPS.type, showConnectModal }: I
}
}, [type]);

console.log(label, 'label');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
console.log(label, 'label');

}

const DEFAULT_PROPS = {
type: UNLOCK_PROFILE_TYPE.MODAL,
};

const UnlockProfileWrapper = ({ type = DEFAULT_PROPS.type, showConnectModal }: IntroContainerProps) => {
const UnlockProfileWrapper = ({ type = DEFAULT_PROPS.type, showConnectModal, label }: IntroContainerProps) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const UnlockProfileWrapper = ({ type = DEFAULT_PROPS.type, showConnectModal, label }: IntroContainerProps) => {
const UnlockProfileWrapper = ({ type = DEFAULT_PROPS.type, showConnectModal, description }: IntroContainerProps) => {

@@ -11,14 +11,15 @@ export enum UNLOCK_PROFILE_TYPE {

interface IntroContainerProps {
type?: UNLOCK_PROFILE_TYPE;
showConnectModal?: boolean
showConnectModal?: boolean;
label?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
label?: string;
description?: string;

@@ -99,6 +121,7 @@ const Rewards: FC<RewardsProps> = () => {
<UnlockProfileWrapper
type={UNLOCK_PROFILE_TYPE.MODAL}
showConnectModal={showConnectModal}
label="Unlock your profile to proceed."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
label="Unlock your profile to proceed."
description="Unlock your profile to proceed."

</Box>

{userPushSDKInstance && userPushSDKInstance?.readmode() && showConnectModal && (
{isWalletConnected && userPushSDKInstance && userPushSDKInstance?.readmode() && showConnectModal && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{isWalletConnected && userPushSDKInstance && userPushSDKInstance?.readmode() && showConnectModal && (
{isProfileConnectModalVisible && (

Comment on lines 129 to 136
<ActivityStatusButton
size="small"
variant="primary"
onClick={generateUser}
disabled={false}
label="Unlock Profile"
isLoading={isPending}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should have a separate component for this. Not mix the the logic here. Both buttons server different purposes. Let's uses blocks button directly here.

Comment on lines 36 to 39
const ref = sessionStorage.getItem('ref');
const data = {
...(ref && { refPrimary: ref }),
userWallet: caip10WalletAddress,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be done out side a function as well. Don't need to initialise a function for this

@@ -28,7 +28,7 @@ const DashboardSection: FC<DashboardSectionProps> = ({ onGetStarted }) => {
isFetching,
} = useGetUserRewardsDetails({ caip10WalletAddress: caip10WalletAddress, enabled: isWalletConnected });

const isLoading = isUserLoading || !isSuccess;
const isLoading = isUserLoading;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can directly use isUserLoading and remove isLoading

Comment on lines +16 to +17
variant?: ButtonVariant;
size?: ButtonSize;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not required. We will not use this button on referral section

Copy link

github-actions bot commented Jul 8, 2024

I have reviewed the code in the specified files. Here are the identified issues:

  1. In 'UnlockProfile.tsx':
  • Typo in 'Internal Compoonents' should be 'Internal Components'.
  • 'INTERFACE' keyword is missing before the 'type UnlockProfileModalProps'.
  • 'useDeviceWidthCheck' should be 'useDeviceWidthCheck()' in the 'const isMobile' assignment.
  • 'handleRememberMeChange' function is missing closing bracket '}'.
  • 'missing "type" in props declaration inside the RenderToolTip component.'
  • 'tooltipContent' is not closed properly in the RenderToolTip component.
  • In the RenderToolTip component, the tooltipContent text is not enclosed in quotes.
  • 'SkeletonContainer' component is defined but not used.
  • 'CustomCheckbox' component should have lineHeight attribute enclosed in quotes.
  • The 'RenderToolTip' component is missing the return statement within its function.
  1. In 'UnlockProfileWrapper.tsx':
  • 'unlockProfileWrapper' component is missing 'className' props in the return statement.
  1. In 'ActivityButton.tsx':
  • 'if' block missing closing bracket '}' before the final 'return' statement.

Overall, these issues need to be rectified to ensure the proper functionality and readability of the code.

Please make the necessary corrections and ensure all components are functioning correctly. Let me know if you need further assistance.

Copy link

github-actions bot commented Jul 8, 2024

I have reviewed the provided code, and everything looks good.

@rohitmalhotra1420 rohitmalhotra1420 merged commit c257347 into main Jul 10, 2024
1 of 2 checks passed
corlard3y added a commit that referenced this pull request Jul 16, 2024
* update unlock profile

* add modal back to activities

* update label in unlock modal

* update flow

* New Discord Flow Added

* fixes done

* fixed the discord verification page alignment

* update useWithAuthButton

* add button onclick

* add unlock profile listener

* fix create flows

---------

Co-authored-by: abhishek-01k <[email protected]>
Co-authored-by: rohitmalhotra1420 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

😈 [Feature Enhancement] - <Update Rewards Creation dashboard flow>
3 participants