From bc9bf02c6ebe08e6829ac5531502bf640c8a95d0 Mon Sep 17 00:00:00 2001 From: Taras Alekhin Date: Thu, 13 Jun 2024 11:55:58 +0200 Subject: [PATCH] feat: added rate limit message --- .../rewards/components/errorBlocks/ErrorRateLimited.tsx | 8 ++++++++ .../rewardsListContent/RewardsListErrorMessage.tsx | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 features/rewards/components/errorBlocks/ErrorRateLimited.tsx diff --git a/features/rewards/components/errorBlocks/ErrorRateLimited.tsx b/features/rewards/components/errorBlocks/ErrorRateLimited.tsx new file mode 100644 index 000000000..9300d62e2 --- /dev/null +++ b/features/rewards/components/errorBlocks/ErrorRateLimited.tsx @@ -0,0 +1,8 @@ +import { ErrorBlockBase } from './ErrorBlockBase'; + +export const ErrorRateLimited = () => ( + +); diff --git a/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx b/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx index 998ce5741..95cea358a 100644 --- a/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx +++ b/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx @@ -1,5 +1,6 @@ import { ErrorBlockBase } from '../errorBlocks/ErrorBlockBase'; import { ErrorBlockServer } from '../errorBlocks/ErrorBlockServer'; +import { ErrorRateLimited } from '../errorBlocks/ErrorRateLimited'; import { extractErrorMessage } from 'utils'; import { FetcherError } from 'utils/fetcherError'; @@ -15,5 +16,9 @@ export const RewardsListErrorMessage: React.FC = ({ error }) => { return ; } + if (error instanceof FetcherError && error.status === 429) { + return ; + } + return ; };