AAO-React-Native icon indicating copy to clipboard operation
AAO-React-Native copied to clipboard

Replace platform-specific icon usage with platformPrefixIconName helper

Open Copilot opened this issue 5 months ago • 0 comments

This PR addresses the remaining items from issue #3461 by replacing all direct platform-specific icon usage with the centralized platformPrefixIconName helper function introduced in PR #3459.

Problem

Throughout the codebase, icons were being handled with direct platform checks like:

const iconName = Platform.OS === 'ios' ? 'ios-heart' : 'md-heart'

This pattern was repeated across multiple files, leading to code duplication and inconsistent icon handling.

Solution

Replaced all remaining platform-specific icon usage with calls to the platformPrefixIconName helper:

// Before
const iconName = Platform.OS === 'ios' ? 'ios-heart' : 'md-heart'

// After  
const iconName = platformPrefixIconName('heart')

Files Changed

Updated 10 files across the codebase:

  • Streaming radio components: Updated controller and button icons (planet, play, pause, bug, call, calendar)
  • Food menu components: Updated star icon for special items
  • Filter components: Updated chevron-down and close-circle icons
  • Navigation buttons: Updated search-outline, heart, and heart-outline icons
  • StoPrint components: Updated print and bug error icons
  • SIS components: Updated warning icon

Benefits

  • Centralized logic: All platform-specific icon resolution now happens in one place
  • Consistency: Uniform icon handling across the entire codebase
  • Maintainability: Future icon changes only need to be made in the helper function
  • Reduced duplication: Eliminates repetitive platform checks

The helper function intelligently chooses the correct icon variant based on platform availability, ensuring consistent behavior across iOS and Android while maintaining all existing functionality.

Closes #3461

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.sentry-cdn.com
    • Triggering command: node ./scripts/install.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Please look at @StoDevX/AAO-React-Native/issues/3461 and make sure that all platform-specific icons use the mentioned helper.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Sep 27 '25 01:09 Copilot