feat(client): improve SuperBlock cert claiming UX (#41147)
* feat(client): improve SuperBlock cert claiming UX * broken: add certCard foundation * broken: add TODO comments for scatter-brain * restructure stepsToClaimSelector * add api-server verifyCanClaimCert logic * temp: correct verifyCanClaim URL * move GET logic to CertificationCard, remove console.logs * add error handling, and navigation logic * correct verification logical flow * fix completion-epic updates, fix cert verify * update widget to button, disable button unless verified * working: refactor CertChallenge with hook state * add StepsType * update Honesty snapshot * add DonationModal to SuperBlockIntro * disable Claim Cert button unless also isHonest * prevent warning when viewing cert * test: use navigate in Modal to return to hash * test: replace gatsby.navigate with reach/router.navigate * add propTypes * fix: rename propTypes -> prop-types * use react-scrollable-anchor to squash modal bug * update location parser type * open-source Oliver's suggestion * fix superblock title * add claim-cert-from-learn tests * use larger tests Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix some cypress stuff * fix ShowCertification cypress test Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@@ -176,6 +176,19 @@ export const completedChallengesSelector = state =>
|
||||
userSelector(state).completedChallenges || [];
|
||||
export const completionCountSelector = state => state[ns].completionCount;
|
||||
export const currentChallengeIdSelector = state => state[ns].currentChallengeId;
|
||||
export const stepsToClaimSelector = state => {
|
||||
const user = userSelector(state);
|
||||
const currentCerts = certificatesByNameSelector(user.username)(
|
||||
state
|
||||
).currentCerts;
|
||||
return {
|
||||
currentCerts: currentCerts,
|
||||
isHonest: user?.isHonest,
|
||||
isShowName: user?.profileUI?.showName,
|
||||
isShowCerts: user?.profileUI?.showCerts,
|
||||
isShowProfile: !user?.profileUI?.isLocked
|
||||
};
|
||||
};
|
||||
export const isDonatingSelector = state => userSelector(state).isDonating;
|
||||
export const isOnlineSelector = state => state[ns].isOnline;
|
||||
export const isSignedInSelector = state => !!state[ns].appUsername;
|
||||
|
Reference in New Issue
Block a user