-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMP-198: Add retry payment. Refactoring errors, result components (#299)
- Loading branch information
1 parent
dca5bd7
commit 8f2c9c6
Showing
22 changed files
with
215 additions
and
219 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Alert, AlertDescription, AlertIcon, AlertTitle, Button } from '@chakra-ui/react'; | ||
|
||
export const ErrorBoundaryFallback = () => ( | ||
<Alert | ||
alignItems="center" | ||
flexDirection="column" | ||
gap={3} | ||
height="250px" | ||
justifyContent="center" | ||
status="error" | ||
textAlign="center" | ||
variant="subtle" | ||
> | ||
<AlertIcon boxSize="40px" mr={0} /> | ||
<AlertTitle fontSize="lg" mb={1} mt={4}> | ||
Something went wrong. | ||
</AlertTitle> | ||
<AlertDescription maxWidth="sm">Try reloading.</AlertDescription> | ||
<Button colorScheme="teal" onClick={() => location.reload()}> | ||
Reload | ||
</Button> | ||
</Alert> | ||
); |
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
17 changes: 17 additions & 0 deletions
17
src/components/ViewContainer/PaymentResultView/ResultIcon.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,17 @@ | ||
import { CheckCircleIcon, WarningIcon, InfoIcon } from '@chakra-ui/icons'; | ||
|
||
const iconComponents = { | ||
CheckIcon: CheckCircleIcon, | ||
WarningIcon: WarningIcon, | ||
InfoIcon: InfoIcon, | ||
}; | ||
|
||
export type ResultIconProps = { | ||
iconName: keyof typeof iconComponents; | ||
color: string; | ||
}; | ||
|
||
export function ResultIcon({ iconName, color }: ResultIconProps) { | ||
const IconComponent = iconComponents[iconName]; | ||
return IconComponent ? <IconComponent boxSize="28" color={color} /> : null; | ||
} |
Oops, something went wrong.