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

fix: extension crashes when closing the broadcast success screen #662

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
46 changes: 20 additions & 26 deletions src/app/screens/createInscription/CompleteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import Success from '@assets/img/send/check_circle.svg';

import ActionButton from '@components/button';
import CopyButton from '@components/copyButton';
import type { SettingsNetwork } from '@secretkeylabs/xverse-core/types';
import type { SettingsNetwork } from '@secretkeylabs/xverse-core';
import { getBtcTxStatusUrl } from '@utils/helper';

const TxStatusContainer = styled.div({
background: 'rgba(25, 25, 48, 0.74)',
const TxStatusContainer = styled.div((props) => ({
background: props.theme.colors.elevation0,
display: 'flex',
flexDirection: 'column',
height: '100%',
backdropFilter: 'blur(16px)',
});
}));

const Container = styled.div({
display: 'flex',
Expand Down Expand Up @@ -71,27 +71,21 @@ const CopyButtonContainer = styled.div({
padding: 2,
});

const InfoMessageContainer = styled.div({
marginLeft: 8,
marginRight: 8,
marginTop: 20,
});

const Image = styled.img({
alignSelf: 'center',
transform: 'all',
});

const HeadingText = styled.h1((props) => ({
...props.theme.headline_s,
color: props.theme.colors.white['0'],
...props.theme.typography.headline_s,
color: props.theme.colors.white_0,
textAlign: 'center',
marginTop: props.theme.spacing(8),
}));

const BodyText = styled.h1((props) => ({
...props.theme.body_m,
color: props.theme.colors.white['400'],
const BodyText = styled.p((props) => ({
...props.theme.typography.body_m,
color: props.theme.colors.white_400,
marginTop: props.theme.spacing(8),
textAlign: 'center',
overflowWrap: 'break-word',
Expand All @@ -101,29 +95,29 @@ const BodyText = styled.h1((props) => ({
marginRight: props.theme.spacing(5),
}));

const TxIDText = styled.h1((props) => ({
const TxIDText = styled.p((props) => ({
...props.theme.headline_category_s,
color: props.theme.colors.white['400'],
color: props.theme.colors.white_400,
marginTop: props.theme.spacing(8),
textTransform: 'uppercase',
}));

const BeforeButtonText = styled.h1((props) => ({
...props.theme.body_m,
color: props.theme.colors.white['400'],
const BeforeButtonText = styled.p((props) => ({
...props.theme.typography.body_m,
color: props.theme.colors.white_400,
}));

const IDText = styled.h1((props) => ({
...props.theme.body_m,
color: props.theme.colors.white['0'],
const IDText = styled.p((props) => ({
...props.theme.typography.body_m,
color: props.theme.colors.white_0,
marginTop: props.theme.spacing(2),
wordBreak: 'break-all',
}));

const ButtonText = styled.h1((props) => ({
...props.theme.body_m,
const ButtonText = styled.p((props) => ({
...props.theme.typography.body_m,
marginRight: props.theme.spacing(2),
color: props.theme.colors.white['0'],
color: props.theme.colors.white_0,
}));

const ButtonImage = styled.img((props) => ({
Expand Down
25 changes: 12 additions & 13 deletions src/app/screens/transactionStatus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import { useTranslation } from 'react-i18next';
import { useLocation, useNavigate } from 'react-router-dom';
import styled from 'styled-components';

const TxStatusContainer = styled.div({
background: 'rgba(25, 25, 48, 0.74)',
const TxStatusContainer = styled.div((props) => ({
background: props.theme.colors.elevation0,
display: 'flex',
flexDirection: 'column',
height: '100%',
backdropFilter: 'blur(16px)',
});
}));

const Container = styled.div({
display: 'flex',
Expand Down Expand Up @@ -84,14 +83,14 @@ const Image = styled.img({
});

const HeadingText = styled.h1((props) => ({
...props.theme.headline_s,
...props.theme.typography.headline_s,
color: props.theme.colors.white_0,
textAlign: 'center',
marginTop: props.theme.spacing(8),
}));

const BodyText = styled.h1((props) => ({
...props.theme.body_m,
...props.theme.typography.body_m,
color: props.theme.colors.white_400,
marginTop: props.theme.spacing(8),
textAlign: 'center',
Expand All @@ -110,19 +109,19 @@ const TxIDText = styled.h1((props) => ({
}));

const BeforeButtonText = styled.h1((props) => ({
...props.theme.body_m,
...props.theme.typography.body_m,
color: props.theme.colors.white_400,
}));

const IDText = styled.h1((props) => ({
...props.theme.body_m,
...props.theme.typography.body_m,
color: props.theme.colors.white_0,
marginTop: props.theme.spacing(2),
wordBreak: 'break-all',
}));

const ButtonText = styled.h1((props) => ({
...props.theme.body_m,
...props.theme.typography.body_m,
marginRight: props.theme.spacing(2),
color: props.theme.colors.white_0,
}));
Expand Down Expand Up @@ -187,10 +186,10 @@ function TransactionStatus() {

const onCloseClick = () => {
if (browserTx) window.close();
else if (isRareSat) navigate('/nftDashboard?tab=rareSats');
else if (isOrdinal) navigate('nftDashboard?tab=inscriptions');
else if (isNft) navigate('/nftDashboard?tab=nfts');
else navigate(-3);
else if (isRareSat) navigate('/nft-dashboard?tab=rareSats');
else if (isOrdinal) navigate('/nft-dashboard?tab=inscriptions');
else if (isNft) navigate('/nft-dashboard?tab=nfts');
else navigate('/');
};

const handleClickTrySwapAgain = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@
},
"COMPLETE": {
"INSCRIBED": "Ordinal inscribed",
"MESSAGE": "Your ordinal have been successfully inscribed and should appear in a few minutes.",
"MESSAGE": "Your ordinal has been successfully inscribed and should appear in a few minutes.",
"SEE_ON": "See on",
"BITCOIN_EXPLORER": "mempool",
"TRANSACTION_ID": "Transaction ID",
Expand Down