@zezosoft/zezo-ott-react-native-ui-kit 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/components/Content/Card/Sliders/Styles/Three.js +5 -4
- package/lib/module/components/Content/Card/Sliders/Styles/Three.js.map +1 -1
- package/lib/module/components/Headers/Four.js +1 -1
- package/lib/module/components/Headers/Three.js +2 -1
- package/lib/module/components/Headers/Three.js.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/Styles/Three.d.ts.map +1 -1
- package/package.json +2 -14
- package/src/Styles/globalStyles.ts +0 -70
- package/src/assets/animations/135037-payment-processing-error.json +0 -1347
- package/src/assets/animations/7227-vui-animation.json +0 -3377
- package/src/assets/animations/Failed.json +0 -2103
- package/src/assets/animations/Pending.json +0 -522
- package/src/assets/animations/Successful.json +0 -2289
- package/src/assets/animations/heart.json +0 -788
- package/src/assets/animations/succesfull-payment.json +0 -2379
- package/src/assets/animations/voice-icon.json +0 -542
- package/src/assets/img/back.png +0 -0
- package/src/assets/img/bottom-panel.png +0 -0
- package/src/assets/img/camera.png +0 -0
- package/src/assets/img/camera2.png +0 -0
- package/src/assets/img/home.png +0 -0
- package/src/assets/img/lock.png +0 -0
- package/src/assets/img/play.png +0 -0
- package/src/assets/img/profile.jpg +0 -0
- package/src/assets/img/qr-code.png +0 -0
- package/src/assets/img/shadow.png +0 -0
- package/src/assets/img/shadow2.png +0 -0
- package/src/assets/img/user.png +0 -0
- package/src/assets/svg/Account.svg +0 -4
- package/src/assets/svg/Favourite.svg +0 -14
- package/src/assets/svg/Upcoming.svg +0 -4
- package/src/assets/svg/content-error.svg +0 -28
- package/src/assets/svg/download.svg +0 -3
- package/src/assets/svg/eye-off.svg +0 -10
- package/src/assets/svg/favorites.svg +0 -3
- package/src/assets/svg/h.svg +0 -4
- package/src/assets/svg/home.svg +0 -5
- package/src/assets/svg/home1.svg +0 -3
- package/src/assets/svg/menu-bar.svg +0 -4
- package/src/assets/svg/my-space.svg +0 -14
- package/src/assets/svg/play-icon-with-bg.svg +0 -5
- package/src/assets/svg/profile.svg +0 -4
- package/src/assets/svg/search.svg +0 -5
- package/src/assets/svg/search1.svg +0 -4
- package/src/assets/svg/server-error.svg +0 -139
- package/src/components/Account/Account.tsx +0 -367
- package/src/components/Account/index.ts +0 -1
- package/src/components/Alert/AlertDialog.tsx +0 -247
- package/src/components/Alert/UAAlert.tsx +0 -170
- package/src/components/Alert/index.ts +0 -2
- package/src/components/Auth/AuthProvider/AuthProvider.tsx +0 -419
- package/src/components/Auth/One/ForgotPassword/ForgotPassword.tsx +0 -324
- package/src/components/Auth/One/Login/LoginWithEmail.tsx +0 -455
- package/src/components/Auth/One/Login/LoginWithPhone.tsx +0 -306
- package/src/components/Auth/One/OTP/OTP.tsx +0 -465
- package/src/components/Auth/One/QrLogin/QrLogin.tsx +0 -602
- package/src/components/Auth/One/QrLogin/components/QrViewArea.tsx +0 -423
- package/src/components/Auth/One/SignUp/SignUp.tsx +0 -479
- package/src/components/Auth/One/SplashScreen/SplashScreen.tsx +0 -249
- package/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx +0 -103
- package/src/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
- package/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -174
- package/src/components/Auth/One/index.ts +0 -24
- package/src/components/Auth/Two/AuthHeader/AuthHeader.tsx +0 -108
- package/src/components/Auth/Two/ForgotPassword/ForgotPassword.tsx +0 -335
- package/src/components/Auth/Two/Login/AuthLoginShell.tsx +0 -173
- package/src/components/Auth/Two/Login/LoginWithEmail.tsx +0 -279
- package/src/components/Auth/Two/Login/LoginWithPhone.tsx +0 -188
- package/src/components/Auth/Two/OTP/OTP.tsx +0 -465
- package/src/components/Auth/Two/QrLogin/QrLogin.tsx +0 -602
- package/src/components/Auth/Two/QrLogin/components/QrViewArea.tsx +0 -423
- package/src/components/Auth/Two/SignUp/SignUp.tsx +0 -472
- package/src/components/Auth/Two/SplashScreen/SplashScreen.tsx +0 -248
- package/src/components/Auth/Two/SplashScreen/components/SplashImage/SplashImage.tsx +0 -92
- package/src/components/Auth/Two/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
- package/src/components/Auth/Two/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -178
- package/src/components/Auth/Two/index.ts +0 -28
- package/src/components/Auth/index.ts +0 -11
- package/src/components/BackgroundLayout/BackgroundLayout.tsx +0 -174
- package/src/components/BackgroundLayout/BackgroundLayoutOne.tsx +0 -56
- package/src/components/BlogView/BlogView.tsx +0 -276
- package/src/components/BlogView/index.ts +0 -8
- package/src/components/BlurView/BlurView.tsx +0 -199
- package/src/components/BlurView/index.ts +0 -7
- package/src/components/BottomSheet/BottomSheet.tsx +0 -200
- package/src/components/BottomSheet/BottomSheetOne.tsx +0 -220
- package/src/components/BottomSheet/index.ts +0 -4
- package/src/components/Button/BackBtn.tsx +0 -168
- package/src/components/Button/MenuBtn.tsx +0 -229
- package/src/components/Button/PrimaryBtn.tsx +0 -134
- package/src/components/Button/SecondaryBtn.tsx +0 -132
- package/src/components/Button/TextButton.tsx +0 -145
- package/src/components/Button/index.ts +0 -18
- package/src/components/Content/Card/Category/Category.tsx +0 -436
- package/src/components/Content/Card/Category/CategroyTwo.tsx +0 -429
- package/src/components/Content/Card/NowWatching/NowWatching.tsx +0 -624
- package/src/components/Content/Card/Sliders/Styles/One.tsx +0 -490
- package/src/components/Content/Card/Sliders/Styles/Three.tsx +0 -935
- package/src/components/Content/Card/Sliders/Styles/Two.tsx +0 -391
- package/src/components/Content/Card/Sliders/index.ts +0 -17
- package/src/components/Content/Card/Styles/Five.tsx +0 -385
- package/src/components/Content/Card/Styles/Four.tsx +0 -379
- package/src/components/Content/Card/Styles/One.tsx +0 -386
- package/src/components/Content/Card/Styles/RotateInOut.tsx +0 -413
- package/src/components/Content/Card/Styles/Six.tsx +0 -392
- package/src/components/Content/Card/Styles/Three.tsx +0 -314
- package/src/components/Content/Card/Styles/TopTen.tsx +0 -412
- package/src/components/Content/Card/Styles/Two.tsx +0 -416
- package/src/components/Content/Card/components/AdsPoster.tsx +0 -202
- package/src/components/Content/Card/components/CardPoster.tsx +0 -377
- package/src/components/Content/Card/components/NavigateToMore.tsx +0 -97
- package/src/components/Content/Card/components/RentOrBuyIcon.tsx +0 -129
- package/src/components/Content/Card/components/ShowAllButton.tsx +0 -92
- package/src/components/Content/Card/components/ThumbnailCard.tsx +0 -234
- package/src/components/Content/Card/components/index.ts +0 -1
- package/src/components/Content/Card/index.ts +0 -30
- package/src/components/Content/Content.tsx +0 -315
- package/src/components/Content/Sections.tsx +0 -238
- package/src/components/Content/types.ts +0 -176
- package/src/components/ContentView/MoreContentList.tsx +0 -327
- package/src/components/ContentView/One/ContentViewOne.tsx +0 -243
- package/src/components/ContentView/One/components/AboutSection.tsx +0 -216
- package/src/components/ContentView/One/components/CastCard.tsx +0 -265
- package/src/components/ContentView/One/components/EpisodeCard.tsx +0 -535
- package/src/components/ContentView/One/components/GenreTags.tsx +0 -132
- package/src/components/ContentView/One/components/HeroBanner.tsx +0 -357
- package/src/components/ContentView/One/components/MiniInfo.tsx +0 -356
- package/src/components/ContentView/One/components/PlayButton.tsx +0 -56
- package/src/components/ContentView/One/components/Title.tsx +0 -149
- package/src/components/ContentView/One/components/TrailerButton.tsx +0 -76
- package/src/components/ContentView/Two/ContentViewTwo.tsx +0 -343
- package/src/components/ContentView/Two/components/AboutSection.tsx +0 -216
- package/src/components/ContentView/Two/components/Details.tsx +0 -193
- package/src/components/ContentView/Two/components/EpisodeCard.tsx +0 -602
- package/src/components/ContentView/Two/components/GenreTags.tsx +0 -123
- package/src/components/ContentView/Two/components/HeroBanner.tsx +0 -402
- package/src/components/ContentView/Two/components/LikeShareActions.tsx +0 -125
- package/src/components/ContentView/Two/components/MoreLikeThisContentList .tsx +0 -305
- package/src/components/ContentView/Two/components/PlayOrTrailer.tsx +0 -133
- package/src/components/ContentView/Two/components/SectionTabs.tsx +0 -177
- package/src/components/ContentView/Two/components/Title.tsx +0 -226
- package/src/components/ContentView/Two/components/index.ts +0 -15
- package/src/components/ContentView/index.ts +0 -13
- package/src/components/Fallbacks/NoContentFallback.tsx +0 -176
- package/src/components/Fallbacks/NotFoundFallback.tsx +0 -94
- package/src/components/Fallbacks/index.ts +0 -2
- package/src/components/Headers/AppHeader.tsx +0 -150
- package/src/components/Headers/Four.tsx +0 -83
- package/src/components/Headers/One.tsx +0 -115
- package/src/components/Headers/Three.tsx +0 -135
- package/src/components/Headers/Two.tsx +0 -100
- package/src/components/Headers/index.ts +0 -18
- package/src/components/Input/Input.ts +0 -20
- package/src/components/Input/InputOne.tsx +0 -259
- package/src/components/Input/InputThree.tsx +0 -212
- package/src/components/Input/InputTwo.tsx +0 -212
- package/src/components/Input/PhoneNumberInput.tsx +0 -431
- package/src/components/Input/PhoneNumberInputTwo.tsx +0 -418
- package/src/components/Keyboard/HideKeyboard.tsx +0 -88
- package/src/components/Loader/Loader.tsx +0 -44
- package/src/components/Logo/Logo.tsx +0 -145
- package/src/components/NewRelease/NewReleaseSheet.tsx +0 -250
- package/src/components/NewRelease/index.ts +0 -1
- package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +0 -221
- package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +0 -314
- package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +0 -196
- package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +0 -95
- package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +0 -163
- package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +0 -210
- package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +0 -146
- package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +0 -154
- package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +0 -264
- package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +0 -494
- package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +0 -184
- package/src/components/Reels/ReelsSeries/components/Episodes.tsx +0 -154
- package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +0 -41
- package/src/components/Reels/ReelsSeries/components/Like.tsx +0 -40
- package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +0 -79
- package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +0 -332
- package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +0 -187
- package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +0 -80
- package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +0 -2
- package/src/components/Reels/ReelsSeries/types.ts +0 -54
- package/src/components/Reels/ReelsSeries/useReelsWatchProgress.ts +0 -85
- package/src/components/Reels/ReelsSeries/utils/quality.ts +0 -48
- package/src/components/Reels/index.ts +0 -9
- package/src/components/Reels/utils/Controls/gestureUtils.ts +0 -42
- package/src/components/Reels/utils/Controls/index.ts +0 -4
- package/src/components/Reels/utils/Controls/overlayUtils.ts +0 -35
- package/src/components/Reels/utils/Controls/videoControlsConstants.ts +0 -25
- package/src/components/Reels/utils/Controls/videoRef.ts +0 -4
- package/src/components/Reels/utils/index.ts +0 -1
- package/src/components/Reels/utils/timeoutUtils.ts +0 -29
- package/src/components/Search/One.tsx +0 -256
- package/src/components/Search/components/RecentSearchesSection.tsx +0 -181
- package/src/components/Search/components/SearchCard.tsx +0 -275
- package/src/components/Search/index.ts +0 -16
- package/src/components/Settings/AppSettings.tsx +0 -428
- package/src/components/Settings/index.ts +0 -1
- package/src/components/Subscription/SubOne.tsx +0 -874
- package/src/components/Subscription/index.ts +0 -12
- package/src/components/TabBar/One.tsx +0 -148
- package/src/components/TabBar/Three.tsx +0 -169
- package/src/components/TabBar/Two.tsx +0 -189
- package/src/components/TabBar/index.ts +0 -20
- package/src/components/Text/Text.tsx +0 -85
- package/src/components/Text/index.ts +0 -5
- package/src/components/User/DeviceSessions/DeviceSessions.tsx +0 -468
- package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +0 -278
- package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +0 -494
- package/src/components/User/WatchHistory/WatchHistory.tsx +0 -227
- package/src/components/User/WatchLater/WatchLater.tsx +0 -397
- package/src/components/User/components/UserAvatar.tsx +0 -120
- package/src/components/User/components/UserSection.tsx +0 -228
- package/src/components/User/index.ts +0 -18
- package/src/components/View/View.tsx +0 -37
- package/src/components/View/index.ts +0 -5
- package/src/components/common/AppStatusBar.tsx +0 -57
- package/src/components/index.ts +0 -29
- package/src/components/layout/SafeAreaWrapper.tsx +0 -45
- package/src/components/layout/index.ts +0 -1
- package/src/constants/dummySections.ts +0 -98
- package/src/hooks/Images/index.ts +0 -2
- package/src/hooks/Images/useImageLoader.ts +0 -206
- package/src/hooks/Images/useImageValidation.ts +0 -36
- package/src/hooks/index.ts +0 -17
- package/src/hooks/useAdTracking.ts +0 -349
- package/src/hooks/useCards.ts +0 -228
- package/src/hooks/useDebounce.ts +0 -35
- package/src/hooks/useKeyboard.ts +0 -43
- package/src/hooks/useNavigationMode.ts +0 -46
- package/src/hooks/usePaginatedSection.ts +0 -101
- package/src/hooks/usePrevious.ts +0 -28
- package/src/hooks/useSafeCallback.ts +0 -43
- package/src/hooks/useSkeletonItems.ts +0 -30
- package/src/hooks/useSplashCache.ts +0 -186
- package/src/hooks/useThemeColors.ts +0 -51
- package/src/index.tsx +0 -8
- package/src/store/RecentSearchesStore.ts +0 -78
- package/src/store/splashStore.ts +0 -91
- package/src/store/themeStore.ts +0 -43
- package/src/theme/ThemeProvider.tsx +0 -112
- package/src/theme/hook/index.ts +0 -1
- package/src/theme/hook/useInternalTheme.ts +0 -98
- package/src/theme/index.ts +0 -7
- package/src/theme/themes.ts +0 -336
- package/src/theme/utils/validateColor.ts +0 -127
- package/src/types/content/content-view.types.ts +0 -206
- package/src/types/hook/index.ts +0 -5
- package/src/types/hook/usePaginatedSetion.ts +0 -19
- package/src/types/index.ts +0 -7
- package/src/types/sections/index.ts +0 -84
- package/src/utils/Display.ts +0 -14
- package/src/utils/Formater.ts +0 -14
- package/src/utils/PlatformSelector.ts +0 -29
- package/src/utils/SizeMatters.ts +0 -7
- package/src/utils/Spacing.ts +0 -27
- package/src/utils/colorUtils.ts +0 -70
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useState,
|
|
3
|
-
useEffect,
|
|
4
|
-
useRef,
|
|
5
|
-
useCallback,
|
|
6
|
-
useMemo,
|
|
7
|
-
memo,
|
|
8
|
-
} from 'react';
|
|
9
|
-
import { View, Dimensions, StyleSheet } from 'react-native';
|
|
10
|
-
import { Video } from 'react-native-video';
|
|
11
|
-
import {
|
|
12
|
-
GestureDetector,
|
|
13
|
-
GestureHandlerRootView,
|
|
14
|
-
} from 'react-native-gesture-handler';
|
|
15
|
-
|
|
16
|
-
import type {
|
|
17
|
-
ILikeMoreData,
|
|
18
|
-
ISeriesEpisode,
|
|
19
|
-
ISeriesItem,
|
|
20
|
-
ModalState,
|
|
21
|
-
} from './types';
|
|
22
|
-
import type { ITheme } from '../../../theme';
|
|
23
|
-
import {
|
|
24
|
-
videoRef,
|
|
25
|
-
videoControlsStyles,
|
|
26
|
-
PAUSE_ICON_TIMEOUT,
|
|
27
|
-
LIKE_ANIM_TIMEOUT,
|
|
28
|
-
UNLOCK_MODAL_DELAY,
|
|
29
|
-
useOverlayThresholds,
|
|
30
|
-
useIsInOverlay,
|
|
31
|
-
useCreateTapGesture,
|
|
32
|
-
useCombinedGesture,
|
|
33
|
-
} from '../utils/Controls';
|
|
34
|
-
import { clearTimeoutSafely, setTimeoutSafely } from '../utils';
|
|
35
|
-
import MediaControlsProvider from './MediaControls/MediaControlsProvider';
|
|
36
|
-
import FastImage from 'react-native-fast-image';
|
|
37
|
-
import type { IReelsWatchProgress } from './types';
|
|
38
|
-
|
|
39
|
-
const INITIAL_MODAL_STATE: ModalState = {
|
|
40
|
-
type: 'none',
|
|
41
|
-
isVisible: false,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const MIN_VIEW_DURATION_SEC = 5;
|
|
45
|
-
|
|
46
|
-
interface IReelItemProps {
|
|
47
|
-
reel: ISeriesEpisode;
|
|
48
|
-
data: ISeriesItem;
|
|
49
|
-
autoScroll?: boolean;
|
|
50
|
-
videoHeight: number;
|
|
51
|
-
onLikePress?: (data: { id: string; liked: boolean }) => void;
|
|
52
|
-
onEpisodesPress?: () => void;
|
|
53
|
-
onSharePress?: () => void;
|
|
54
|
-
isVisible: boolean;
|
|
55
|
-
preload: boolean;
|
|
56
|
-
activeEpisodeIndex: number;
|
|
57
|
-
isFullScreen: boolean;
|
|
58
|
-
onEpisodeSelect: (episode: ISeriesEpisode) => void;
|
|
59
|
-
theme: ITheme;
|
|
60
|
-
onBackPress?: () => void;
|
|
61
|
-
onSearchPress?: () => void;
|
|
62
|
-
onLikeMorePress?: (item: ILikeMoreData) => void;
|
|
63
|
-
onEpisodeUnlockPress?: (episode: ISeriesEpisode) => void;
|
|
64
|
-
onViewCount?: (data: { id: string }) => void;
|
|
65
|
-
onWatchProgress?: (data: IReelsWatchProgress) => void;
|
|
66
|
-
onAutoScrollNext?: () => void;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const ReelItem: React.FC<IReelItemProps> = ({
|
|
70
|
-
reel,
|
|
71
|
-
data,
|
|
72
|
-
autoScroll,
|
|
73
|
-
videoHeight,
|
|
74
|
-
onLikePress,
|
|
75
|
-
onSharePress,
|
|
76
|
-
onBackPress,
|
|
77
|
-
isVisible,
|
|
78
|
-
isFullScreen,
|
|
79
|
-
preload,
|
|
80
|
-
activeEpisodeIndex,
|
|
81
|
-
onEpisodeSelect,
|
|
82
|
-
onSearchPress,
|
|
83
|
-
onLikeMorePress,
|
|
84
|
-
onEpisodeUnlockPress,
|
|
85
|
-
onViewCount,
|
|
86
|
-
theme,
|
|
87
|
-
onWatchProgress,
|
|
88
|
-
onAutoScrollNext,
|
|
89
|
-
}) => {
|
|
90
|
-
// State
|
|
91
|
-
const [buffering, setBuffering] = useState(true);
|
|
92
|
-
const [isPaused, setIsPaused] = useState(false);
|
|
93
|
-
const [showPauseIcon, setShowPauseIcon] = useState<boolean | null>(null);
|
|
94
|
-
const [modal, setModal] = useState<ModalState>(INITIAL_MODAL_STATE);
|
|
95
|
-
const [unlockModalVisible, setUnlockModalVisible] = useState(false);
|
|
96
|
-
const [unlockModalDismissed, setUnlockModalDismissed] = useState(false);
|
|
97
|
-
const [showLikeAnim, setShowLikeAnim] = useState(false);
|
|
98
|
-
const [currentTime, setCurrentTime] = useState(0);
|
|
99
|
-
const [duration, setDuration] = useState(0);
|
|
100
|
-
const [playbackRate, setPlaybackRate] = useState(1);
|
|
101
|
-
const [videoQuality, setVideoQuality] = useState('Auto');
|
|
102
|
-
const [isLiked, setIsLiked] = useState(() => Boolean(data.isLiked));
|
|
103
|
-
const [likesCount, setLikesCount] = useState(() => Number(data.likes) || 0);
|
|
104
|
-
const [hasError, setHasError] = useState(false);
|
|
105
|
-
|
|
106
|
-
// Refs
|
|
107
|
-
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
108
|
-
const likeAnimTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
109
|
-
const viewCountedRef = useRef(false);
|
|
110
|
-
const autoScrolledRef = useRef(false);
|
|
111
|
-
|
|
112
|
-
// Constants
|
|
113
|
-
const isLocked = reel.isLocked;
|
|
114
|
-
const videoUri = useMemo(() => reel.videoUrl || '', [reel.videoUrl]);
|
|
115
|
-
const thumbnail = data.thumbnail;
|
|
116
|
-
|
|
117
|
-
// Overlay thresholds
|
|
118
|
-
const { rightThreshold, bottomThreshold } = useOverlayThresholds(videoHeight);
|
|
119
|
-
|
|
120
|
-
// Computed values
|
|
121
|
-
const finalPause = useMemo(
|
|
122
|
-
() => isLocked || !isVisible || modal.isVisible || isPaused || hasError,
|
|
123
|
-
[isLocked, isVisible, modal.isVisible, isPaused, hasError]
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
const showCenterControls = useMemo(
|
|
127
|
-
() => showPauseIcon || buffering || isLocked || hasError,
|
|
128
|
-
[showPauseIcon, buffering, isLocked, hasError]
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
// Handlers
|
|
132
|
-
const closeUnlockModal = useCallback(() => {
|
|
133
|
-
setUnlockModalVisible(false);
|
|
134
|
-
setUnlockModalDismissed(true); // Prevent auto-open after manual close
|
|
135
|
-
}, []);
|
|
136
|
-
|
|
137
|
-
const closeAllModals = useCallback(() => {
|
|
138
|
-
setModal(INITIAL_MODAL_STATE);
|
|
139
|
-
closeUnlockModal();
|
|
140
|
-
}, [closeUnlockModal]);
|
|
141
|
-
|
|
142
|
-
const openUnlockModal = useCallback(() => {
|
|
143
|
-
setUnlockModalVisible(true);
|
|
144
|
-
}, []);
|
|
145
|
-
|
|
146
|
-
// Reset view-counted flag when episode changes
|
|
147
|
-
useEffect(() => {
|
|
148
|
-
viewCountedRef.current = false;
|
|
149
|
-
autoScrolledRef.current = false;
|
|
150
|
-
}, [reel.episodeId]);
|
|
151
|
-
|
|
152
|
-
// Reset video timing state when episode changes
|
|
153
|
-
useEffect(() => {
|
|
154
|
-
setCurrentTime(0);
|
|
155
|
-
setDuration(0);
|
|
156
|
-
setBuffering(true);
|
|
157
|
-
setHasError(false);
|
|
158
|
-
}, [reel.episodeId]);
|
|
159
|
-
|
|
160
|
-
// Sync like state from parent when episode changes or parent updates data
|
|
161
|
-
useEffect(() => {
|
|
162
|
-
setIsLiked(Boolean(data.isLiked));
|
|
163
|
-
setLikesCount(Number(data.likes) || 0);
|
|
164
|
-
}, [reel.episodeId, data.isLiked, data.likes]);
|
|
165
|
-
|
|
166
|
-
useEffect(() => {
|
|
167
|
-
if (!isVisible) {
|
|
168
|
-
setShowPauseIcon(null);
|
|
169
|
-
setModal((prev) =>
|
|
170
|
-
prev.isVisible ? { ...prev, isVisible: false } : prev
|
|
171
|
-
);
|
|
172
|
-
setUnlockModalVisible(false);
|
|
173
|
-
setUnlockModalDismissed(false);
|
|
174
|
-
setHasError(false);
|
|
175
|
-
}
|
|
176
|
-
}, [isVisible]);
|
|
177
|
-
|
|
178
|
-
useEffect(() => {
|
|
179
|
-
if (isVisible && isLocked && !unlockModalVisible && !unlockModalDismissed) {
|
|
180
|
-
setIsPaused(true);
|
|
181
|
-
setUnlockModalDismissed(true);
|
|
182
|
-
}
|
|
183
|
-
}, [isVisible, isLocked, unlockModalVisible, unlockModalDismissed]);
|
|
184
|
-
|
|
185
|
-
useEffect(() => {
|
|
186
|
-
return () => {
|
|
187
|
-
clearTimeoutSafely(timeoutRef);
|
|
188
|
-
clearTimeoutSafely(likeAnimTimeoutRef);
|
|
189
|
-
};
|
|
190
|
-
}, []);
|
|
191
|
-
|
|
192
|
-
const handleLikePress = useCallback(() => {
|
|
193
|
-
const newLiked = !isLiked;
|
|
194
|
-
const count = Number(likesCount) || 0;
|
|
195
|
-
const newCount = newLiked ? count + 1 : Math.max(0, count - 1);
|
|
196
|
-
|
|
197
|
-
setIsLiked(newLiked);
|
|
198
|
-
setLikesCount(newCount);
|
|
199
|
-
|
|
200
|
-
if (newLiked) {
|
|
201
|
-
setShowLikeAnim(true);
|
|
202
|
-
setTimeoutSafely(
|
|
203
|
-
likeAnimTimeoutRef,
|
|
204
|
-
() => setShowLikeAnim(false),
|
|
205
|
-
LIKE_ANIM_TIMEOUT
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Parent should update its data (e.g. in onLikePress) so that like state
|
|
210
|
-
// persists across scroll and re-mounts
|
|
211
|
-
onLikePress?.({ id: reel.episodeId, liked: newLiked });
|
|
212
|
-
}, [isLiked, likesCount, onLikePress, reel.episodeId]);
|
|
213
|
-
|
|
214
|
-
const handleTogglePlay = useCallback(() => {
|
|
215
|
-
setIsPaused((prev) => !prev);
|
|
216
|
-
setShowPauseIcon(true);
|
|
217
|
-
if (isPaused) {
|
|
218
|
-
setTimeoutSafely(
|
|
219
|
-
timeoutRef,
|
|
220
|
-
() => setShowPauseIcon(false),
|
|
221
|
-
PAUSE_ICON_TIMEOUT
|
|
222
|
-
);
|
|
223
|
-
} else {
|
|
224
|
-
setShowPauseIcon(true);
|
|
225
|
-
}
|
|
226
|
-
}, [isPaused]);
|
|
227
|
-
|
|
228
|
-
const handleEpisodeSelect = useCallback(
|
|
229
|
-
(episode: ISeriesEpisode) => {
|
|
230
|
-
closeAllModals();
|
|
231
|
-
if (episode.isLocked) {
|
|
232
|
-
setTimeout(() => openUnlockModal(), UNLOCK_MODAL_DELAY);
|
|
233
|
-
} else {
|
|
234
|
-
onEpisodeSelect(episode);
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
[closeAllModals, onEpisodeSelect, openUnlockModal]
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
// Gestures
|
|
241
|
-
const handleLockedTap = useCallback(() => {
|
|
242
|
-
closeAllModals();
|
|
243
|
-
openUnlockModal();
|
|
244
|
-
}, [closeAllModals, openUnlockModal]);
|
|
245
|
-
|
|
246
|
-
const isInOverlay = useIsInOverlay(rightThreshold, bottomThreshold);
|
|
247
|
-
const createTapGesture = useCreateTapGesture(
|
|
248
|
-
isInOverlay,
|
|
249
|
-
isLocked,
|
|
250
|
-
handleLockedTap
|
|
251
|
-
);
|
|
252
|
-
|
|
253
|
-
const singleTap = useMemo(
|
|
254
|
-
() => createTapGesture(handleTogglePlay),
|
|
255
|
-
[createTapGesture, handleTogglePlay]
|
|
256
|
-
);
|
|
257
|
-
|
|
258
|
-
const doubleTap = useMemo(
|
|
259
|
-
() => createTapGesture(handleLikePress, 2),
|
|
260
|
-
[createTapGesture, handleLikePress]
|
|
261
|
-
);
|
|
262
|
-
|
|
263
|
-
const combinedGesture = useCombinedGesture(singleTap, doubleTap);
|
|
264
|
-
|
|
265
|
-
// Memoized props objects
|
|
266
|
-
const unlockProps = useMemo(
|
|
267
|
-
() => ({
|
|
268
|
-
isVisible: unlockModalVisible,
|
|
269
|
-
onClose: closeUnlockModal,
|
|
270
|
-
}),
|
|
271
|
-
[unlockModalVisible, closeUnlockModal]
|
|
272
|
-
);
|
|
273
|
-
|
|
274
|
-
const contentProps = useMemo(
|
|
275
|
-
() => ({
|
|
276
|
-
series: data,
|
|
277
|
-
episode: reel,
|
|
278
|
-
activeIndex: activeEpisodeIndex,
|
|
279
|
-
}),
|
|
280
|
-
[data, reel, activeEpisodeIndex]
|
|
281
|
-
);
|
|
282
|
-
|
|
283
|
-
const videoProps = useMemo(
|
|
284
|
-
() => ({
|
|
285
|
-
currentTime,
|
|
286
|
-
duration,
|
|
287
|
-
paused: finalPause,
|
|
288
|
-
buffering,
|
|
289
|
-
showCenterControls,
|
|
290
|
-
isLocked,
|
|
291
|
-
hasError,
|
|
292
|
-
}),
|
|
293
|
-
[
|
|
294
|
-
currentTime,
|
|
295
|
-
duration,
|
|
296
|
-
finalPause,
|
|
297
|
-
buffering,
|
|
298
|
-
showCenterControls,
|
|
299
|
-
isLocked,
|
|
300
|
-
hasError,
|
|
301
|
-
]
|
|
302
|
-
);
|
|
303
|
-
|
|
304
|
-
const likesProps = useMemo(
|
|
305
|
-
() => ({
|
|
306
|
-
liked: isLiked,
|
|
307
|
-
count: likesCount,
|
|
308
|
-
showAnimation: showLikeAnim,
|
|
309
|
-
}),
|
|
310
|
-
[isLiked, likesCount, showLikeAnim]
|
|
311
|
-
);
|
|
312
|
-
|
|
313
|
-
const actionsProps = useMemo(
|
|
314
|
-
() => ({
|
|
315
|
-
onLike: handleLikePress,
|
|
316
|
-
onEpisodeSelect: handleEpisodeSelect,
|
|
317
|
-
onLikeMore: onLikeMorePress,
|
|
318
|
-
onShare: onSharePress,
|
|
319
|
-
onUnLock: openUnlockModal,
|
|
320
|
-
onUnlockPress: onEpisodeUnlockPress,
|
|
321
|
-
}),
|
|
322
|
-
[
|
|
323
|
-
handleLikePress,
|
|
324
|
-
handleEpisodeSelect,
|
|
325
|
-
onLikeMorePress,
|
|
326
|
-
onSharePress,
|
|
327
|
-
onEpisodeUnlockPress,
|
|
328
|
-
openUnlockModal,
|
|
329
|
-
]
|
|
330
|
-
);
|
|
331
|
-
|
|
332
|
-
const navigationProps = useMemo(
|
|
333
|
-
() => ({
|
|
334
|
-
onBack: onBackPress,
|
|
335
|
-
onSearch: onSearchPress,
|
|
336
|
-
}),
|
|
337
|
-
[onBackPress, onSearchPress]
|
|
338
|
-
);
|
|
339
|
-
|
|
340
|
-
const settingsProps = useMemo(
|
|
341
|
-
() => ({
|
|
342
|
-
playbackRate,
|
|
343
|
-
quality: videoQuality,
|
|
344
|
-
onPlaybackRateChange: setPlaybackRate,
|
|
345
|
-
onQualityChange: setVideoQuality,
|
|
346
|
-
}),
|
|
347
|
-
[playbackRate, videoQuality]
|
|
348
|
-
);
|
|
349
|
-
|
|
350
|
-
const handleVideoEnd = useCallback(() => {
|
|
351
|
-
if (!autoScroll || isLocked || autoScrolledRef.current) {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
autoScrolledRef.current = true;
|
|
355
|
-
onAutoScrollNext?.();
|
|
356
|
-
}, [autoScroll, isLocked, onAutoScrollNext]);
|
|
357
|
-
|
|
358
|
-
// ----------------------- RENDER -----------------------
|
|
359
|
-
return (
|
|
360
|
-
<View style={[styles.container, { height: videoHeight }]}>
|
|
361
|
-
<MediaControlsProvider
|
|
362
|
-
theme={theme}
|
|
363
|
-
modal={modal}
|
|
364
|
-
setModal={setModal}
|
|
365
|
-
unlock={unlockProps}
|
|
366
|
-
content={contentProps}
|
|
367
|
-
video={videoProps}
|
|
368
|
-
likes={likesProps}
|
|
369
|
-
actions={actionsProps}
|
|
370
|
-
isFullScreen={isFullScreen}
|
|
371
|
-
navigation={navigationProps}
|
|
372
|
-
settings={settingsProps}
|
|
373
|
-
>
|
|
374
|
-
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
375
|
-
<GestureDetector gesture={combinedGesture}>
|
|
376
|
-
<View style={{ flex: 1 }}>
|
|
377
|
-
{buffering && (
|
|
378
|
-
<FastImage
|
|
379
|
-
source={{
|
|
380
|
-
uri: thumbnail,
|
|
381
|
-
priority: FastImage.priority.high,
|
|
382
|
-
}}
|
|
383
|
-
resizeMode={FastImage.resizeMode.cover}
|
|
384
|
-
defaultSource={require('../../../assets/img/play.png')}
|
|
385
|
-
style={StyleSheet.absoluteFillObject}
|
|
386
|
-
/>
|
|
387
|
-
)}
|
|
388
|
-
{(isVisible || preload) && (
|
|
389
|
-
<Video
|
|
390
|
-
ref={isVisible ? videoRef : undefined}
|
|
391
|
-
source={{ uri: videoUri }}
|
|
392
|
-
paused={finalPause}
|
|
393
|
-
repeat={!autoScroll}
|
|
394
|
-
resizeMode="cover"
|
|
395
|
-
poster={thumbnail}
|
|
396
|
-
posterResizeMode="cover"
|
|
397
|
-
rate={playbackRate}
|
|
398
|
-
onLoadStart={() => {
|
|
399
|
-
setBuffering(true);
|
|
400
|
-
setHasError(false);
|
|
401
|
-
}}
|
|
402
|
-
onBuffer={({ isBuffering }) => setBuffering(isBuffering)}
|
|
403
|
-
onReadyForDisplay={() => {
|
|
404
|
-
setBuffering(false);
|
|
405
|
-
setHasError(false);
|
|
406
|
-
}}
|
|
407
|
-
onLoad={(info) => {
|
|
408
|
-
if (
|
|
409
|
-
Number(info.duration) > 0 &&
|
|
410
|
-
Number(info.duration) < 100000
|
|
411
|
-
) {
|
|
412
|
-
setDuration(Number(info.duration));
|
|
413
|
-
}
|
|
414
|
-
setHasError(false);
|
|
415
|
-
}}
|
|
416
|
-
onProgress={(p) => {
|
|
417
|
-
setCurrentTime(p.currentTime);
|
|
418
|
-
if (isVisible) {
|
|
419
|
-
const safeDuration =
|
|
420
|
-
duration > 0
|
|
421
|
-
? duration
|
|
422
|
-
: Number((p as any).seekableDuration) || 0;
|
|
423
|
-
const totalWatchTime = p.currentTime;
|
|
424
|
-
const isVideoCompleted =
|
|
425
|
-
safeDuration > 0 &&
|
|
426
|
-
totalWatchTime >= safeDuration - 0.5;
|
|
427
|
-
|
|
428
|
-
onWatchProgress?.({
|
|
429
|
-
series: data,
|
|
430
|
-
episode: reel,
|
|
431
|
-
currentTime: p.currentTime,
|
|
432
|
-
duration: safeDuration,
|
|
433
|
-
isVideoCompleted,
|
|
434
|
-
totalWatchTime,
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
if (
|
|
438
|
-
p.currentTime >= MIN_VIEW_DURATION_SEC &&
|
|
439
|
-
!viewCountedRef.current
|
|
440
|
-
) {
|
|
441
|
-
viewCountedRef.current = true;
|
|
442
|
-
onViewCount?.({ id: reel.episodeId });
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}}
|
|
446
|
-
onEnd={handleVideoEnd}
|
|
447
|
-
style={StyleSheet.absoluteFillObject}
|
|
448
|
-
controls={false}
|
|
449
|
-
controlsStyles={videoControlsStyles}
|
|
450
|
-
ignoreSilentSwitch="ignore"
|
|
451
|
-
playInBackground={false}
|
|
452
|
-
onError={() => {
|
|
453
|
-
setBuffering(false);
|
|
454
|
-
setHasError(true);
|
|
455
|
-
setIsPaused(true);
|
|
456
|
-
}}
|
|
457
|
-
/>
|
|
458
|
-
)}
|
|
459
|
-
</View>
|
|
460
|
-
</GestureDetector>
|
|
461
|
-
</GestureHandlerRootView>
|
|
462
|
-
</MediaControlsProvider>
|
|
463
|
-
</View>
|
|
464
|
-
);
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
// Memo comparison – compare likes numerically so string/number don't cause extra re-renders
|
|
468
|
-
const areEqual = (prev: IReelItemProps, next: IReelItemProps) => {
|
|
469
|
-
const prevLikes = Number(prev.data.likes) || 0;
|
|
470
|
-
const nextLikes = Number(next.data.likes) || 0;
|
|
471
|
-
return (
|
|
472
|
-
prev.reel.episodeId === next.reel.episodeId &&
|
|
473
|
-
prev.isVisible === next.isVisible &&
|
|
474
|
-
prev.preload === next.preload &&
|
|
475
|
-
prev.activeEpisodeIndex === next.activeEpisodeIndex &&
|
|
476
|
-
prev.videoHeight === next.videoHeight &&
|
|
477
|
-
Boolean(prev.data.isLiked) === Boolean(next.data.isLiked) &&
|
|
478
|
-
prevLikes === nextLikes &&
|
|
479
|
-
prev.reel.isLocked === next.reel.isLocked &&
|
|
480
|
-
prev.reel.videoUrl === next.reel.videoUrl &&
|
|
481
|
-
prev.isVisible === next.isVisible
|
|
482
|
-
);
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
export default memo(ReelItem, areEqual);
|
|
486
|
-
|
|
487
|
-
const { width } = Dimensions.get('window');
|
|
488
|
-
|
|
489
|
-
const styles = StyleSheet.create({
|
|
490
|
-
container: {
|
|
491
|
-
width,
|
|
492
|
-
overflow: 'hidden',
|
|
493
|
-
},
|
|
494
|
-
});
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import { View, StyleSheet, Animated, Easing } from 'react-native';
|
|
3
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
import Svg, { Rect } from 'react-native-svg';
|
|
5
|
-
|
|
6
|
-
const AnimatedRect = Animated.createAnimatedComponent(Rect);
|
|
7
|
-
|
|
8
|
-
interface AnimatedThreeLinesProps {
|
|
9
|
-
isActive: boolean;
|
|
10
|
-
size?: number;
|
|
11
|
-
color?: string;
|
|
12
|
-
style?: StyleProp<ViewStyle>;
|
|
13
|
-
animationDuration?: number;
|
|
14
|
-
delayBetweenLines?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const AnimatedThreeLines: React.FC<AnimatedThreeLinesProps> = ({
|
|
18
|
-
isActive,
|
|
19
|
-
size = 16,
|
|
20
|
-
color = 'white',
|
|
21
|
-
style,
|
|
22
|
-
animationDuration = 600,
|
|
23
|
-
delayBetweenLines = 200,
|
|
24
|
-
}) => {
|
|
25
|
-
const line1Anim = useRef(new Animated.Value(0)).current;
|
|
26
|
-
const line2Anim = useRef(new Animated.Value(0)).current;
|
|
27
|
-
const line3Anim = useRef(new Animated.Value(0)).current;
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (isActive) {
|
|
31
|
-
// Custom bezier easing for ultra-smooth animation
|
|
32
|
-
const smoothEasing = Easing.bezier(0.4, 0.0, 0.2, 1); // Material Design easing
|
|
33
|
-
|
|
34
|
-
// Start continuous smooth animation
|
|
35
|
-
const createAnimation = (animValue: Animated.Value, delay: number) => {
|
|
36
|
-
return Animated.loop(
|
|
37
|
-
Animated.sequence([
|
|
38
|
-
Animated.delay(delay),
|
|
39
|
-
Animated.timing(animValue, {
|
|
40
|
-
toValue: 1,
|
|
41
|
-
duration: animationDuration,
|
|
42
|
-
easing: smoothEasing,
|
|
43
|
-
useNativeDriver: false, // SVG doesn't support native driver
|
|
44
|
-
}),
|
|
45
|
-
Animated.timing(animValue, {
|
|
46
|
-
toValue: 0,
|
|
47
|
-
duration: animationDuration,
|
|
48
|
-
easing: smoothEasing,
|
|
49
|
-
useNativeDriver: false, // SVG doesn't support native driver
|
|
50
|
-
}),
|
|
51
|
-
]),
|
|
52
|
-
{ iterations: -1 } // Infinite loop
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const anim1 = createAnimation(line1Anim, 0);
|
|
57
|
-
const anim2 = createAnimation(line2Anim, delayBetweenLines);
|
|
58
|
-
const anim3 = createAnimation(line3Anim, delayBetweenLines * 2);
|
|
59
|
-
|
|
60
|
-
// Start all animations
|
|
61
|
-
anim1.start();
|
|
62
|
-
anim2.start();
|
|
63
|
-
anim3.start();
|
|
64
|
-
|
|
65
|
-
return () => {
|
|
66
|
-
anim1.stop();
|
|
67
|
-
anim2.stop();
|
|
68
|
-
anim3.stop();
|
|
69
|
-
// Reset values on cleanup
|
|
70
|
-
line1Anim.setValue(0);
|
|
71
|
-
line2Anim.setValue(0);
|
|
72
|
-
line3Anim.setValue(0);
|
|
73
|
-
};
|
|
74
|
-
} else {
|
|
75
|
-
// Smoothly reset to initial state when not active
|
|
76
|
-
Animated.parallel([
|
|
77
|
-
Animated.timing(line1Anim, {
|
|
78
|
-
toValue: 0,
|
|
79
|
-
duration: 200,
|
|
80
|
-
easing: Easing.out(Easing.ease),
|
|
81
|
-
useNativeDriver: false,
|
|
82
|
-
}),
|
|
83
|
-
Animated.timing(line2Anim, {
|
|
84
|
-
toValue: 0,
|
|
85
|
-
duration: 200,
|
|
86
|
-
easing: Easing.out(Easing.ease),
|
|
87
|
-
useNativeDriver: false,
|
|
88
|
-
}),
|
|
89
|
-
Animated.timing(line3Anim, {
|
|
90
|
-
toValue: 0,
|
|
91
|
-
duration: 200,
|
|
92
|
-
easing: Easing.out(Easing.ease),
|
|
93
|
-
useNativeDriver: false,
|
|
94
|
-
}),
|
|
95
|
-
]).start();
|
|
96
|
-
}
|
|
97
|
-
return undefined;
|
|
98
|
-
}, [
|
|
99
|
-
isActive,
|
|
100
|
-
line1Anim,
|
|
101
|
-
line2Anim,
|
|
102
|
-
line3Anim,
|
|
103
|
-
animationDuration,
|
|
104
|
-
delayBetweenLines,
|
|
105
|
-
]);
|
|
106
|
-
|
|
107
|
-
// Animate height and Y position for ultra-smooth up/down movement
|
|
108
|
-
// Using extended input range for smoother interpolation
|
|
109
|
-
const line1Height = line1Anim.interpolate({
|
|
110
|
-
inputRange: [0, 0.5, 1],
|
|
111
|
-
outputRange: [4, 7, 10],
|
|
112
|
-
extrapolate: 'clamp',
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
const line1Y = line1Anim.interpolate({
|
|
116
|
-
inputRange: [0, 0.5, 1],
|
|
117
|
-
outputRange: [12, 9, 6], // Move up as height increases
|
|
118
|
-
extrapolate: 'clamp',
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const line2Height = line2Anim.interpolate({
|
|
122
|
-
inputRange: [0, 0.5, 1],
|
|
123
|
-
outputRange: [6, 9, 12],
|
|
124
|
-
extrapolate: 'clamp',
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const line2Y = line2Anim.interpolate({
|
|
128
|
-
inputRange: [0, 0.5, 1],
|
|
129
|
-
outputRange: [10, 7, 4], // Move up as height increases
|
|
130
|
-
extrapolate: 'clamp',
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
const line3Height = line3Anim.interpolate({
|
|
134
|
-
inputRange: [0, 0.5, 1],
|
|
135
|
-
outputRange: [4, 6, 8],
|
|
136
|
-
extrapolate: 'clamp',
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
const line3Y = line3Anim.interpolate({
|
|
140
|
-
inputRange: [0, 0.5, 1],
|
|
141
|
-
outputRange: [12, 10, 8], // Move up as height increases
|
|
142
|
-
extrapolate: 'clamp',
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<View style={[styles.container, style]}>
|
|
147
|
-
<Svg width={size} height={size} viewBox="0 0 16 16">
|
|
148
|
-
<AnimatedRect
|
|
149
|
-
x={1}
|
|
150
|
-
y={line1Y}
|
|
151
|
-
width={2.5}
|
|
152
|
-
height={line1Height}
|
|
153
|
-
rx={1.25}
|
|
154
|
-
fill={color}
|
|
155
|
-
/>
|
|
156
|
-
<AnimatedRect
|
|
157
|
-
x={6}
|
|
158
|
-
y={line2Y}
|
|
159
|
-
width={2.5}
|
|
160
|
-
height={line2Height}
|
|
161
|
-
rx={1.25}
|
|
162
|
-
fill={color}
|
|
163
|
-
/>
|
|
164
|
-
<AnimatedRect
|
|
165
|
-
x={11}
|
|
166
|
-
y={line3Y}
|
|
167
|
-
width={2.5}
|
|
168
|
-
height={line3Height}
|
|
169
|
-
rx={1.25}
|
|
170
|
-
fill={color}
|
|
171
|
-
/>
|
|
172
|
-
</Svg>
|
|
173
|
-
</View>
|
|
174
|
-
);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const styles = StyleSheet.create({
|
|
178
|
-
container: {
|
|
179
|
-
justifyContent: 'center',
|
|
180
|
-
alignItems: 'center',
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
export default AnimatedThreeLines;
|