-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #510 from lidofinance/feature/si-1641-refactoring-…
…single-source-of-truth-for-chainid-and-rpc Refactoring single source of truth for dapp state
- Loading branch information
Showing
134 changed files
with
1,421 additions
and
1,866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
features/rewards/components/rewardsListContent/RewardsListsUnsupportedChain.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 8 additions & 14 deletions
22
features/rewards/components/rewardsListHeader/RewardsListHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,25 @@ | ||
import { FC } from 'react'; | ||
import { useRewardsHistory } from 'features/rewards/hooks'; | ||
import { useDappStatus } from 'shared/hooks/use-dapp-status'; | ||
import { useDappStatus } from 'modules/web3'; | ||
|
||
import { LeftOptions } from './LeftOptions'; | ||
import { RightOptions } from './RightOptions'; | ||
import { RewardsListHeaderStyle } from './styles'; | ||
import { TitleStyle } from './styles'; | ||
|
||
export const RewardsListHeader: FC = () => { | ||
const { isWalletConnected, isSupportedChain, isAccountActiveOnL2 } = | ||
useDappStatus(); | ||
const { isSupportedChain } = useDappStatus(); | ||
const { error, data } = useRewardsHistory(); | ||
|
||
return ( | ||
<RewardsListHeaderStyle data-testid="rewardsHeader"> | ||
<TitleStyle>Reward history</TitleStyle> | ||
{!error && | ||
data && | ||
data?.events.length > 0 && | ||
(!isWalletConnected || | ||
(isWalletConnected && isSupportedChain) || | ||
!isAccountActiveOnL2) && ( | ||
<> | ||
<LeftOptions /> | ||
<RightOptions /> | ||
</> | ||
)} | ||
{!error && data && data?.events.length > 0 && isSupportedChain && ( | ||
<> | ||
<LeftOptions /> | ||
<RightOptions /> | ||
</> | ||
)} | ||
</RewardsListHeaderStyle> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.