Skip to content

Commit

Permalink
fix: onboarding and empty fee selector (#1396)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao authored Jul 4, 2023
1 parent 6f6f9ec commit 304517b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/pages/Onboarding/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useDispatch, useSelector } from 'react-redux';

import { showAccountModalAction, showSignTermsModalAction } from '@/common/actions/general.actions';
import { StoreType } from '@/common/types/util.types';
import { Card, CTA, CTALink, Flex, H1, H2, P, TextLink } from '@/component-library';
import { Card, CTA, CTALink, Flex, H1, H2, P, Strong } from '@/component-library';
import { AuthModal, SignTermsModal } from '@/components';
import { INTERLAY_DISCORD_LINK } from '@/config/links';
import { GOVERNANCE_TOKEN } from '@/config/relay-chains';
Expand Down Expand Up @@ -94,11 +94,7 @@ const Onboarding = (): JSX.Element => {
title: 'Request Funds',
content: (
<>
If you do not have any INTR, join our Discord and request funds in the{' '}
<TextLink external weight='bold' color='secondary' to='#'>
#faucet channel
</TextLink>
.
If you do not have any INTR, join our Discord and request funds in the <Strong>#faucet</Strong> channel.
</>
),
ctaType: CTALink,
Expand Down
15 changes: 9 additions & 6 deletions src/utils/hooks/use-select-currency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,23 @@ const useSelectCurrency = (filter?: SelectCurrencyFilter): SelectCurrencyResult
const { data: oracleCurrencies } = useGetOracleCurrencies();

const filteredCurrencies = useMemo(() => {
if (currencies === undefined) {
if (!currencies) {
return [];
}

switch (filter) {
case SelectCurrencyFilter.TRADEABLE_FOR_NATIVE_CURRENCY: {
if (pools === undefined) {
return [];
if (!pools?.length) {
return [GOVERNANCE_TOKEN];
}

return currencies.filter(canBeSwappedForNativeCurrency(pools));
}
case SelectCurrencyFilter.ISSUE_GRIEFING_COLLATERAL_CURRENCY: {
if (oracleCurrencies === undefined) {
return [];
if (!oracleCurrencies?.length) {
return [GOVERNANCE_TOKEN];
}

return currencies.filter(canBeUsedAsIssueGriefingCollateral(oracleCurrencies));
}
default:
Expand All @@ -85,7 +88,7 @@ const useSelectCurrency = (filter?: SelectCurrencyFilter): SelectCurrencyResult
};
});

if (filter !== undefined) {
if (!filter) {
parsedTokenData = parsedTokenData.sort((currencyA, currencyB) =>
currencyB.balance.sub(currencyA.balance).toNumber()
);
Expand Down

2 comments on commit 304517b

@vercel
Copy link

@vercel vercel bot commented on 304517b Jul 4, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 304517b Jul 4, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.