Skip to content
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

BA-2391: create native tabs component #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ronan-Fernandes
Copy link
Contributor

@Ronan-Fernandes Ronan-Fernandes commented Mar 20, 2025

  • __package_name__ package update - v __package_version__
    • changelog_info
    • changelog_info

Summary by CodeRabbit

  • New Features
    • Introduced new tab navigation components to enhance user interfaces with customizable labels, colors, and smooth switching behavior.
    • Enabled dynamic styling based on active/inactive states for a more responsive design.
  • Chores
    • Upgraded the design system version to 1.0.11.

Copy link

changeset-bot bot commented Mar 20, 2025

⚠️ No Changeset found

Latest commit: bf3d044

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Ronan-Fernandes Ronan-Fernandes self-assigned this Mar 20, 2025
Copy link

coderabbitai bot commented Mar 20, 2025

Walkthrough

This update introduces new Tabs and Tab components into the design system along with their supporting files. The changes include the creation of functional components for individual tabs and a container for multiple tabs, the addition of corresponding styles and types, the implementation of a shared context for managing tab states, and updates to the package's changelog and version. The components use hooks to integrate with the theme and context, enabling dynamic styling based on the selected state.

Changes

File(s) Change Summary
packages/design-system/components/native/tabs/Tab/index.tsx, .../Tab/styles.ts, .../Tab/types.ts Added new Tab component, its styles, and TypeScript interface (TabProps).
packages/design-system/components/native/tabs/Tabs/index.tsx, .../Tabs/styles.ts, .../Tabs/types.ts, .../Tabs/context.tsx Added new Tabs component, its styles, TypeScript interface (TabsProps & TabsContextValue), and a context (TabsContext/useTabsContext) for tab state management.
packages/design-system/components/native/tabs/index.ts Created a central export file re-exporting Tab and Tabs components as well as their types.
packages/design-system/CHANGELOG.md, packages/design-system/package.json Updated changelog with a new version entry (1.0.11) and bumped the package version accordingly.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant TC as Tab Component
    participant CNTX as TabsContext
    participant TPC as Tabs Component

    U->>TC: Clicks on Tab button
    TC->>CNTX: Reads current tab value and onChange handler
    TC->>TPC: Invokes onChange callback with new tab value
    TPC-->>CNTX: Updates currentValue in context
    CNTX-->>TC: Renders Tab with updated selection state
Loading

Suggested reviewers

  • priscilladeroode
  • deboracosilveira
  • tsl-ps2
  • anicioalexandre

Poem

I’m a bunny hopping through lines of code,
With Tabs and Colors in a cheerful mode.
Contexts shared and buttons pressed,
New features bloom, simply the best!
Coding carrots make my heart explode!
🐰🥕✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/design-system/components/native/tabs/Tab/styles.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/design-system/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/design-system/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/design-system/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
packages/design-system/components/native/tabs/Tab/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/design-system/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/design-system/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/design-system/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
packages/design-system/components/native/tabs/Tabs/styles.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/design-system/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/design-system/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/design-system/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
  • 5 others
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Ronan-Fernandes Ronan-Fernandes added the needs review PR needs to be reviewed. label Mar 20, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
packages/design-system/components/native/tabs/Tab/index.tsx (1)

23-29: Missing accessibility properties for the tab component.

The tab component should have appropriate ARIA roles and properties to ensure proper accessibility.

  return (
    <View style={styles.baseTabContainer}>
-      <Button mode="text" onPress={() => onChange(value)}>
+      <Button 
+        mode="text" 
+        onPress={() => onChange(value)}
+        accessibilityRole="tab"
+        accessibilityState={{ selected: isSelected }}
+      >
        <Text variant="subtitle2" color={isSelected ? selectedColor : unselectedColor}>
          {label}
        </Text>
      </Button>
    </View>
  )
packages/design-system/components/native/tabs/Tabs/index.tsx (3)

9-12: Consider handling undefined onChange with a default value.

The onChange prop doesn't have a default value, which could lead to errors if not provided. Since you're passing it to child components, it should have a fallback.

