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

BLOCKCHAIN-511 FE onboarding improvements #325

Merged
merged 3 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/CheckExtenstionWalletProvider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export function CheckExtensionWalletProvider({ children }) {
const walletAddress = useSelector(blockchainSelectors.userWalletAddressSelector);
const wallets = useSelector(blockchainSelectors.allWalletsSelector);
const [acceptedBrowser, setAcceptedBrowser] = useState(
localStorage.getItem('unsupportedBrowserAcceptedByUser'),
sessionStorage.getItem('unsupportedBrowserAcceptedByUser'),
);
const isUnsupportedBrowser = useIsUnsupportedBrowser();
const onUnsupportedBrowserAccept = () => {
localStorage.setItem('unsupportedBrowserAcceptedByUser', true);
sessionStorage.setItem('unsupportedBrowserAcceptedByUser', true);
setAcceptedBrowser(true);
};

Expand Down
8 changes: 4 additions & 4 deletions src/components/GuidedSetup/WalletListComponent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ function WalletListComponent() {
<Button
primary
className={styles.connectWalletAddressButton}
onClick={() => setCentralizedBackendAddress(walletObject.address, userId, { dispatch })}
onClick={() => {
dispatch(blockchainActions.setUserWallet.success(walletObject.address));
setCentralizedBackendAddress(walletObject.address, userId, { dispatch });
}}
>
Connect
</Button>
<Button onClick={() => dispatch(blockchainActions.setUserWallet.success(walletObject.address))}>
Use
</Button>
</div>
<br />
</div>
Expand Down
29 changes: 15 additions & 14 deletions src/components/GuidedSetup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,39 +80,40 @@ function GuidedSetup({ children }) {
);
}

if (!notResidentAcceptedByUser && !isResident && userHasIdentity !== 'true') {
if ((!userWalletAddress && !walletAddress) || userWalletAddress < 2) {
return (
<GuidedSetupWrapper>
<InstructionOnBoard setIsClicked={setNotResidentAcceptedByUser} />
<NoConnectedWalletComponent />
</GuidedSetupWrapper>
);
}
if (
(isUserEligibleForComplimentaryLLD
|| isIdentityEmpty
|| isSkippedOnBoardingGetLLD === 'secondStep')
&& isSkippedOnBoardingGetLLD !== 'true'
&& userHasIdentity !== 'true'
) {

if (!wallets.map((w) => w.address).includes(userWalletAddress)) {
return (
<GuidedSetupWrapper>
<OnBoarding setIsSkippedOnBoardingGetLLD={setIsSkippedOnBoardingGetLLD} />
<MissingWalletComponent />
</GuidedSetupWrapper>
);
}

if (!userWalletAddress && !walletAddress) {
if (!notResidentAcceptedByUser && !isResident && userHasIdentity !== 'true') {
return (
<GuidedSetupWrapper>
<NoConnectedWalletComponent />
<InstructionOnBoard setIsClicked={setNotResidentAcceptedByUser} />
</GuidedSetupWrapper>
);
}

if (!wallets.map((w) => w.address).includes(userWalletAddress)) {
if (
(isUserEligibleForComplimentaryLLD
|| isIdentityEmpty
|| isSkippedOnBoardingGetLLD === 'secondStep')
&& isSkippedOnBoardingGetLLD !== 'true'
&& userHasIdentity !== 'true'
) {
return (
<GuidedSetupWrapper>
<MissingWalletComponent />
<OnBoarding setIsSkippedOnBoardingGetLLD={setIsSkippedOnBoardingGetLLD} />
</GuidedSetupWrapper>
);
}
Expand Down