29 lines
1.4 KiB
TypeScript
29 lines
1.4 KiB
TypeScript
// Metro module 9807 (f9808).
|
|
import { useEffect, useRef, forwardRef, useImperativeHandle } from "react";
|
|
import { useTheme } from "../../../hooks/useTheme";
|
|
import * as _shared from "../../../design/shared";
|
|
import { SpendEarnOrbsLightThemeLottie } from "../../../design/components/LottieIcon/native/generated/SpendEarnOrbsLightThemeLottie";
|
|
import { SpendEarnOrbsLottie } from "../../../design/components/LottieIcon/native/generated/SpendEarnOrbsLottie";
|
|
const r23 = forwardRef(({ animationType }, a1) => {
|
|
const isThemeLight = _shared.isThemeLight(useTheme());
|
|
const ref = useRef(null);
|
|
useEffect(() => {
|
|
if (animationType !== null) {
|
|
const current = ref.current;
|
|
if (current != null) {
|
|
current.play();
|
|
}
|
|
}
|
|
}, [animationType]);
|
|
useImperativeHandle(a1, () => ({
|
|
play: () => {
|
|
const current = ref.current;
|
|
return current == null ? void 0 : current.play();
|
|
}
|
|
}));
|
|
return isThemeLight ? <SpendEarnOrbsLightThemeLottie ref={ref} size="custom" width={60} height={60} opacity={0.8} animation={animationType != null ? animationType : "spend"} useLottieDefaultColors /> : <SpendEarnOrbsLottie ref={ref} size="custom" width={60} height={60} opacity={0.8} animation={animationType != null ? animationType : "spend"} useLottieDefaultColors />;
|
|
});
|
|
r23.displayName = "OrbsLottieAnimation";
|
|
export default r23;
|
|
export { r23 as OrbLottieAnimation };
|