-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve hooks render issue with localized component
- Loading branch information
1 parent
81a66fe
commit dcc1b0f
Showing
6 changed files
with
101 additions
and
27 deletions.
There are no files selected for viewing
Empty file.
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
33 changes: 33 additions & 0 deletions
33
packages/widget/src/components/Maintenance/MaintenanceCountdownProgress.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useEventCountdownProgressBar } from './hooks/useEventCountdownProgressBar' | ||
import { isChainIncluded } from '@/utils/isChainIncluded' | ||
|
||
export const MaintenanceCountdownProgress = ({ | ||
originChainId, | ||
destinationChainId, | ||
startDate, | ||
endDate, | ||
pausedFromChains, | ||
pausedToChains, | ||
progressBarMessage, | ||
disabled = false, | ||
}: { | ||
originChainId: number | ||
destinationChainId: number | ||
startDate: Date | ||
endDate: Date | null | ||
pausedFromChains: number[] | ||
pausedToChains: number[] | ||
progressBarMessage: any | ||
disabled?: boolean | ||
}) => { | ||
const isCurrentChain = | ||
isChainIncluded([originChainId], pausedFromChains) || | ||
isChainIncluded([destinationChainId], pausedToChains) | ||
|
||
const { | ||
isPending: isMaintenancePending, | ||
EventCountdownProgressBar: MaintenanceCountdownProgressBar, | ||
} = useEventCountdownProgressBar(progressBarMessage, startDate, endDate) | ||
|
||
return MaintenanceCountdownProgressBar | ||
} |
22 changes: 21 additions & 1 deletion
22
packages/widget/src/components/Maintenance/helpers/getCountdownTimeStatus.ts
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