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

change gateway and fix onboarding ui #106

Merged
merged 3 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const router = createHashRouter([
element: <CreatePassword />,
},
{
path: 'create-wallet-success',
path: 'wallet-success/:action',
element: <CreateWalletSuccess />,
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/createPassword/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function CreatePassword(): JSX.Element {
if (confirmPassword === password) {
const encryptedSeed = await encryptSeedPhrase(seedPhrase, password);
dispatch(storeEncryptedSeedAction(encryptedSeed));
navigate('/create-wallet-success');
navigate('/wallet-success/create');
}
} catch (err) {
setError(t('CONFIRM_PASSWORD_MATCH_ERROR'));
Expand Down
7 changes: 4 additions & 3 deletions src/app/screens/createWalletSuccess/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Pin from '@assets/img/createWalletSuccess/pin.svg';
import Logo from '@assets/img/createWalletSuccess/logo.svg';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
import { useParams } from 'react-router-dom';

const InstructionsContainer = styled.div((props) => ({
display: 'flex',
Expand Down Expand Up @@ -72,7 +73,7 @@ const ContinueButton = styled.button((props) => ({

function CreateWalletSuccess(): JSX.Element {
const { t } = useTranslation('translation', { keyPrefix: 'WALLET_SUCCESS_SCREEN' });

const { action } = useParams();
const handleOpenWallet = () => {
window.close();
};
Expand All @@ -81,8 +82,8 @@ function CreateWalletSuccess(): JSX.Element {
<>
<ContentContainer>
<img src={CheckCircle} alt="success" />
<Title>{t('SCREEN_TITLE')}</Title>
<Subtitle>{t('SCREEN_SUBTITLE')}</Subtitle>
<Title>{action === 'restore' ? t('RESTORE_SCREEN_TITLE') : t('SCREEN_TITLE')}</Title>
<Subtitle>{action === 'restore' ? t('RESTORE_SCREEN_SUBTITLE') : t('SCREEN_SUBTITLE')}</Subtitle>
</ContentContainer>
<ContinueButton onClick={handleOpenWallet}>{t('CLOSE_TAB')}</ContinueButton>
<InstructionsContainer>
Expand Down
21 changes: 16 additions & 5 deletions src/app/screens/legalLinks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from 'styled-components';
import LinkIcon from '@assets/img/linkIcon.svg';
import { useNavigate } from 'react-router-dom';
import { saveIsTermsAccepted } from '@utils/localStorage';
import Seperator from '@components/seperator';
import { PRIVACY_POLICY_LINK, TERMS_LINK } from '@utils/constants';

const Container = styled.div((props) => ({
Expand All @@ -15,7 +16,7 @@ const Container = styled.div((props) => ({
}));

const Title = styled.h1((props) => ({
...props.theme.tile_text,
...props.theme.bold_tile_text,
color: props.theme.colors.white['0'],
marginTop: props.theme.spacing(20),
}));
Expand All @@ -34,6 +35,15 @@ const ActionButton = styled.a((props) => ({
color: props.theme.colors.white['0'],
}));

const CustomisedActionButton = styled(ActionButton)`
:hover {
opacity: 0.8;
}
:active {
opacity: 1;
}
`;

const ActionButtonsContainer = styled.div((props) => ({
marginTop: props.theme.spacing(20),
}));
Expand Down Expand Up @@ -71,14 +81,15 @@ function LegalLinks() {
<Title>{t('SCREEN_TITLE')}</Title>
<SubTitle>{t('SCREEN_SUBTITLE')}</SubTitle>
<ActionButtonsContainer>
<ActionButton href={TERMS_LINK} target="_blank">
<CustomisedActionButton href={TERMS_LINK} target="_blank">
{t('TERMS_SERVICES_LINK_BUTTON')}
<img src={LinkIcon} alt="terms" />
</ActionButton>
<ActionButton href={PRIVACY_POLICY_LINK} target="_blank">
</CustomisedActionButton>
<Seperator />
<CustomisedActionButton href={PRIVACY_POLICY_LINK} target="_blank">
{t('PRIVACY_POLICY_LINK_BUTTON')}
<img src={LinkIcon} alt="privacy" />
</ActionButton>
</CustomisedActionButton>
</ActionButtonsContainer>
<AcceptButton onClick={handleLegalAccept}>{t('ACCEPT_LEGAL_BUTTON')}</AcceptButton>
</Container>
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/restoreWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function RestoreWallet(): JSX.Element {
setError('');
const seed = cleanMnemonic(seedPhrase);
await restoreWallet(seed, password);
navigate('/create-wallet-success');
navigate('/wallet-success/restore');
} else {
setError(t('CREATE_PASSWORD_SCREEN.CONFIRM_PASSWORD_MATCH_ERROR'));
}
Expand Down
7 changes: 2 additions & 5 deletions src/app/utils/helper.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { FungibleToken, Account, StxMempoolTransactionData } from '@secretkeylabs/xverse-core/types';
import { Account, StxMempoolTransactionData } from '@secretkeylabs/xverse-core/types';
import { NftData } from '@secretkeylabs/xverse-core/types/api/stacks/assets';
import { getStacksInfo } from '@secretkeylabs/xverse-core/api';
import BigNumber from 'bignumber.js';
import {
btcToSats, getBtcFiatEquivalent, getStxFiatEquivalent, stxToMicrostacks,
} from '@secretkeylabs/xverse-core';

const validUrl = require('valid-url');

Expand Down Expand Up @@ -69,7 +66,7 @@ export function getExplorerUrl(stxAddress: string): string {
}

export function getFetchableUrl(uri: string, protocol: string): string | undefined {
const publicIpfs = 'https://ipfs.io/ipfs';
const publicIpfs = 'https:/cf-ipfs.com/ipfs';
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like it's missing a /?

if (protocol === 'http') return uri;
if (protocol === 'ipfs') {
const url = uri.split('//');
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@
"CLOSE_TAB": "Close this tab",
"CLICK": "Click",
"THEN": "then",
"OPEN_WALLET":"to open your wallet"
"OPEN_WALLET":"to open your wallet",
"RESTORE_SCREEN_TITLE": "Wallet restored",
"RESTORE_SCREEN_SUBTITLE": "Your wallet has been successfully restored, you can now log in to it."
Copy link
Contributor

Choose a reason for hiding this comment

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

"Your wallet has been successfully restored."

No need for the "you can now log in to it"

},
"LOGIN_SCREEN": {
"WELCOME_MESSAGE_FIRST_LOGIN": "Welcome!",
Expand Down
7 changes: 7 additions & 0 deletions src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ const Theme = {
fontSize: 18,
letterSpacing: 0.02,
},
bold_tile_text: {
fontFamily: 'Satoshi-Bold',
fontStyle: 'normal',
fontWeight: '700',
fontSize: 18,
letterSpacing: 0.02,
},
headline_l: {
fontFamily: 'Satoshi-Bold',
fontStyle: 'normal',
Expand Down