-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
In File: src/contexts/AppContext.tsx:
In File: src/modules/rewards/Rewards.tsx:
In File: src/modules/rewards/components/ActivityStatusButton.tsx:
In File: src/modules/rewards/components/DashboardSection.tsx:
In File: src/modules/rewards/components/ReferralSection.tsx:
In File: src/modules/rewards/hooks/useGenerateUserId.tsx:
In File: src/primaries/Profile.tsx:
In File: src/types/context.ts:
Overall, these are the identified issues and areas for improvement in the provided files. |
|
All looks good. |
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.
@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; |
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.
label?: string; | |
description?: string; |
@@ -31,12 +32,15 @@ const UnlockProfileWrapper = ({ type = DEFAULT_PROPS.type, showConnectModal }: I | |||
} | |||
}, [type]); | |||
|
|||
console.log(label, 'label'); |
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.
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) => { |
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.
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; |
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.
label?: string; | |
description?: string; |
src/modules/rewards/Rewards.tsx
Outdated
@@ -99,6 +121,7 @@ const Rewards: FC<RewardsProps> = () => { | |||
<UnlockProfileWrapper | |||
type={UNLOCK_PROFILE_TYPE.MODAL} | |||
showConnectModal={showConnectModal} | |||
label="Unlock your profile to proceed." |
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.
label="Unlock your profile to proceed." | |
description="Unlock your profile to proceed." |
src/modules/rewards/Rewards.tsx
Outdated
</Box> | ||
|
||
{userPushSDKInstance && userPushSDKInstance?.readmode() && showConnectModal && ( | ||
{isWalletConnected && userPushSDKInstance && userPushSDKInstance?.readmode() && showConnectModal && ( |
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.
{isWalletConnected && userPushSDKInstance && userPushSDKInstance?.readmode() && showConnectModal && ( | |
{isProfileConnectModalVisible && ( |
<ActivityStatusButton | ||
size="small" | ||
variant="primary" | ||
onClick={generateUser} | ||
disabled={false} | ||
label="Unlock Profile" | ||
isLoading={isPending} | ||
/> |
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.
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.
const ref = sessionStorage.getItem('ref'); | ||
const data = { | ||
...(ref && { refPrimary: ref }), | ||
userWallet: caip10WalletAddress, |
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.
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; |
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.
We can directly use isUserLoading and remove isLoading
variant?: ButtonVariant; | ||
size?: ButtonSize; |
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.
Not required. We will not use this button on referral section
I have reviewed the code in the specified files. Here are the identified issues:
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. |
I have reviewed the provided code, and everything looks good. |
* 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]>
Pull Request Template
#1694
Description
Type of Change
Checklist
Frontend Guidelines
Build & Testing
Screenshots/Video with Explanation
Before: Explain the previous behavior
After: What's changed now
Additional Context
Review & Approvals
Notes