-const Tabs: FC<TabsProps> = ({ onChange, value, children, style, ...props }) => {
+const Tabs: FC<TabsProps> = ({ onChange = () => {}, value, children, style, ...props }) => {
  const theme = useTheme()
  const styles = createStyles(theme)

13-22: Add type safety for child elements.

The component assumes that any valid React element can receive the onChange and currentValue props. Consider adding a more specific type check to ensure only Tab components are processed.

  const renderChildren = () =>
    React.Children.map(children, (child) => {
      if (React.isValidElement(child)) {
+       // Check if child is a Tab component or has the necessary props shape
+       if (typeof child.type === 'function' && 'value' in child.props) {
          return React.cloneElement(child as React.ReactElement<TabProps>, {
            onChange,
            currentValue: value,
          })
+       }
+       console.warn('Tabs component only accepts Tab components as children')
+       return child;
      }
      return null
    })

24-27: Add accessibility roles for the tabs container.

The tabs container should have appropriate ARIA roles to ensure proper accessibility.

  return (
-    <View style={[styles.baseTabsContainer, style]} {...props}>
+    <View 
+      style={[styles.baseTabsContainer, style]} 
+      accessibilityRole="tablist"
+      {...props}
+    >
      {renderChildren()}
    </View>
  )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c851380 and ecc94f3.

⛔ Files ignored due to path filters (2)
  • packages/components/__generated__/ActivityLogsFragment.graphql.ts is excluded by !**/__generated__/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • packages/design-system/components/native/tabs/Tab/index.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tab/styles.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tab/types.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/index.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/styles.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/types.ts (1 hunks)
  • packages/design-system/components/native/tabs/index.ts (1 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
packages/design-system/components/native/tabs/Tabs/types.ts (1)
packages/design-system/components/native/tabs/Tab/types.ts (1) (1)
  • TabProps (3-10)
packages/design-system/components/native/tabs/Tabs/styles.ts (1)
packages/design-system/components/native/tabs/Tab/styles.ts (1) (1)
  • createStyles (5-11)
🔇 Additional comments (5)
packages/design-system/components/native/tabs/Tabs/types.ts (1)

1-8: Interface design looks clean and appropriate

The TabsProps interface properly extends ViewProps and includes the essential properties for a tabs container component. The type definition correctly specifies that children should be React elements that conform to the TabProps interface.

A couple of observations:

  • The onChange function is required, which is appropriate for controlled components
  • The typed array for children will ensure type safety when rendering Tab components
packages/design-system/components/native/tabs/Tabs/styles.ts (1)

5-16: Style implementation follows React Native best practices

The createStyles function is well-implemented, creating a container with appropriate flex layout properties and a subtle bottom border to provide visual structure for the tabs.

The use of theme values for colors maintains consistency with the design system, and the explicit gap value helps ensure proper spacing between tab elements.

packages/design-system/components/native/tabs/Tab/types.ts (1)

3-10: Well-structured interface with appropriate optionality

The TabProps interface is well-designed with:

  • Required properties (value, label) for core functionality
  • Optional callbacks and styling properties for flexibility
  • Type-safe color selection using keyof ObjectToken

This approach allows for both controlled (when parent manages state via onChange and currentValue) and uncontrolled usage of the Tab component.

packages/design-system/components/native/tabs/Tab/styles.ts (1)

5-11: Clean conditional styling based on selection state

The style implementation effectively uses the isSelected parameter to conditionally apply bottom border styling, creating a clear visual indicator for the active tab.

This approach is performant and follows React Native best practices by:

  1. Using conditional expressions for dynamic styles
  2. Leveraging theme colors for consistency
  3. Keeping the style object simple and focused
packages/design-system/components/native/tabs/index.ts (1)

1-4: Exports look good and follow standard patterns.

The barrel file properly exports both the Tabs and Tab components as named exports, along with their type definitions. This approach allows users to import everything needed from a single entry point.

@anicioalexandre anicioalexandre added needs changes PR was reviewed, and changes are required. and removed needs review PR needs to be reviewed. labels Mar 26, 2025
@Ronan-Fernandes Ronan-Fernandes force-pushed the BA-2391-rn-create-tabs-component branch 2 times, most recently from d24db23 to 57588d6 Compare March 26, 2025 20:11
@anicioalexandre anicioalexandre changed the title BA-2391-rn-create-tabs-component BA-2391: create native tabs component Mar 26, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/design-system/components/native/tabs/Tab/styles.ts (1)

5-11: Consider adding more styling properties to the tab component.

The style currently only defines a bottom border for selected tabs. Consider adding additional styling properties like padding, alignment, width/height, and possibly text color changes based on selection state for a more complete and visually consistent tab component.

export const createStyles = (theme: Theme, isSelected: boolean) =>
  StyleSheet.create({
    baseTabContainer: {
      borderBottomColor: theme.colors.object.low,
      borderBottomWidth: isSelected ? 2 : 0,
+     paddingVertical: 8,
+     paddingHorizontal: 16,
+     alignItems: 'center',
+     justifyContent: 'center',
    },
  })
packages/design-system/components/native/tabs/Tabs/context.tsx (1)

7-10: Add error handling to the context hook.

The TabsContext is implemented correctly, but consider adding error handling to the useTabsContext hook to ensure it's used within a TabsContext.Provider.

export const TabsContext = createContext<TabsContextValue>({
  currentValue: '',
  onChange: () => {},
})

-export const useTabsContext = () => useContext(TabsContext)
+export const useTabsContext = () => {
+  const context = useContext(TabsContext)
+  if (context === undefined) {
+    throw new Error('useTabsContext must be used within a TabsProvider')
+  }
+  return context
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ecc94f3 and d0f4d37.

⛔ Files ignored due to path filters (2)
  • packages/components/__generated__/ActivityLogsFragment.graphql.ts is excluded by !**/__generated__/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • packages/components/CHANGELOG.md (1 hunks)
  • packages/components/package.json (1 hunks)
  • packages/design-system/CHANGELOG.md (1 hunks)
  • packages/design-system/components/native/tabs/Tab/index.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tab/styles.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tab/types.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/context.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/index.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/styles.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/types.ts (1 hunks)
  • packages/design-system/components/native/tabs/index.ts (1 hunks)
  • packages/design-system/package.json (1 hunks)
  • packages/wagtail/CHANGELOG.md (1 hunks)
  • packages/wagtail/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • packages/components/CHANGELOG.md
  • packages/wagtail/package.json
  • packages/components/package.json
  • packages/design-system/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/design-system/components/native/tabs/Tab/types.ts
  • packages/design-system/components/native/tabs/Tabs/styles.ts
  • packages/design-system/components/native/tabs/index.ts
🧰 Additional context used
🧬 Code Definitions (3)
packages/design-system/components/native/tabs/Tabs/context.tsx (1)
packages/design-system/components/native/tabs/Tabs/types.ts (1)
  • TabsContextValue (12-15)
packages/design-system/components/native/tabs/Tabs/types.ts (1)
packages/design-system/components/native/tabs/Tab/types.ts (1)
  • TabProps (3-8)
packages/design-system/components/native/tabs/Tab/index.tsx (3)
packages/design-system/components/native/tabs/Tab/types.ts (1)
  • TabProps (3-8)
packages/design-system/components/native/tabs/Tabs/context.tsx (1)
  • useTabsContext (12-12)
packages/design-system/components/native/tabs/Tab/styles.ts (1)
  • createStyles (5-11)
🔇 Additional comments (6)
packages/design-system/CHANGELOG.md (1)

3-8: Documentation of new Tabs component looks good.

The changelog entry properly documents the addition of custom Tabs Components to the design system as a patch change in version 1.0.10.

packages/wagtail/CHANGELOG.md (1)

3-8: Dependency update is properly documented.

The changelog correctly documents updating the design-system dependency to version 1.0.10, which contains the new tabs components.

packages/design-system/components/native/tabs/Tabs/types.ts (1)

1-15: Well-structured type definitions with proper typing.

The types are well-defined and follow best practices. The TabsProps interface appropriately extends ViewProps and properly types the tab components' children as ReactElement<TabProps>[]. The TabsContextValue type clearly defines the shape of the context value needed for tabs state management.

packages/design-system/components/native/tabs/Tabs/index.tsx (1)

9-21: Good implementation using context for state sharing.

The implementation follows best practices by:

  1. Using context for state sharing (as advised in previous comments)
  2. Memoizing the context value to optimize performance
  3. Properly handling styles by merging base styles with custom styles
  4. Following a clean component structure

This approach is preferable to using cloneElement which can impact performance with multiple children.

packages/design-system/components/native/tabs/Tab/index.tsx (2)

11-26: Component name is now correct and implementation is solid.

The component has been properly renamed from "Tabs" to "Tab" as noted in previous comments. The implementation follows best practices by:

  1. Using the context hook to access shared state
  2. Determining selection state by comparing values
  3. Applying appropriate styles based on selection state
  4. Providing sensible defaults for color props

The component correctly renders a button that triggers the tab change and visually indicates the current selection state.


28-28: Default export now matches component name.

The export has been properly updated to match the "Tab" component name, resolving the issue mentioned in previous reviews.

@Ronan-Fernandes Ronan-Fernandes force-pushed the BA-2391-rn-create-tabs-component branch from d0f4d37 to bf3d044 Compare March 27, 2025 13:28
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/design-system/components/native/tabs/Tab/index.tsx (1)

11-26: Tab component implementation looks good with a few suggestions for improvement.

The implementation correctly renders a tab with different styling based on selection state. I have a few suggestions for improvement:

  1. Consider adding accessibility props to improve screen reader support:
  <View style={styles.baseTabContainer}>
-    <Button mode="text" onPress={() => onChange(value)}>
+    <Button 
+      mode="text" 
+      onPress={() => onChange(value)}
+      accessibilityRole="tab"
+      accessibilityState={{ selected: isSelected }}
+    >
      <Text variant="subtitle2" color={isSelected ? selectedColor : unselectedColor}>
        {label}
      </Text>
    </Button>
  </View>
  1. You might want to add a visual indicator for the currently selected tab that doesn't rely solely on color, to improve accessibility for users with color vision deficiencies.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0f4d37 and bf3d044.

⛔ Files ignored due to path filters (2)
  • packages/components/__generated__/ActivityLogsFragment.graphql.ts is excluded by !**/__generated__/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • packages/design-system/CHANGELOG.md (1 hunks)
  • packages/design-system/components/native/tabs/Tab/index.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tab/styles.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tab/types.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/context.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/index.tsx (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/styles.ts (1 hunks)
  • packages/design-system/components/native/tabs/Tabs/types.ts (1 hunks)
  • packages/design-system/components/native/tabs/index.ts (1 hunks)
  • packages/design-system/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • packages/design-system/CHANGELOG.md
  • packages/design-system/package.json
  • packages/design-system/components/native/tabs/Tabs/styles.ts
  • packages/design-system/components/native/tabs/Tab/types.ts
  • packages/design-system/components/native/tabs/Tabs/context.tsx
  • packages/design-system/components/native/tabs/Tab/styles.ts
  • packages/design-system/components/native/tabs/index.ts
  • packages/design-system/components/native/tabs/Tabs/index.tsx
  • packages/design-system/components/native/tabs/Tabs/types.ts
🧰 Additional context used
🧬 Code Definitions (1)
packages/design-system/components/native/tabs/Tab/index.tsx (3)
packages/design-system/components/native/tabs/Tab/types.ts (1)
  • TabProps (3-8)
packages/design-system/components/native/tabs/Tabs/context.tsx (1)
  • useTabsContext (12-12)
packages/design-system/components/native/tabs/Tab/styles.ts (1)
  • createStyles (5-11)
🔇 Additional comments (2)
packages/design-system/components/native/tabs/Tab/index.tsx (2)

1-9: Component imports are well-organized.

Good practice to separate React imports, design system components, and local imports into different groups.


28-28: Export naming has been corrected.

The component name and export now correctly match as Tab, which is appropriate for a component representing a single tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changes PR was reviewed, and changes are required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants