Skip to content

Commit

Permalink
fix: condition to showing filters, currency select and export button
Browse files Browse the repository at this point in the history
  • Loading branch information
solidovic committed Aug 21, 2024
1 parent b286fe1 commit f626228
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
import { FC } from 'react';
import { useRewardsHistory } from 'features/rewards/hooks';
import { useDappStatus } from 'shared/hooks/use-dapp-status';

import { LeftOptions } from './LeftOptions';
import { RightOptions } from './RightOptions';
import { RewardsListHeaderStyle } from './styles';
import { TitleStyle } from './styles';

export const RewardsListHeader: FC = () => {
const { isWalletConnected, isSupportedChain } = useDappStatus();
const { error, data } = useRewardsHistory();

return (
<RewardsListHeaderStyle data-testid="rewardsHeader">
<TitleStyle>Reward history</TitleStyle>
{!error && data && data?.events.length > 0 && (
<>
<LeftOptions />
<RightOptions />
</>
)}
{!error &&
data &&
data?.events.length > 0 &&
(!isWalletConnected || (isWalletConnected && isSupportedChain)) && (
<>
<LeftOptions />
<RightOptions />
</>
)}
</RewardsListHeaderStyle>
);
};

0 comments on commit f626228

Please sign in to comment.