Repository navigation
Bug fix/UI feedback color changes #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,23 +61,21 @@ export default function RootLayout() { | |
|
|
||
| return ( | ||
| <GestureHandlerRootView> | ||
| <Provider> | ||
| <AuthContextProvider> | ||
| <FirebaseStorageContextProvider> | ||
| <NotificationContextProvider> | ||
| <CloudMessagingContextProvider> | ||
| <BrandContextProvider> | ||
| <CollaborationContextProvider> | ||
| <AutocompleteDropdownContextProvider> | ||
| <RootLayoutStack /> | ||
| </AutocompleteDropdownContextProvider> | ||
| </CollaborationContextProvider> | ||
| </BrandContextProvider> | ||
| </CloudMessagingContextProvider> | ||
| </NotificationContextProvider> | ||
| </FirebaseStorageContextProvider> | ||
| </AuthContextProvider> | ||
| </Provider> | ||
| <AuthContextProvider> | ||
| <FirebaseStorageContextProvider> | ||
| <NotificationContextProvider> | ||
| <CloudMessagingContextProvider> | ||
| <BrandContextProvider> | ||
| <CollaborationContextProvider> | ||
| <AutocompleteDropdownContextProvider> | ||
| <RootLayoutStack /> | ||
| </AutocompleteDropdownContextProvider> | ||
| </CollaborationContextProvider> | ||
| </BrandContextProvider> | ||
| </CloudMessagingContextProvider> | ||
| </NotificationContextProvider> | ||
| </FirebaseStorageContextProvider> | ||
| </AuthContextProvider> | ||
|
Comment on lines
+64
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification The react-native-paper Provider is required and should not be removed The codebase extensively uses react-native-paper components, including Modals, FABs, and other components that require the Provider context. The Provider import is present in the layout file but has been removed from the component tree. This will cause styling and functionality issues for react-native-paper components throughout the application.
<GestureHandlerRootView>
<Provider>
<AuthContextProvider>
{/* other context providers */}
</AuthContextProvider>
</Provider>
</GestureHandlerRootView>🔗 Analysis chainVerify the removal of react-native-paper Provider. While removing the unnecessary wrapper improves the component hierarchy, we should ensure that no components rely on react-native-paper's theming or components. The search results show extensive usage of react-native-paper components throughout the codebase, including components that typically require the Provider context (like Modal, Dialog, Portal, etc.). Let's verify if there's another Provider setup elsewhere in the codebase that might be handling these components. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for react-native-paper component usage in the codebase
echo "Checking for react-native-paper component usage..."
rg -l "from 'react-native-paper'" || rg -l 'from "react-native-paper"'
# Search for specific paper components that might need the Provider
echo "Checking for specific Paper components that typically need Provider..."
rg -l "useTheme|Portal\.Host|FAB|Snackbar|Modal|Dialog"
Length of output: 3696 Script: #!/bin/bash
# Check for any other react-native-paper Provider setup in the codebase
echo "Checking for Provider setup from react-native-paper..."
rg -A 5 "import.*Provider.*from 'react-native-paper'" || rg -A 5 'import.*Provider.*from "react-native-paper"'
# Check the specific layout file to see the complete context
echo "Checking the layout file..."
cat app/_layout.tsx
Length of output: 5318 |
||
| </GestureHandlerRootView> | ||
| ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,44 +133,35 @@ const InfluencerCard = (props: InfluencerCardPropsType) => { | |
| }} | ||
| > | ||
| <Animated.View> | ||
| <Image source={{ uri: item.url }} style={styles.media} /> | ||
| <Image | ||
| source={{ uri: item.url || item.uri }} | ||
| style={styles.media} | ||
| /> | ||
| </Animated.View> | ||
| </TapGestureHandler> | ||
| ); | ||
| } else { | ||
| return ( | ||
| <TouchableOpacity | ||
| onPress={() => { | ||
| if (!isSwiping) { | ||
| setMuted(!muted); | ||
| if (index === currentIndex) { | ||
| setIsPlaying(!isPlaying); | ||
| } | ||
| <Video | ||
| ref={(ref) => { | ||
| if (ref) { | ||
| videoRefs.current[index] = ref; | ||
| } | ||
| }} | ||
|
Comment on lines
+146
to
150
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prevent potential memory leaks with video refs. The current implementation of video refs could lead to memory leaks. Consider cleaning up refs on component unmount. Add a cleanup effect: useEffect(() => {
return () => {
// Cleanup video refs on unmount
Object.values(videoRefs.current).forEach((videoRef) => {
if (videoRef) {
videoRef.unloadAsync();
}
});
videoRefs.current = {};
};
}, []); |
||
| > | ||
| <Video | ||
| ref={(ref) => { | ||
| if (ref) { | ||
| videoRefs.current[index] = ref; | ||
| } | ||
| }} | ||
| source={ | ||
| item.appleUrl | ||
| ? { | ||
| uri: Platform.OS === "ios" ? item.appleUrl : item.playUrl, | ||
| } | ||
| : require("../assets/videos/ForBiggerJoyrides.mp4") | ||
| } | ||
| style={styles.media} | ||
| resizeMode={ResizeMode.COVER} | ||
| isLooping | ||
| isMuted={muted} | ||
| shouldPlay={isPlaying} | ||
| useNativeControls | ||
| onError={(error) => console.log("Video Error:", error)} | ||
| /> | ||
| </TouchableOpacity> | ||
| source={ | ||
| item.appleUrl | ||
| ? { | ||
| uri: Platform.OS === "ios" ? item.appleUrl : item.playUrl, | ||
| } | ||
| : require("../assets/videos/ForBiggerJoyrides.mp4") | ||
| } | ||
| style={styles.media} | ||
| resizeMode={ResizeMode.COVER} | ||
| isLooping={false} | ||
| shouldPlay={false} | ||
| useNativeControls | ||
|
Comment on lines
+158
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add loading state for video playback. The video component lacks loading state handling, which could lead to poor user experience while videos are buffering. <Video
style={styles.media}
resizeMode={ResizeMode.COVER}
isLooping={false}
shouldPlay={false}
useNativeControls
+ onLoadStart={() => setLoading(index, true)}
+ onLoad={() => setLoading(index, false)}
/>
+{loading[index] && (
+ <ActivityIndicator
+ style={styles.videoLoader}
+ size="large"
+ />
+)}
|
||
| onError={(error) => console.log("Video Error:", error)} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improve video error handling. Simply logging video errors to console isn't sufficient for production. Consider implementing proper error handling and user feedback. - onError={(error) => console.log("Video Error:", error)}
+ onError={(error) => {
+ console.error("Video Error:", error);
+ // Show error state UI
+ setVideoError(index, true);
+ // Optionally retry loading or show fallback content
+ }}
|
||
| /> | ||
| ); | ||
| } | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we removed react-native-paper Provider, isn't that required?