Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
1.1 kB · 45 lines
TSX
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546import React from 'react'import Animated, { Easing, useAnimatedStyle, useSharedValue, withRepeat, withTiming,} from 'react-native-reanimated'
import {atoms as a, useTheme} from '#/alf'import {type Props, useCommonSVGProps} from '#/components/icons/common'import {Loader_Stroke2_Corner0_Rounded as Icon} from '#/components/icons/Loader'
export function Loader(props: Props) { const t = useTheme() const common = useCommonSVGProps(props) const rotation = useSharedValue(0)
const animatedStyles = useAnimatedStyle(() => ({ transform: [{rotate: rotation.get() + 'deg'}], }))
React.useEffect(() => { rotation.set(() => withRepeat(withTiming(360, {duration: 500, easing: Easing.linear}), -1), ) }, [rotation])
return ( <Animated.View style={[ a.relative, a.justify_center, a.align_center, {width: common.size, height: common.size}, animatedStyles, ]}> <Icon {...props} style={[a.absolute, a.inset_0, props.style]} color={t.palette.primary_500} /> </Animated.View> )}