Repository navigation
No brands protected screen implementation - #64
Conversation
|
Warning Rate limit exceeded@dev-rathore has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughThe pull request introduces a new Changes
Sequence DiagramsequenceDiagram
participant User
participant BrandProtectedScreen
participant AuthContext
participant Firestore
participant App
User->>BrandProtectedScreen: Enters App
BrandProtectedScreen->>AuthContext: Get Manager ID
AuthContext-->>BrandProtectedScreen: Return Manager ID
BrandProtectedScreen->>Firestore: Fetch Brands
Firestore-->>BrandProtectedScreen: Return Brand Data
alt Brands Found
BrandProtectedScreen->>App: Render App Content
else No Brands
BrandProtectedScreen->>App: Redirect to Onboarding
end
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (5)
layouts/protected/brand-protected-screen.tsx (2)
18-23: Add type safety for manager object.The manager object from useAuthContext lacks type safety.
+ interface Manager { + id: string; + // add other relevant fields + } + + const { + manager, + } = useAuthContext() as { manager: Manager | null };
67-87: Consider adding a loading state timeout.The loading screen could potentially show indefinitely if there are network issues or slow queries.
const LoadingScreen: React.FC = () => { const theme = useTheme(); + const [showTimeout, setShowTimeout] = useState(false); + + useEffect(() => { + const timer = setTimeout(() => setShowTimeout(true), 10000); + return () => clearTimeout(timer); + }, []); + + if (showTimeout) { + return ( + <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> + <Text>Taking longer than expected...</Text> + {/* Consider adding a retry button */} + </View> + ); + } if (Platform.OS === "web") { // ... existing code ... }components/shimmers/explore-influencer-shimmer.tsx (3)
12-14: Add TypeScript interface for component props.Even if the component doesn't accept props currently, it's good practice to explicitly define the interface for maintainability.
+interface ExploreInfluencerShimmerProps {} + -const ExploreInfluencerShimmer = () => { +const ExploreInfluencerShimmer: React.FC<ExploreInfluencerShimmerProps> = () => {
20-25: Extract magic numbers into named constants.The Shimmer dimensions and counts are hardcoded. Consider extracting these values into named constants for better maintainability.
+const SHIMMER_DIMENSIONS = { + HEADER_DROPDOWN: { width: 80, height: 36 }, + PROFILE_IMAGE: { width: 50, height: 50 }, + PROFILE_NAME: { width: 150, height: 20 }, + PROFILE_INFO: { width: 100, height: 16 }, + MAIN_CONTENT: { height: 300 }, + METRIC: { width: 50, height: 24 }, + BOTTOM_NAV: { width: 56, height: 48 }, +} as const;Also applies to: 39-43, 46-46, 49-51, 53-53
69-108: Consider enhancing theme support in styles.While the layout styling is well-organized, consider:
- Using theme-aware background colors for better dark mode support
- Extracting common spacing values (16, 12, 4) into constants
+const SPACING = { + SMALL: 4, + MEDIUM: 12, + LARGE: 16, +} as const; const styles = StyleSheet.create({ container: { flex: 1, - paddingHorizontal: 16, + paddingHorizontal: SPACING.LARGE, + backgroundColor: Colors(theme).background, }, // ... rest of the styles });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
app/(main)/(drawer)/_layout.tsx(1 hunks)app/index.tsx(1 hunks)components/shimmers/explore-influencer-shimmer.tsx(1 hunks)constants/Colors.ts(2 hunks)layouts/protected/brand-protected-screen.tsx(1 hunks)layouts/protected/index.ts(1 hunks)shared-uis(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- layouts/protected/index.ts
- shared-uis
🔇 Additional comments (5)
app/index.tsx (1)
1-20: LGTM! Clean splash screen implementation.The splash screen is well-implemented with proper styling to ensure the image fills the entire screen.
app/(main)/(drawer)/_layout.tsx (1)
5-28: LGTM! Clean integration of BrandProtectedScreen.The BrandProtectedScreen component is properly integrated while maintaining existing drawer functionality.
constants/Colors.ts (1)
22-23: LGTM! Well-defined shimmer effect colors.The shimmer colors are appropriately defined for both themes with good contrast ratios.
Also applies to: 38-39
components/shimmers/explore-influencer-shimmer.tsx (2)
1-11: LGTM! Clean and well-organized imports.The imports are properly structured with core dependencies first, followed by third-party libraries and local imports.
110-110: LGTM! Clean export statement.The default export is appropriate for this component.
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator * brand protected screen bug fix * shared-uis conflict * shared-uis conflict * fix: build * pushed ui fixes * social button change * Bug fixes (#68) * bug fixes * bug fixes * message screen fix * pushed ui fix * pushed icons * Bug fixes (#69) * bug fixes * render html, location address, and rating section * refactored code * refactor * refactor * location address changes * messages icons changes --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator * brand protected screen bug fix * shared-uis conflict * shared-uis conflict * fix: build * pushed ui fixes * social button change * Bug fixes (#68) * bug fixes * bug fixes * message screen fix * pushed ui fix * pushed icons * Bug fixes (#69) * bug fixes * render html, location address, and rating section * refactored code * refactor * refactor * location address changes * messages icons changes * pushed new icons * pushed brand modal fixes * pushed changes * Icons changes (#73) * icons changes * icons changes * email verification * changed icon * pushed slight change to dev for a slight route change * merge conflict * refactor code (#75) --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
* pushed new contract screens * fixed member container * Redesign application and invitation cards (#51) * redesign application and invitation cards * added keyboard view * fixes * added underline in file attachment * ui-feedback * added work * minor changes * Repurpose messaging screen (#53) * repurpose messaging screen * accept application changes * added phases * invitationId as influencerId * fixed signup signin * fix: bug on brand creation * minor changes * minor changes * minor changes * minor changes * pushed a minor change * fix: accept application (#56) * fix: accept application * fix: managerId * ui fix * Redirection fixes (#59) * fix: initial redirections * scheme change * router navigate fix * router navigate fix * Redirection changes (#61) * redirection changes * redirection changes * image component and other fixes * No brands protected screen implementation (#64) * added no brands protected screen and shimmer ui * shimmer ui update * added loading indicator * brand protected screen bug fix * shared-uis conflict * shared-uis conflict * fix: build * pushed ui fixes * social button change * Bug fixes (#68) * bug fixes * bug fixes * message screen fix * pushed ui fix * pushed icons * Bug fixes (#69) * bug fixes * render html, location address, and rating section * refactored code * refactor * refactor * location address changes * messages icons changes * pushed new icons * pushed brand modal fixes * pushed changes * Icons changes (#73) * icons changes * icons changes * email verification * changed icon * pushed slight change to dev for a slight route change * merge conflict * refactor code (#75) * feedbacks resolved (#77) * pushed changes * Feedbacks resolved (#79) * feedbacks resolved * max width refactor * removed unused imports * reusable component fix --------- Co-authored-by: Manan Sharma <112090668+Manan-Sharma-5@users.noreply.github.com>
Summary by CodeRabbit
Release Notes
New Features
Improvements
Chores
The release focuses on improving user experience with visual enhancements and access control mechanisms.