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

fix: Fixed Buttons for Certain cases #1127

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Conversation

alexrisch
Copy link
Collaborator

@alexrisch alexrisch commented Oct 28, 2024

Removed deprecated uses
Updated props
Fixed navigation to pop to top

Fixes #1126
Fixes #1123

Simulator Screenshot - iPhone 15 - 2024-10-28 at 17 23 34
Simulator Screenshot - iPhone 15 - 2024-10-28 at 17 13 13
Simulator Screenshot - iPhone 15 - 2024-10-28 at 17 05 50
Simulator Screenshot - iPhone 15 - 2024-10-28 at 16 59 03
Simulator Screenshot - iPhone 15 - 2024-10-28 at 16 58 48

Summary by CodeRabbit

  • New Features

    • Updated button components across various chat-related screens to align with the centralized design system.
    • Added new translation keys to enhance user interface options for managing chat history and accounts.
  • Bug Fixes

    • Improved localization for UI elements in the Profile screen, ensuring proper translations are displayed.
  • Chores

    • Streamlined button usage in components for consistency and maintainability.

Removed deprecated uses
Updated props
Fixed navigation to pop to top
@alexrisch alexrisch requested a review from a team as a code owner October 28, 2024 21:27
Copy link
Contributor

coderabbitai bot commented Oct 28, 2024

Walkthrough

The changes introduced in this pull request primarily focus on updating several components to utilize a centralized design system for UI elements, specifically the Button component. Modifications include changing import paths, updating button properties such as title to text, and adjusting the variant property for consistency with the design system. The overall structure and logic of the components remain largely intact, with no significant alterations to the control flow or functionality.

Changes

File Path Change Summary
components/Chat/ChatPlaceholder/ChatPlaceholder.tsx Updated import of Button from design system, changed variant from secondary to fill, replaced title with text.
components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx Updated import of Button from design system, changed variant from outline to fill, replaced title with text.
components/Chat/ConsentPopup/ConsentPopup.tsx Updated import of Button from design system, modified button properties including variant and replaced title with text.
components/Chat/ConsentPopup/GroupConsentPopup.tsx Updated import of Button from design system, changed variant from secondary to fill, replaced title with text.
design-system/Button/Button.props.ts Updated deprecation comment for title property to indicate usage of text instead.
i18n/translations/en.ts Added new translation keys: view_removed_chats and change_or_add_account.
screens/NewConversation/NewConversation.tsx Replaced ConverseButton with Button from design system, updated button properties to use text.
screens/Profile.tsx Updated titles to use translate function and added navigation action for "View removed chats".

Possibly related PRs

Suggested labels

2.0.7

Suggested reviewers

  • thierryskoda

Poem

🐰 In the meadow where buttons gleam,
A design system reigns supreme.
With text and fill, we hop along,
Making interfaces bright and strong.
From chat to consent, we take our flight,
Crafting a UI that's pure delight! 🌼


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?

❤️ Share
🪧 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 resolve resolve all the CodeRabbit review comments.
  • @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.

Copy link
Contributor

Performance Comparison Report

  • Current: 3bfa536 - 2024-10-28 21:30:43Z
  • Baseline: release/2.0.8 (4745a3a) - 2024-10-28 21:30:05Z

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Type Duration Count
Avatar Image 10 runs render 1.1 ms → 1.1 ms 1 → 1
Avatar Image 50 runs render 1.1 ms → 1.0 ms (-0.0 ms, -3.7%) 1 → 1
Empty Avatar 10 runs render 1.0 ms → 0.9 ms (-0.1 ms, -10.0%) 1 → 1
Empty Avatar 50 runs render 0.7 ms → 0.8 ms (+0.0 ms, +5.6%) 1 → 1
Show details
Name Type Duration Count
Avatar Image 10 runs render Baseline
Mean: 1.1 ms
Stdev: 0.3 ms (28.7%)
Runs: 1 1 1 1 1 1 1 2 1 1
Warmup runs: 2

