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

Tim/eng 2510 not all tokens in token list can be swapped #541

Merged
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
22 changes: 10 additions & 12 deletions src/app/screens/home/balanceCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ const RowContainer = styled.div((props) => ({
marginTop: props.theme.spacing(11),
}));

const BalanceHeadingText = styled.h1((props) => ({
const BalanceHeadingText = styled.h3((props) => ({
...props.theme.headline_category_s,
color: props.theme.colors.white['200'],
textTransform: 'uppercase',
opacity: 0.7,
}));

const CurrencyText = styled.h1((props) => ({
const CurrencyText = styled.label((props) => ({
...props.theme.headline_category_s,
color: props.theme.colors.white['0'],
fontSize: 13,
}));

const BalanceAmountText = styled.h1((props) => ({
const BalanceAmountText = styled.p((props) => ({
...props.theme.headline_xl,
color: props.theme.colors.white['0'],
}));
Expand Down Expand Up @@ -88,15 +88,13 @@ function BalanceCard(props: BalanceCardProps) {
<BarLoader loaderSize={LoaderSize.LARGE} />
</BarLoaderContainer>
) : (
<BalanceAmountText>
<NumericFormat
value={calculateTotalBalance()}
displayType="text"
prefix={`${currencySymbolMap[fiatCurrency]}`}
thousandSeparator
renderText={(value: string) => <BalanceAmountText>{value}</BalanceAmountText>}
/>
</BalanceAmountText>
<NumericFormat
value={calculateTotalBalance()}
displayType="text"
prefix={`${currencySymbolMap[fiatCurrency]}`}
thousandSeparator
renderText={(value: string) => <BalanceAmountText>{value}</BalanceAmountText>}
/>
)}
</>
);
Expand Down
8 changes: 4 additions & 4 deletions src/app/screens/swap/swapTokenBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ export const RowContainer = styled.div({
alignItems: 'center',
});

const TitleText = styled.h1((props) => ({
const TitleText = styled.h3((props) => ({
...props.theme.body_medium_m,
flex: 1,
display: 'flex',
}));

const Text = styled.h1((props) => ({
const Text = styled.p((props) => ({
...props.theme.body_medium_m,
}));

const BalanceText = styled.h1((props) => ({
const BalanceText = styled.label((props) => ({
...props.theme.body_medium_m,
color: props.theme.colors.white['400'],
marginRight: props.theme.spacing(2),
Expand Down Expand Up @@ -90,7 +90,7 @@ const CoinText = styled.div((props) => ({
color: props.theme.colors.white['0'],
}));

export const EstimateUSDText = styled.h1((props) => ({
export const EstimateUSDText = styled.p((props) => ({
...props.theme.body_medium_m,
color: props.theme.colors.white['400'],
marginLeft: 'auto',
Expand Down
7 changes: 5 additions & 2 deletions src/app/screens/swap/useSwap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ export function useSwap(): UseSwap {
} = useWalletSelector();
const { isSponsored } = useSponsoredTransaction(XVERSE_SPONSOR_2_URL);

const acceptableCoinList =
coinsList?.filter((c) => alexSDK.getCurrencyFrom(c.principal) != null) ?? [];
const acceptableCoinList = (coinsList || [])
.filter((c) => alexSDK.getCurrencyFrom(c.principal) != null)
// TODO tim: remove this once alexsdk fix issue here
// https://github.com/alexgo-io/alex-sdk/issues/2
.filter((c) => c.assetName !== 'brc20-db20');

const [inputAmount, setInputAmount] = useState('');
const [slippage, setSlippage] = useState(0.04);
Expand Down