-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cleaning up font sizes * More clean up * Add error handling
- Loading branch information
1 parent
8b3a30e
commit 238b565
Showing
15 changed files
with
488 additions
and
233 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
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
82 changes: 82 additions & 0 deletions
82
app/src/components/Dashboard/Wrapped/Sections/WrappedError.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,82 @@ | ||
import { Box, Button, Spinner, Text } from '@chakra-ui/react'; | ||
import { AnimatePresence, motion, useAnimationControls } from 'framer-motion'; | ||
import { FiRefreshCcw } from 'react-icons/fi'; | ||
|
||
import LogoWithText from '../../../../../assets/LogoWithText.svg'; | ||
|
||
export function WrappedError({ | ||
error, | ||
onRetry, | ||
}: { | ||
error: string; | ||
onRetry: () => void; | ||
}) { | ||
const controls = useAnimationControls(); | ||
|
||
return ( | ||
<AnimatePresence> | ||
<motion.div | ||
initial={{ opacity: 0 }} | ||
animate={{ opacity: 1 }} | ||
exit={{ opacity: 0 }} | ||
style={{ | ||
height: '100%', | ||
width: '100%', | ||
}} | ||
> | ||
<Box | ||
height="100%" | ||
width="100%" | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
padding: '24px', | ||
borderRadius: 16, | ||
position: 'relative', | ||
}} | ||
shadow="dark-lg" | ||
bgColor="purple.50" | ||
> | ||
<motion.div animate={controls} transition={{ duration: 1 }}> | ||
<div style={{ padding: '36px', marginTop: '-1vh' }}> | ||
<img | ||
src={LogoWithText} | ||
alt="Left on Read" | ||
style={{ height: '100%' }} | ||
/> | ||
</div> | ||
</motion.div> | ||
<motion.div | ||
animate={controls} | ||
transition={{ duration: 1, delay: 0.2 }} | ||
> | ||
<Text fontSize="lg" fontWeight={600} color="red.400"> | ||
Oops! Something went wrong... | ||
</Text> | ||
</motion.div> | ||
<div style={{ textAlign: 'center' }}> | ||
If this issue persists, please contact support. | ||
</div> | ||
<motion.div | ||
animate={controls} | ||
transition={{ duration: 1, delay: 0.4 }} | ||
style={{ marginTop: '3vh', fontSize: '14px' }} | ||
> | ||
Error Code: {error} | ||
</motion.div> | ||
<Box style={{ marginTop: '8vh' }}> | ||
<Button | ||
onClick={() => onRetry()} | ||
colorScheme="purple" | ||
leftIcon={<FiRefreshCcw />} | ||
> | ||
Retry | ||
</Button> | ||
</Box> | ||
</Box> | ||
</motion.div> | ||
</AnimatePresence> | ||
); | ||
} |
Oops, something went wrong.