-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
add sticky style #4848
base: develop
Are you sure you want to change the base?
add sticky style #4848
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -111,171 +111,167 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||
icon: <IconInfoOutline24 color={semanticColors.golden[700]} />, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
export const PassportBanner = () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const { info, updateState, fetchUserMBDScore, handleSign, refreshScore } = | ||||||||||||||||||||||||||||||||||||||||||||||||||||
usePassport(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const { currentRound, passportState, passportScore, qfEligibilityState } = | ||||||||||||||||||||||||||||||||||||||||||||||||||||
info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
const { info, updateState, fetchUserMBDScore, handleSign, refreshScore } = usePassport(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const { currentRound, passportState, passportScore, qfEligibilityState } = info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const { formatMessage, locale } = useIntl(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const { connector } = useAccount(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const { isOnSolana, handleSingOutAndSignInWithEVM } = useGeneralWallet(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const [showModal, setShowModal] = useState<boolean>(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const [signWithWallet, setSignWithWallet] = useState<boolean>(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
const isGSafeConnector = connector?.id === 'safe'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+122
to
+124
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix formatting issues in blank lines and indentation Static analysis tools have detected extra spaces on blank lines and incorrect indentation. For code cleanliness and adherence to the project's coding standards, please remove unnecessary whitespace and adjust indentation where necessary. Apply this diff: -
-
-
const isGSafeConnector = connector?.id === 'safe';
-
// Check if the eligibility state or current round is not loaded yet
const isLoading = qfEligibilityState === undefined || currentRound === undefined;
-
// Only render the banner when the data is available
if (isLoading) {
- return null; // Or return a spinner or loading message if you'd like
+ return null; // Or return a spinner or loading message if you'd like
}
-
return !isOnSolana ? (
+ <>
<PassportBannerWrapper
- $bgColor={PassportBannerData[qfEligibilityState].bg}
+ $bgColor={PassportBannerData[qfEligibilityState].bg}
> Also applies to: 127-127, 130-130, 132-132, 134-134, 136-136 🧰 Tools🪛 GitHub Check: build
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
// Check if the eligibility state or current round is not loaded yet | ||||||||||||||||||||||||||||||||||||||||||||||||||||
const isLoading = !qfEligibilityState || !currentRound; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
// Only render the banner when the data is available | ||||||||||||||||||||||||||||||||||||||||||||||||||||
if (isLoading) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
return null; // Or return a spinner or loading message if you'd like | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+125
to
+131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure correct checking of undefined values to prevent logical errors Using Apply this diff to adjust the condition: - const isLoading = !qfEligibilityState || !currentRound;
+ const isLoading = qfEligibilityState === undefined || currentRound === undefined; 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: build
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
return !isOnSolana ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<PassportBannerWrapper | ||||||||||||||||||||||||||||||||||||||||||||||||||||
$bgColor={PassportBannerData[qfEligibilityState].bg} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Flex gap='8px' $alignItems='center'> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<IconWrapper> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{PassportBannerData[qfEligibilityState].icon} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</IconWrapper> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<P> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: PassportBannerData[qfEligibilityState] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
.content, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
data: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
qfEligibilityState === | ||||||||||||||||||||||||||||||||||||||||||||||||||||
EQFElegibilityState.NOT_STARTED && | ||||||||||||||||||||||||||||||||||||||||||||||||||||
currentRound | ||||||||||||||||||||||||||||||||||||||||||||||||||||
? smallFormatDate( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
new Date( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
currentRound?.beginDate, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
: undefined, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{currentRound && | ||||||||||||||||||||||||||||||||||||||||||||||||||||
qfEligibilityState === | ||||||||||||||||||||||||||||||||||||||||||||||||||||
EQFElegibilityState.RECHECK_ELIGIBILITY && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{' '} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<strong> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{new Date(currentRound.endDate) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
.toLocaleString(locale || 'en-US', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
day: 'numeric', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
month: 'short', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
.replace(/,/g, '')} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</strong> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</P> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</Flex> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === | ||||||||||||||||||||||||||||||||||||||||||||||||||||
EQFElegibilityState.CHECK_ELIGIBILITY && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => fetchUserMBDScore()}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'qf_donor_eligibility.banner.link.check_eligibility', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === | ||||||||||||||||||||||||||||||||||||||||||||||||||||
EQFElegibilityState.RECHECK_ELIGIBILITY && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => setShowModal(true)}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'qf_donor_eligibility.banner.link.recheck_eligibility', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === EQFElegibilityState.PROCESSING && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledStatus> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.processing', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Spinner color={brandColors.mustard[600]} size={25} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledStatus> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === | ||||||||||||||||||||||||||||||||||||||||||||||||||||
EQFElegibilityState.MORE_INFO_NEEDED && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => setShowModal(true)}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.add_more_info', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === EQFElegibilityState.NOT_SIGNED && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => setSignWithWallet(true)}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.sign_message', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<IconWalletOutline16 /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</PassportBannerWrapper> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{showModal && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<PassportModal | ||||||||||||||||||||||||||||||||||||||||||||||||||||
qfEligibilityState={qfEligibilityState} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
passportState={passportState} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
passportScore={passportScore} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
currentRound={currentRound} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setShowModal={setShowModal} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
updateState={updateState} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
refreshScore={refreshScore} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
handleSign={handleSign} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{signWithWallet && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<SignWithWalletModal | ||||||||||||||||||||||||||||||||||||||||||||||||||||
isGSafeConnector={isGSafeConnector} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setShowModal={() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setSignWithWallet(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<PassportBannerWrapper | ||||||||||||||||||||||||||||||||||||||||||||||||||||
$bgColor={PassportBannerData[qfEligibilityState].bg} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
$bgColor={PassportBannerData[qfEligibilityState].bg} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Flex gap="8px" $alignItems="center"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<IconWrapper> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{PassportBannerData[qfEligibilityState].icon} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</IconWrapper> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<P> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: PassportBannerData[qfEligibilityState].content, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
data: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
qfEligibilityState === EQFElegibilityState.NOT_STARTED && | ||||||||||||||||||||||||||||||||||||||||||||||||||||
currentRound | ||||||||||||||||||||||||||||||||||||||||||||||||||||
? smallFormatDate(new Date(currentRound?.beginDate)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
: undefined, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{currentRound && qfEligibilityState === EQFElegibilityState.RECHECK_ELIGIBILITY && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{' '} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<strong> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{new Date(currentRound.endDate) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
.toLocaleString(locale || 'en-US', { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
day: 'numeric', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
month: 'short', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
.replace(/,/g, '')} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</strong> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</P> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</Flex> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === EQFElegibilityState.CHECK_ELIGIBILITY && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => fetchUserMBDScore()}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.to_activate_your_gitcoin_passport', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'qf_donor_eligibility.banner.link.check_eligibility', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</P> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledP onClick={handleSingOutAndSignInWithEVM}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+170
to
+178
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid duplicating conditional rendering for similar eligibility states The rendering logic for Apply this diff: { (qfEligibilityState === EQFElegibilityState.CHECK_ELIGIBILITY || qfEligibilityState === EQFElegibilityState.RECHECK_ELIGIBILITY) && (
<StyledLink onClick={() => {
+ qfEligibilityState === EQFElegibilityState.CHECK_ELIGIBILITY ? fetchUserMBDScore() : setShowModal(true);
+ }}>
<GLink>
{formatMessage({
- id: 'qf_donor_eligibility.banner.link.check_eligibility',
+ id: qfEligibilityState === EQFElegibilityState.CHECK_ELIGIBILITY
+ ? 'qf_donor_eligibility.banner.link.check_eligibility'
+ : 'qf_donor_eligibility.banner.link.recheck_eligibility',
})}
</GLink>
</StyledLink>
)} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === EQFElegibilityState.RECHECK_ELIGIBILITY && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => setShowModal(true)}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.switch_to_evm', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'qf_donor_eligibility.banner.link.recheck_eligibility', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledP> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === EQFElegibilityState.PROCESSING && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledStatus> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.processing', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<Spinner color={brandColors.mustard[600]} size={25} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledStatus> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === EQFElegibilityState.MORE_INFO_NEEDED && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => setShowModal(true)}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.add_more_info', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{qfEligibilityState === (EQFElegibilityState as any).NOT_SIGNED && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledLink onClick={() => setSignWithWallet(true)}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.sign_message', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</GLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<IconWalletOutline16 /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</PassportBannerWrapper> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{showModal && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<PassportModal | ||||||||||||||||||||||||||||||||||||||||||||||||||||
qfEligibilityState={qfEligibilityState} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
passportState={passportState} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
passportScore={passportScore} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
currentRound={currentRound} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setShowModal={setShowModal} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
updateState={updateState} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
refreshScore={refreshScore} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
handleSign={handleSign} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{signWithWallet && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<SignWithWalletModal | ||||||||||||||||||||||||||||||||||||||||||||||||||||
isGSafeConnector={isGSafeConnector} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setShowModal={() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setSignWithWallet(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<PassportBannerWrapper $bgColor={PassportBannerData[qfEligibilityState].bg}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<P> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.to_activate_your_gitcoin_passport', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</P> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
<StyledP onClick={handleSingOutAndSignInWithEVM}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
{formatMessage({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
id: 'label.switch_to_evm', | ||||||||||||||||||||||||||||||||||||||||||||||||||||
})} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</StyledP> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
</PassportBannerWrapper> | ||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
interface IPassportBannerWrapperProps { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
$bgColor: EPBGState; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
export const PassportBannerWrapper = styled(Flex)<IPassportBannerWrapperProps>` | ||||||||||||||||||||||||||||||||||||||||||||||||||||
flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
background-color: ${props => bgColor[props.$bgColor]}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
padding: 16px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
align-items: center; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
justify-content: center; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
gap: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
position: relative; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
${mediaQueries.tablet} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
flex-direction: row; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
background-color: ${props => bgColor[props.$bgColor]}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
padding: 16px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
align-items: center; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
justify-content: center; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
gap: 8px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
position: sticky; /* Change this to sticky */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
top: 0; /* This keeps it at the top as the user scrolls */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
z-index: 1000; /* Ensure it stays above other content */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
${mediaQueries.tablet} { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
flex-direction: row; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
`; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
const IconWrapper = styled.div` | ||||||||||||||||||||||||||||||||||||||||||||||||||||
width: 30px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
`; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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.
Fix formatting issues as indicated by static analysis
Static analysis tools have identified formatting inconsistencies on these lines. Please adjust the indentation and spacing to align with the project's code style guidelines.
Apply this diff to correct the formatting:
+ const { info, updateState, fetchUserMBDScore, handleSign, refreshScore } = usePassport(); const { currentRound, passportState, passportScore, qfEligibilityState } = info;
🧰 Tools
🪛 GitHub Check: build