Current
Mean: 1.1 ms
Stdev: 0.3 ms (28.7%)
Runs: 1 1 1 1 1 2 1 1 1 1
Warmup runs: 2
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:
Avatar Image 50 runs render Baseline
Mean: 1.1 ms
Stdev: 0.3 ms (31.5%)
Runs: 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1
Warmup runs: 1

Current
Mean: 1.0 ms
Stdev: 0.3 ms (27.2%)
Runs: 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 0 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
Warmup runs: 1
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:
Empty Avatar 10 runs render Baseline
Mean: 1.0 ms
Stdev: 0.0 ms (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Warmup runs: 71

Current
Mean: 0.9 ms
Stdev: 0.3 ms (35.1%)
Runs: 1 1 1 1 0 1 1 1 1 1
Warmup runs: 8
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1
Render issues:
Empty Avatar 50 runs render Baseline
Mean: 0.7 ms
Stdev: 0.5 ms (63.0%)
Runs: 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0 1 0 0 1 1 0 1 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0
Warmup runs: 1

Current
Mean: 0.8 ms
Stdev: 0.4 ms (56.8%)
Runs: 1 1 1 1 1 1 0 1 1 1 0 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 0 1 1 1 0 1
Warmup runs: 1
Baseline
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:

Current
Mean: 1
Stdev: 0 (0.0%)
Runs: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Render issues:

Render Count Changes

There are no entries

Render Issues

There are no entries

Added Scenarios

There are no entries

Removed Scenarios

There are no entries

Generated by 🚫 dangerJS against 31e20a7

Copy link
Contributor

@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

🧹 Outside diff range and nitpick comments (9)
design-system/Button/Button.props.ts (1)

Line range hint 13-21: Consider cleaning up deprecated button variants.

The IButtonVariant type includes a deprecated secondary variant. Since you're already working on standardizing button usage, consider planning the removal of deprecated variants to maintain a cleaner design system.

Consider:

  1. Documenting the preferred alternatives for deprecated variants
  2. Creating a migration plan for removing deprecated variants
  3. Updating the design system documentation to reflect these changes
components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx (1)

1-1: Good architectural improvement!

The migration to use the centralized design system Button component improves maintainability and ensures UI consistency across the application.

components/Chat/ConsentPopup/ConsentPopup.tsx (1)

91-93: LGTM: Improved action hierarchy

The button changes appropriately emphasize the accept action with the 'fill' variant, creating better visual hierarchy between the actions.

The visual hierarchy now better reflects the positive action as primary, which is a good UX practice for consent flows.

components/Chat/ConsentPopup/GroupConsentPopup.tsx (1)

Line range hint 31-33: Enhance error message specificity

The error message could be more descriptive by including the missing requirements:

-    throw new Error("This component should only be used for group chats");
+    throw new Error(
+      "GroupConsentPopup requires a group chat with a valid topic and current account"
+    );
i18n/translations/en.ts (1)

313-315: Consider adding error state translations.

While the new translation keys for viewing removed chats look good, consider adding corresponding error state messages that might be needed when:

  • No removed chats are available to view
  • There's an error loading removed chats

Example additions:

  view_removed_chats: "View removed chats",
+ view_removed_chats_empty: "No removed chats to display",
+ view_removed_chats_error: "Unable to load removed chats",
screens/NewConversation/NewConversation.tsx (3)

112-117: Consider standardizing button margin handling

The negative margin (marginRight: -10) used to adjust button positioning could lead to inconsistent spacing across different screen sizes or when the design system spacing tokens change.

Consider using the design system's spacing tokens or adjusting the parent container's padding instead:

-                style={{ marginRight: -10, padding: 10 }}
+                style={{ padding: 10 }}

544-544: Remove commented code

The commented height property suggests uncertainty about platform-specific styling. Either remove it or document why it might be needed in the future.

-      // height: Platform.OS === "ios" ? 30 : undefined,

Based on the script results, I can generate the final response as we have sufficient information to verify the button migration status.

Migration to design system Button is incomplete

There are still instances of the old ConverseButton component in screens/TopUp.tsx that need to be migrated to the new design system Button. Additionally, there are some inconsistencies in button props:

  • Some buttons use title prop while others use text prop
  • Found in NewConversationModal.tsx and NewGroupSummary.tsx
🔗 Analysis chain

Line range hint 1-565: Verify complete migration to design system Button

Let's ensure all button instances have been migrated to the new design system component.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of ConverseButton
rg "ConverseButton"

# Verify consistent usage of Button props
rg -A 2 "Button.*variant"

Length of output: 6066

screens/Profile.tsx (1)

Line range hint 733-762: Consider enhancing notification permission error handling

The notification permission request flow could benefit from more robust error handling and user feedback. Consider extracting this logic into a dedicated hook or utility function that provides:

  1. Centralized error handling
  2. Clear user feedback for failed permission requests
  3. Consistent behavior across platforms

Example implementation:

// hooks/useNotificationPermissions.ts
export const useNotificationPermissions = () => {
  const requestPermissions = async (): Promise<{status: NotificationPermissionStatus; error?: Error}> => {
    try {
      if (Platform.OS === 'android') {
        const status = await requestPushNotificationsPermissions();
        if (status === 'denied') {
          return { status, error: new Error('Permissions denied') };
        }
        return { status };
      }
      // iOS implementation
      const status = await requestPushNotificationsPermissions();
      return { status };
    } catch (error) {
      return { status: 'denied', error: error as Error };
    }
  };
  
  return { requestPermissions };
};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4745a3a and 31e20a7.

📒 Files selected for processing (8)
  • components/Chat/ChatPlaceholder/ChatPlaceholder.tsx (3 hunks)
  • components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx (2 hunks)
  • components/Chat/ConsentPopup/ConsentPopup.tsx (3 hunks)
  • components/Chat/ConsentPopup/GroupConsentPopup.tsx (2 hunks)
  • design-system/Button/Button.props.ts (1 hunks)
  • i18n/translations/en.ts (1 hunks)
  • screens/NewConversation/NewConversation.tsx (6 hunks)
  • screens/Profile.tsx (3 hunks)
🔇 Additional comments (14)
design-system/Button/Button.props.ts (1)

Line range hint 1-109: Well-structured Button interface with comprehensive prop definitions.

The IButtonProps interface is well-designed with:

  • Clear TypeScript types and documentation
  • Proper extension of React Native's PressableProps
  • Comprehensive set of styling options
  • Good support for accessibility through proper prop types
components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx (1)

96-98: Verify design system Button props usage

The Button props look appropriate for a primary action, but let's ensure consistent usage across similar contexts.

✅ Verification successful

Let me gather more information to verify the Button usage consistency specifically in chat-related components.


Let me check one more specific pattern to see how primary action buttons are implemented in chat components.


Button props usage is consistent with design system patterns

The verification shows that the Button props are correctly implemented and consistent across chat placeholders and similar contexts:

  • Both ChatPlaceholder and GroupChatPlaceholder use variant="fill" for primary actions
  • The "Say hi" action consistently uses picto="hand.wave" in placeholder components
  • Primary actions in consent popups and other important interactions also use variant="fill"
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other Button usages in chat placeholders to verify consistency
ast-grep --pattern 'Button $$$variant="fill"$$$'

# Check for any remaining old button variants that might need updating
rg -A 2 'variant="outline"'

Length of output: 757


Script:

#!/bin/bash
# Search for Button components in chat-related files
rg -l "Button" components/Chat/

# Check specific Button usage patterns in chat components
ast-grep --pattern 'Button
  $$$
  variant=$_
  $$$
'

# Look for any say_hi related components
rg -A 3 "say_hi"

Length of output: 1631


Script:

#!/bin/bash
# Look for Button components with variant prop in Chat components
rg -A 2 'variant=' components/Chat/

# Check for other primary action buttons in placeholders
rg -A 3 'Button.*variant.*placeholder' -i

Length of output: 1818

components/Chat/ConsentPopup/ConsentPopup.tsx (2)

1-1: LGTM: Design system migration

The Button import has been correctly updated to use the centralized design system.


62-65: Verify design system button props combination

The button props have been updated to use the new design system pattern. Please verify that this combination of variant="text" with action="danger" is documented and produces the intended visual state.

Consider documenting these button variant combinations in the design system if not already done, to help other developers understand the available options.

components/Chat/ConsentPopup/GroupConsentPopup.tsx (2)

2-2: LGTM: Design system migration

The Button import has been correctly updated to use the centralized design system.


95-96: Verify the button hierarchy for consent actions

The prop updates from title to text align with the design system. However, changing the "Join" button variant from "secondary" to "fill" might affect the visual hierarchy of these critical consent actions.

Let's verify if this variant change is consistent with other consent-related UIs:

Also applies to: 100-102

✅ Verification successful

Let's try a broader search to understand the consent-related UI patterns and button hierarchy in the codebase. The previous command had issues with file type recognition, so I've adjusted the search parameters.


Button hierarchy is consistent with consent UI patterns

The button variant changes are consistent with the consent UI patterns in the codebase. Looking at both GroupConsentPopup.tsx and ConsentPopup.tsx, they follow the same pattern:

  • Decline/Block actions use variant="text"
  • Accept/Join actions use variant="fill" with a checkmark picto

This hierarchy appropriately emphasizes the positive action (join/accept) while making the negative action (decline/block) less prominent but still accessible.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other consent-related Button components to verify variant consistency
rg -U --type tsx --type jsx 'Button.*variant.*consent' -B 2 -A 2

# Search for similar action pairs (decline/accept) to verify button hierarchy
ast-grep --pattern 'Button.*variant=(\"text\"|\"fill\")'

Length of output: 153


Script:

#!/bin/bash
# Search for other consent-related UI components
rg -t ts -t tsx -t jsx "consent" -B 3 -A 3

# Search for Button components with variant props in TypeScript/React files
rg -t ts -t tsx -t jsx "Button.*variant" -B 2 -A 2

# Search specifically in the ConsentPopup directory
fd . -e tsx -e ts -e jsx "components/Chat/ConsentPopup" --exec cat {}

Length of output: 8932

components/Chat/ChatPlaceholder/ChatPlaceholder.tsx (3)

1-1: LGTM: Design system import aligns with standardization effort

The updated import path properly utilizes the centralized design system, which promotes consistency across the application.


127-129: Verify emoji consistency across greeting actions

The "Say hi" button sends a wave emoji (👋). Let's ensure this is consistent with other greeting actions across the app.

#!/bin/bash
# Search for other greeting-related code to verify emoji consistency
rg -A 3 'Say hi|sendMessage.*wave|👋'

81-83: Verify visual hierarchy for unblock action

While the updated button props align with the design system, please verify that the "fill" variant provides sufficient visual emphasis for this important user action. Consider if this critical function should use a different variant to stand out in the UI.

✅ Verification successful

The previous search didn't yield relevant results, so I'm broadening the search to:

  1. Understand how "fill" variant buttons are used in the design system
  2. Find all block/unblock related UI patterns for consistency check

Let's try these modified searches to:

  1. Find Button usage patterns without file type restriction
  2. Look for block/unblock patterns specifically in components
  3. Examine the immediate context of the Button usage in ChatPlaceholder

The "fill" variant is appropriate for the unblock action

Based on the codebase analysis:

  1. The "fill" variant is consistently used for primary actions in the app, including the companion "Say hi" button in the same component
  2. The unblock action is protected by an action sheet confirmation dialog that requires explicit user confirmation
  3. The button appears in a clear context with explanatory text "This user is blocked" above it
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other unblock actions in the codebase to verify consistent styling
rg -l 'Unblock' | xargs rg 'variant.*fill'

Length of output: 2209


Script:

#!/bin/bash
# Search for Button components with variant="fill" to understand design system patterns
rg -A 2 'Button.*variant="fill"'

# Search specifically for unblock-related UI elements
rg -A 3 -i 'unblock|block' --type tsx

Length of output: 464


Script:

#!/bin/bash
# Search for Button components with variant="fill" in all files
rg -A 2 'Button.*variant="fill"'

# Search for block/unblock patterns in all files
rg -A 3 -i 'unblock|block' components/

# Look for Button component usage patterns in the ChatPlaceholder component
rg -A 5 'Button' components/Chat/ChatPlaceholder/ChatPlaceholder.tsx

Length of output: 17533

i18n/translations/en.ts (1)

315-316: LGTM! Translation key follows conventions.

The change_or_add_account translation key follows the established naming pattern and its value uses consistent capitalization.

screens/NewConversation/NewConversation.tsx (2)

1-1: LGTM: Clean import of design system Button component

The import statement correctly references the design system Button component, aligning with the PR objective to standardize button usage.


Line range hint 354-365: LGTM: Proper implementation of group member buttons

The button implementation correctly uses the design system's variants and props for consistent styling.

screens/Profile.tsx (2)

710-712: LGTM: Navigation flow improvement

The addition of navigation.popToTop() before navigating to the "Blocked" screen is a good improvement. This ensures a clean navigation stack and prevents potential navigation state issues.


Line range hint 722-733: LGTM: Improved internationalization

The updates to use the translate function for button titles enhance the app's internationalization capabilities. This change aligns well with maintaining a consistent localization approach throughout the application.

Comment on lines +110 to 112
/** @deprecated - use text instead */
title?: string;
/** @deprecated */
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Migration to text prop is incomplete - action required

Several components are still using the deprecated title prop:

  • screens/NewConversation/NewGroupSummary.tsx
  • screens/NewConversation/NewConversationModal.tsx
  • Multiple instances in components/__tests__/Button.test.tsx

While the new text prop is being adopted in some components:

  • screens/NewConversation/NewConversation.tsx
  • design-system/BottomSheet/BottomSheetModalDemo.tsx

The migration is in progress but needs to be completed for consistency. Please update the remaining instances to use the text prop instead of the deprecated title prop.

🔗 Analysis chain

LGTM! Clear deprecation notice.

The deprecation notice for the title prop is clear and provides the correct alternative (text). This aligns well with the ongoing migration to standardize button properties across the application.

Let's verify the migration progress to ensure consistency:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the usage of deprecated 'title' prop vs recommended 'text' prop in Button components

# Search for remaining uses of the deprecated 'title' prop
echo "Checking for remaining uses of deprecated 'title' prop:"
rg -A 1 '<Button[^>]*title=' 

# Search for uses of the recommended 'text' prop
echo -e "\nChecking for uses of recommended 'text' prop:"
rg -A 1 '<Button[^>]*text='

Length of output: 1564

Comment on lines +337 to 343
<Button
variant="text"
picto="person.2"
title="New group"
text="New group"
style={styles.newGroupButton}
onPress={() => {
setGroup({ enabled: true, members: [] });
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider abstracting platform-specific styling

The button uses inline platform-specific padding which could be moved to the styles object for better maintainability.

Consider refactoring to use a dedicated style:

-            style={styles.newGroupButton}
+            style={styles.newGroupButton}

And in the styles object:

newGroupButton: {
  marginLeft: 7,
  paddingVertical: Platform.select({
    ios: 13,
    android: 10
  })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants