Поставьте зависимости:
npm install @shopify/react-native-skia react-native-gesture-handler react-native-reanimated react-native-workletspnpm add @shopify/react-native-skia react-native-gesture-handler react-native-reanimated react-native-workletsyarn add @shopify/react-native-skia react-native-gesture-handler react-native-reanimated react-native-workletsbun add @shopify/react-native-skia react-native-gesture-handler react-native-reanimated react-native-workletsСкопируйте эти файлы в src/shared/components/organisms/infinite-menu/:
Код доступен по подпискеPro
Исходник «Бесконечное меню» открывается с подпиской Pro. Уже оформили? Войдите в аккаунт.
Проверьте алиас путей. Импорты в коде выше записаны так, как их пишет astra-rn add: @/shared/components, @/shared/utils и @/shared/hooks. Нужен алиас "@/*": ["./src/*"] в tsconfig.json — или поправьте импорты под свои пути.
Код доступен по подпискеPro
Исходник «Бесконечное меню» открывается с подпиской Pro. Уже оформили? Войдите в аккаунт.
Необязательный проп zoomed отодвигает камеру так же, как при зажатом пальце (на величину zoomOnDrag), например вместе с autoRotateSpeed для демонстрации вращения. По умолчанию false — отдаление включается только жестом, как и раньше.
itemsТип IMenuItem[]
projectionScale?Explicit projection scale in px. Overrides the auto-fit + `scale`.
Тип number
backgroundColor?Тип string
style?Тип StyleProp<ViewStyle>
sphereRadius?Тип number
cameraDistance?Camera distance from the sphere centre. Smaller = stronger perspective.
Тип number
discSize?Disc radius as a fraction of the projection scale.
Тип number
depthScaleRange?`[equator, pole]` size factor, interpolated by |depth|.
Тип readonly [number, number]
placeholderColor?Fill used for discs whose image has not loaded yet.
Тип string
imageFit?Тип Fit
discBorderWidth?Тип number
discBorderColor?Тип string
minDiscRadius?Discs smaller than this (in px) are skipped.
Тип number
dragSensitivity?How much of each finger delta is applied per frame.
Тип number
dragAmplification?Тип number
inertia?Glide decay — lower spins longer after release.
Тип number
snapEnabled?Snap the nearest disc to face the camera when idle.
Тип boolean
snapStrength?Тип number
zoomOnDrag?Extra camera pull-back while dragging. `0` disables the zoom-out.
Тип number
zoomed?Тип boolean
autoRotateSpeed?Idle spin in radians per second. `0` (default) disables it.
Тип number
onItemPress?Тип (item: IMenuItem, index: number) => void
renderOverlay?Rendered above the canvas; fades out while the sphere is moving.
Тип (state: IMenuState) => ReactNode
overlayFadeInDuration?Overlay fade-out timing, in ms, when the sphere starts moving.
Тип number
overlayFadeOutDuration?Overlay fade-in timing, in ms, when the sphere settles.
Тип number
overlayRestingScale?Scale the overlay shrinks to while the sphere is moving.
Тип number
imageТип string
title?Optional payload — handy for `renderOverlay` and the press callbacks.
Тип string
description?Тип string
data?Тип unknown