Created
August 16, 2024 22:14
-
-
Save farynaio/f8c24e69e7b400f9be548475c72f5cd1 to your computer and use it in GitHub Desktop.
RN LoadingIndicator made with @motify/components
This file contains hidden or 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
import { FC } from "react" | |
import { MotiView } from "@motify/components" | |
const LoadingIndicator: FC<{ size: number }> = ({ size }) => { | |
return ( | |
<MotiView | |
from={{ | |
width: size, | |
height: size, | |
borderRadius: size / 2, | |
borderWidth: 0, | |
shadowOpacity: 0.5, | |
}} | |
animate={{ | |
width: size + 20, | |
height: size + 20, | |
borderRadius: (size + 20) / 2, | |
borderWidth: size / 10, | |
shadowOpacity: 1, | |
}} | |
transition={{ | |
type: "timing", | |
duration: 1000, | |
loop: true, | |
}} | |
style={{ | |
width: size, | |
height: size, | |
borderRadius: size / 2, | |
borderWidth: size / 10, | |
borderColor: "#fff", | |
shadowColor: "#fff", | |
shadowOffset: { width: 0, height: 0 }, | |
shadowOpacity: 1, | |
shadowRadius: 10, | |
}} | |
/> | |
) | |
} | |
export default LoadingIndicator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment