Move Router file structure#4
Conversation
refactor: restructure layout components for public and protected routes fix: update HeaderUser component to include admin options and improve navigation chore: update auth-client to include admin client plugin
Reviewer's GuideThis PR adds a new table component via @rn-primitives/table, reorganizes the router and layout file structure into distinct public, protected, common, and admin segments, enriches the HeaderUser component with admin options and fixes auth navigation, plugs in an admin client to the auth handler, and establishes admin-specific layouts and screens. Sequence diagram for admin route protection and navigationsequenceDiagram
actor User
participant HeaderUser
participant AdminLayout
participant authClient
participant System
User->>HeaderUser: Selects Admin option
HeaderUser->>System: push('/admin/manage-users')
User->>AdminLayout: Navigates to /admin/manage-users
AdminLayout->>authClient: useSession()
authClient-->>AdminLayout: Returns session data
AdminLayout->>System: Checks user role
alt User is admin
AdminLayout-->>User: Shows Manage Users screen
else User is not admin
AdminLayout-->>User: Redirects to Home
end
Class diagram for new Table componentclassDiagram
class Table {
+className
+...props
}
class TableHeader {
+className
+...props
}
class TableBody {
+className
+style
+...props
}
class TableFooter {
+className
+...props
}
class TableRow {
+className
+...props
}
class TableHead {
+className
+...props
}
class TableCell {
+className
+...props
}
Table --> TableHeader
Table --> TableBody
Table --> TableFooter
Table --> TableRow
Table --> TableHead
Table --> TableCell
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughWalkthroughThis change restructures the layout organization of the application, introducing new layout and admin-related components, updating routing logic, and enhancing access control for admin routes. It adds a UI table component, updates dependency management, modifies header behavior, and refines navigation and authentication flows, including admin-specific role checks. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AdminLayout
participant AuthClient
participant Router
User->>AdminLayout: Request admin route
AdminLayout->>AuthClient: Get session (loading, user)
alt loading
AdminLayout-->>User: Show loading screen
else not authenticated
AdminLayout->>Router: Redirect to /auth/sign-in
else authenticated but not admin
AdminLayout->>Router: Redirect to /
else authenticated as admin
AdminLayout-->>User: Render Slot (admin content)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Possibly related PRs
Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Hey @chakrihacker - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| const sub = navigation.addListener("blur", () => { | ||
| closeAll(); | ||
| }); | ||
|
|
||
| return sub; |
There was a problem hiding this comment.
suggestion (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)
| const sub = navigation.addListener("blur", () => { | |
| closeAll(); | |
| }); | |
| return sub; | |
| return navigation.addListener("blur", () => { | |
| closeAll(); | |
| }); | |
Explanation
Something that we often see in people's code is assigning to a result variableand then immediately returning it.
Returning the result directly shortens the code and removes an unnecessary
variable, reducing the mental load of reading the function.
Where intermediate variables can be useful is if they then get used as a
parameter or a condition, and the name can act like a comment on what the
variable represents. In the case where you're returning it from a function, the
function name is there to tell you what the result is, so the variable name
is unnecessary.
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (6)
src/app/(public)/_layout.tsx (1)
3-9: Consider removing unnecessary React Fragment.The component is correctly implemented for Expo Router's file-based routing. However, the React Fragment wrapper is unnecessary since you're only rendering a single
Slotcomponent.export default function PublicLayout() { - return ( - <> - <Slot /> - </> - ); + return <Slot />; }src/components/ui/table.tsx (1)
84-87: Consider alignment class consistency in TableHead.The className combines
text-leftandjustify-centerwhich may create conflicting alignment behaviors. Consider using consistent alignment utilities.- 'h-12 px-4 text-left justify-center font-medium [&:has([role=checkbox])]:pr-0', + 'h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0',src/components/layouts/protected/Header.native.tsx (1)
1-3: Valid platform-specific placeholder component.This stub component correctly maintains consistent imports across platforms while rendering nothing on native. Consider adding a TODO comment to track future native header implementation.
+// TODO: Implement native-specific header component export function Header() { return null; }src/app/(public)/(protected)/admin/manage-users.tsx (1)
1-10: Good initial implementation, consider enhancing for production.The basic screen structure follows established patterns and uses appropriate components. However, this appears to be a placeholder implementation that may need:
- Proper styling and layout
- User management functionality (CRUD operations)
- Error handling and loading states
- Integration with the table component mentioned in the PR objectives
src/app/(public)/(protected)/admin/_layout.tsx (1)
12-12: Remove console.log statement for production.The debug console.log should be removed or replaced with proper logging before production deployment.
- console.log("AdminLayout data", data);src/components/layouts/protected/Header.tsx (1)
39-49: Logo section ready for future navigation enhancement.The pressable logo area is well-structured with clear TODO documentation for home navigation functionality.
The TODO comment indicates planned home navigation functionality. Would you like me to help implement this feature or create an issue to track this task?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
package.json(1 hunks)src/app/(common)/_layout.tsx(0 hunks)src/app/(public)/(common)/_layout.tsx(1 hunks)src/app/(public)/(protected)/_layout.tsx(2 hunks)src/app/(public)/(protected)/admin/_layout.tsx(1 hunks)src/app/(public)/(protected)/admin/manage-users.tsx(1 hunks)src/app/(public)/_layout.tsx(1 hunks)src/app/_layout.tsx(0 hunks)src/components/layouts/protected/Header.native.tsx(1 hunks)src/components/layouts/protected/Header.tsx(1 hunks)src/components/ui/table.tsx(1 hunks)src/containers/core/HeaderUser.tsx(7 hunks)src/lib/auth-client.ts(1 hunks)src/lib/icons/Shield.tsx(1 hunks)
💤 Files with no reviewable changes (2)
- src/app/_layout.tsx
- src/app/(common)/_layout.tsx
🧰 Additional context used
📓 Path-based instructions (6)
src/app/**/*.tsx
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
src/app/**/*.tsx: src/app/ contains all routes using Expo Router file-based routing
Expo Router requires specific file naming conventions for routing
Files:
src/app/(public)/(protected)/_layout.tsxsrc/app/(public)/(common)/_layout.tsxsrc/app/(public)/(protected)/admin/manage-users.tsxsrc/app/(public)/_layout.tsxsrc/app/(public)/(protected)/admin/_layout.tsx
src/**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
src/**/*.{ts,tsx}: Use Platform.OS and process.env.EXPO_OS for conditional logic
Consider all platforms (iOS/Android/Web) when using native APIs
Files:
src/app/(public)/(protected)/_layout.tsxsrc/app/(public)/(common)/_layout.tsxsrc/app/(public)/(protected)/admin/manage-users.tsxsrc/lib/auth-client.tssrc/app/(public)/_layout.tsxsrc/lib/icons/Shield.tsxsrc/components/layouts/protected/Header.native.tsxsrc/components/ui/table.tsxsrc/app/(public)/(protected)/admin/_layout.tsxsrc/containers/core/HeaderUser.tsxsrc/components/layouts/protected/Header.tsx
src/**/*.tsx
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
Import UI components from @/src/components/ui/ using path aliases
Files:
src/app/(public)/(protected)/_layout.tsxsrc/app/(public)/(common)/_layout.tsxsrc/app/(public)/(protected)/admin/manage-users.tsxsrc/app/(public)/_layout.tsxsrc/lib/icons/Shield.tsxsrc/components/layouts/protected/Header.native.tsxsrc/components/ui/table.tsxsrc/app/(public)/(protected)/admin/_layout.tsxsrc/containers/core/HeaderUser.tsxsrc/components/layouts/protected/Header.tsx
src/lib/auth-client.ts
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
src/lib/auth-client.ts: Auth client in src/lib/auth-client.ts with platform-specific plugins
Better Auth requires platform-specific plugin setup for native vs web storage
Files:
src/lib/auth-client.ts
{src/lib/auth-client.ts,src/app/(auth)/**/*.tsx}
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
{src/lib/auth-client.ts,src/app/(auth)/**/*.tsx}: Use authClient.useSession() hook for session state
Use authClient hooks for auth state management
Files:
src/lib/auth-client.ts
src/components/ui/**/*.tsx
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
src/components/ui/**/*.tsx: UI components use NativeWind's className prop with Tailwind utility classes
Use cva (class-variance-authority) for creating variant-based component APIs
Access theme values through CSS custom properties and Tailwind utilities
UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Use Tailwind's responsive prefixes (sm:, md:, lg:) and NativeWind's responsive utilities
Use web: prefix for web-only styles, and conditional rendering for native-specific components
Place UI components in src/components/ui/ with proper TypeScript interfaces
Always use NativeWind's className prop with Tailwind utility classes
Define variants using cva (class-variance-authority) for type-safe component APIs
Use Tailwind's spacing utilities (p-4, m-2, gap-3, etc.)
Use Tailwind's typography utilities (text-lg, font-semibold, etc.)
Toggle between light/dark themes using className conditionals and CSS variables
Use platform-specific prefixes (web:, ios:, android:) for conditional styles
Files:
src/components/ui/table.tsx
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : Expo Router requires specific file naming conventions for routing
src/app/(public)/(protected)/_layout.tsx (13)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/app/_layout.tsx,src/index.tsx} : Ensure global.css is properly imported in the app entry point
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/**/*.tsx : Import UI components from @/src/components/ui/ using path aliases
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient hooks for auth state management
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Place UI components in src/components/ui/ with proper TypeScript interfaces
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : Expo Router requires specific file naming conventions for routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient.useSession() hook for session state
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/TabBar*.tsx : Tab bar uses platform-specific blur effects via conditional components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/lib/auth-client.ts : Auth client in src/lib/auth-client.ts with platform-specific plugins
src/app/(public)/(common)/_layout.tsx (10)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/app/_layout.tsx,src/index.tsx} : Ensure global.css is properly imported in the app entry point
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : Expo Router requires specific file naming conventions for routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Place UI components in src/components/ui/ with proper TypeScript interfaces
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/**/*.tsx : Import UI components from @/src/components/ui/ using path aliases
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
src/app/(public)/(protected)/admin/manage-users.tsx (9)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Place UI components in src/components/ui/ with proper TypeScript interfaces
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/**/*.tsx : Import UI components from @/src/components/ui/ using path aliases
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient hooks for auth state management
src/lib/auth-client.ts (5)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/lib/auth-client.ts : Auth client in src/lib/auth-client.ts with platform-specific plugins
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient hooks for auth state management
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/lib/auth-client.ts : Better Auth requires platform-specific plugin setup for native vs web storage
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient.useSession() hook for session state
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
src/app/(public)/_layout.tsx (10)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : Expo Router requires specific file naming conventions for routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/app/_layout.tsx,src/index.tsx} : Ensure global.css is properly imported in the app entry point
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Place UI components in src/components/ui/ with proper TypeScript interfaces
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/**/*.tsx : Import UI components from @/src/components/ui/ using path aliases
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
src/lib/icons/Shield.tsx (7)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/IconSymbol.tsx : IconSymbol component maps SF Symbols (iOS) to Material Icons (other platforms)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/**/*.tsx : Import UI components from @/src/components/ui/ using path aliases
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Place UI components in src/components/ui/ with proper TypeScript interfaces
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components use NativeWind's className prop with Tailwind utility classes
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Always use NativeWind's className prop with Tailwind utility classes
src/components/layouts/protected/Header.native.tsx (3)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/TabBar*.tsx : Tab bar uses platform-specific blur effects via conditional components
src/components/ui/table.tsx (13)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Place UI components in src/components/ui/ with proper TypeScript interfaces
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components use NativeWind's className prop with Tailwind utility classes
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/**/*.tsx : Import UI components from @/src/components/ui/ using path aliases
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use Tailwind's responsive prefixes (sm:, md:, lg:) and NativeWind's responsive utilities
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/TabBar*.tsx : Tab bar uses platform-specific blur effects via conditional components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use platform-specific prefixes (web:, ios:, android:) for conditional styles
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Always use NativeWind's className prop with Tailwind utility classes
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Access theme values through CSS custom properties and Tailwind utilities
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Toggle between light/dark themes using className conditionals and CSS variables
src/app/(public)/(protected)/admin/_layout.tsx (10)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient hooks for auth state management
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient.useSession() hook for session state
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/app/_layout.tsx,src/index.tsx} : Ensure global.css is properly imported in the app entry point
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Place UI components in src/components/ui/ with proper TypeScript interfaces
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : Expo Router requires specific file naming conventions for routing
src/containers/core/HeaderUser.tsx (16)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to {src/lib/auth-client.ts,src/app/(auth)/**/*.tsx} : Use authClient hooks for auth state management
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : Expo Router requires specific file naming conventions for routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/TabBar*.tsx : Tab bar uses platform-specific blur effects via conditional components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/**/*.tsx : Import UI components from @/src/components/ui/ using path aliases
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use platform-specific prefixes (web:, ios:, android:) for conditional styles
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use Tailwind's responsive prefixes (sm:, md:, lg:) and NativeWind's responsive utilities
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use Tailwind's spacing utilities (p-4, m-2, gap-3, etc.)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components use NativeWind's className prop with Tailwind utility classes
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use Tailwind's typography utilities (text-lg, font-semibold, etc.)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Always use NativeWind's className prop with Tailwind utility classes
src/components/layouts/protected/Header.tsx (8)
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/TabBar*.tsx : Tab bar uses platform-specific blur effects via conditional components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/(auth)/**/*.tsx : File-based routing with (auth) group for sign-in/sign-up screens
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : UI components in src/components/ui/ follow React.forwardRef pattern with displayName
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/app/**/*.tsx : src/app/ contains all routes using Expo Router file-based routing
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use web: prefix for web-only styles, and conditional rendering for native-specific components
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Use cva (class-variance-authority) for creating variant-based component APIs
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Toggle between light/dark themes using className conditionals and CSS variables
Learnt from: CR
PR: fyndx/expo-universal-starter#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-28T12:52:53.959Z
Learning: Applies to src/components/ui/**/*.tsx : Define variants using cva (class-variance-authority) for type-safe component APIs
🧬 Code Graph Analysis (4)
src/app/(public)/(protected)/_layout.tsx (3)
src/app/(protected)/_layout.tsx (1)
ProtectedLayout(6-23)src/app/(public)/(auth)/_layout.tsx (1)
AuthLayout(6-28)src/components/layouts/default/Header.native.tsx (1)
Header(1-3)
src/app/(public)/(protected)/admin/manage-users.tsx (2)
src/components/ui/text.tsx (1)
Text(26-26)src/app/(protected)/home/(tabs)/explore.tsx (1)
TabTwoScreen(4-10)
src/components/ui/table.tsx (3)
src/lib/utils.ts (1)
cn(4-6)src/components/ui/text.tsx (2)
TextClassContext(26-26)Text(8-24)src/components/ui/avatar.tsx (1)
Avatar(5-17)
src/containers/core/HeaderUser.tsx (5)
src/lib/icons/Shield.tsx (1)
Shield(5-5)src/components/ui/dropdown-menu.tsx (1)
DropdownMenuContent(88-129)src/components/ui/text.tsx (1)
Text(26-26)src/components/ui/button.tsx (1)
Button(80-80)src/app/(public)/(auth)/_layout.tsx (1)
AuthLayout(6-28)
🔇 Additional comments (22)
package.json (1)
29-29: LGTM!The new
@rn-primitives/tabledependency is properly added with appropriate versioning and maintains alphabetical ordering in the dependencies list.src/components/ui/table.tsx (1)
1-108: Well-implemented table components following established patterns.The table components properly wrap the
@rn-primitives/tableprimitives and follow the established UI component patterns with proper TypeScript interfaces, className merging, and prop forwarding.src/lib/auth-client.ts (2)
2-2: LGTM!Proper import of
adminClientfrom the better-auth plugins package to enable admin functionality.
6-6: LGTM!Correct initialization of the plugins array with
adminClient()to enable admin authentication features. This change supports the admin route layouts and access control mentioned in the PR objectives.src/app/(public)/(protected)/_layout.tsx (2)
2-2: LGTM! Header import updated to use protected layout.The import change from default to protected layout header aligns with the layout restructuring and maintains proper separation of concerns between different layout types.
14-14: LGTM! Redirect path updated to match new auth route structure.The redirect path change from "/sign-in" to "/auth/sign-in" is consistent with Expo Router's file-based routing conventions and the new (auth) route group structure.
src/app/(public)/(common)/_layout.tsx (1)
1-11: LGTM! Clean and well-structured common layout.The implementation follows Expo Router conventions properly with correct use of
Slotfor nested routes and appropriate header inclusion. The component structure is clean and maintainable.src/lib/icons/Shield.tsx (1)
1-5: LGTM! Icon component follows established pattern.The Shield icon implementation correctly uses the
iconWithClassNameutility and follows the established pattern for icon components in the codebase. The re-export structure is clean and appropriate for admin/security-related UI elements.src/app/(public)/(protected)/admin/_layout.tsx (2)
5-27: LGTM! Well-implemented role-based access control.The admin layout properly implements authentication and role-based access control with appropriate loading states and redirects. The logic flow is sound and follows established patterns in the codebase.
18-20: Verify thatdata.user.roleexists and matches “admin”I didn’t find any local
Usertype or other.roleusages in the codebase, so it’s unclear whether the auth client actually returns arolefield onuser. Please double-check the shape of the object returned by yourauthClienthook (or refer to the Better Auth docs) and ensure:
- A
user.roleproperty is always present whendatais defined- The
rolevalue is a string and uses the literal"admin"for admins- You update your types or add a runtime guard if the structure differs
src/containers/core/HeaderUser.tsx (8)
1-1: LGTM! Good type safety addition.The
Hreftype import is correctly added for type-safe navigation paths.
22-22: LGTM! Consistent icon import pattern.The Shield icon import follows the established pattern and is used appropriately for the admin option.
68-79: Excellent implementation of dynamic menu options.The mapping of Options to DropdownMenuItem components is well-implemented with proper React keys, consistent styling, and type-safe navigation.
81-81: Good UX improvement with destructive variant.Using the "destructive" variant for the logout button better communicates the nature of the action to users.
97-97: Correct path update aligning with new routing structure.The navigation path update to "/auth/sign-in" correctly reflects the new router file structure mentioned in the PR objectives.
134-148: Consistent mobile implementation with good UX.The mobile Options mapping correctly mirrors the desktop implementation and includes proper bottom sheet dismissal before navigation.
150-150: Consistent mobile and desktop implementations.The logout button variant and login path updates maintain consistency between mobile and desktop views, which is excellent for user experience.
Also applies to: 161-161
24-30: Admin route confirmed and access control in place
- The file
src/app/(public)/(protected)/admin/manage-users.tsximplements the/admin/manage-usersroute.- Role-based protection is enforced in
src/app/(public)/(protected)/admin/_layout.tsx, redirecting non-admin users.No further changes needed.
src/components/layouts/protected/Header.tsx (4)
1-8: Well-organized imports following guidelines.The imports correctly use platform-specific logic and UI component path aliases as specified in the coding guidelines.
29-36: Good platform-specific overlay implementation.The conditional overlay for non-web platforms follows the coding guidelines and provides good UX with background tap to close. The implementation depends on fixing the type issue in the state management.
37-55: Clean and well-structured header layout.The header implementation uses appropriate Tailwind utility classes, maintains good separation of concerns, and integrates well with existing components.
50-54: Excellent integration of existing components.The right section cleanly integrates the ThemeToggle and updated HeaderUser components with proper spacing and layout.
| export function Header() { | ||
| const [value, setValue] = React.useState<string>(); | ||
| const navigation = useNavigation(); | ||
|
|
||
| function closeAll() { | ||
| setValue(""); | ||
| } | ||
|
|
||
| // biome-ignore lint/correctness/useExhaustiveDependencies: `navigation` is stable | ||
| useEffect(() => { | ||
| const sub = navigation.addListener("blur", () => { | ||
| closeAll(); | ||
| }); | ||
|
|
||
| return sub; | ||
| }, []); |
There was a problem hiding this comment.
Fix type inconsistency in state initialization.
The value state is typed as string but initialized as undefined, creating a type mismatch. The closeAll function uses empty string as the reset value.
-const [value, setValue] = React.useState<string>();
+const [value, setValue] = React.useState<string>("");Or if undefined is intentional:
-const [value, setValue] = React.useState<string>();
+const [value, setValue] = React.useState<string | undefined>();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export function Header() { | |
| const [value, setValue] = React.useState<string>(); | |
| const navigation = useNavigation(); | |
| function closeAll() { | |
| setValue(""); | |
| } | |
| // biome-ignore lint/correctness/useExhaustiveDependencies: `navigation` is stable | |
| useEffect(() => { | |
| const sub = navigation.addListener("blur", () => { | |
| closeAll(); | |
| }); | |
| return sub; | |
| }, []); | |
| export function Header() { | |
| - const [value, setValue] = React.useState<string>(); | |
| + const [value, setValue] = React.useState<string>(""); | |
| const navigation = useNavigation(); | |
| function closeAll() { | |
| setValue(""); | |
| } | |
| // biome-ignore lint/correctness/useExhaustiveDependencies: `navigation` is stable | |
| useEffect(() => { | |
| const sub = navigation.addListener("blur", () => { | |
| closeAll(); | |
| }); | |
| return sub; | |
| }, []); | |
| } |
🤖 Prompt for AI Agents
In src/components/layouts/protected/Header.tsx around lines 10 to 25, the state
variable 'value' is typed as string but initialized without a value, causing a
type mismatch. To fix this, initialize 'value' with an empty string to match the
string type and align with the reset value used in closeAll. Alternatively, if
undefined is intended, update the type to string | undefined accordingly.
| }) { | ||
| return ( | ||
| <TablePrimitive.Footer | ||
| className={cn('bg-muted/50 font-medium [&>tr]:last:border-b-0', className)} |
There was a problem hiding this comment.
Fix selector syntax in TableFooter className.
The selector [&>tr]:last:border-b-0 is incorrect. It should use :last-child pseudo-selector.
- className={cn('bg-muted/50 font-medium [&>tr]:last:border-b-0', className)}
+ className={cn('bg-muted/50 font-medium [&>tr:last-child]:border-b-0', className)}🤖 Prompt for AI Agents
In src/components/ui/table.tsx at line 52, the className uses an incorrect
selector `[&>tr]:last:border-b-0`. Replace `:last` with the correct
pseudo-selector `:last-child` to fix the syntax, making it
`[&>tr]:last-child:border-b-0`.
User description
feat: add @rn-primitives/table dependency and implement table component
refactor: restructure layout components for public and protected routes
fix: update HeaderUser component to include admin options and improve navigation
chore: update auth-client to include admin client plugin
PR Type
Enhancement
Description
Restructure router layout with public/protected route separation
Add admin role-based access control and management screen
Implement table component with @rn-primitives/table dependency
Update authentication client with admin plugin support
Diagram Walkthrough
File Walkthrough
13 files
Add admin client plugin to auth configurationRemove common layout file (restructuring)Create public common layout with headerUpdate protected layout header import and redirect pathCreate admin layout with role-based access controlAdd manage users admin screen placeholderCreate public routes layout wrapperSimplify root layout stack screen configurationAdd empty native header component for protected routesCreate protected routes header with navigation and brandingImplement complete table component with primitivesAdd admin options and update navigation pathsAdd Shield icon for admin interface1 files
Add @rn-primitives/table dependency for table components10 files
Summary by CodeRabbit
New Features
Improvements
Chores
@rn-primitives/tablepackage as a new dependency.