Skip to content

Conversation

@HadiaRafiq
Copy link
Contributor

@HadiaRafiq HadiaRafiq commented Aug 16, 2025

Motivation

The spacing object was added to the theme to provide a standardized and scalable way to manage layout spacing (such as padding, margin, and gaps) across the app. Hardcoding pixel values often leads to inconsistent UI and makes global updates difficult. By centralizing spacing in the theme, we enable consistent styling, easier maintenance, and better alignment with design systems.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Jest Unit Test
  • Checked with example app

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation using yarn docs-build-api
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional context

@theianmay theianmay self-assigned this Oct 22, 2025
@theianmay
Copy link
Member

theianmay commented Oct 22, 2025

Hello @HadiaRafiq - thank you for the PR! I am a new contributor and am working to review and merge your PR. I found a few issues that need to be addressed:

1. Syntax Error

interface Spacing: { // ❌ Remove the colon

Should be:

interface Spacing {

2. Incorrect Default Values

The examples don't match the actual defaults in the codebase. According to packages/base/src/helpers/index.tsx, the defaults are:
{ xs: 2, sm: 4, md: 8, lg: 12, xl: 24 }
Not
{ xs: 4, sm: 8, md: 16, lg: 24, xl: 32 }

3. Interface Naming

For consistency with the source code and the Colors section pattern, consider using ThemeSpacing instead of Spacing since that's the actual type name exported from @rneui/base/dist/helpers.

Could you update the PR to fix the syntax error and use the correct default values & naming?

EDIT: Made changes myself, will merge

@codecov
Copy link

codecov bot commented Nov 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.29%. Comparing base (302fa52) to head (a08a24d).
⚠️ Report is 6 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3986   +/-   ##
=======================================
  Coverage   79.29%   79.29%           
=======================================
  Files          90       90           
  Lines        2144     2144           
  Branches      946      959   +13     
=======================================
  Hits         1700     1700           
  Misses        442      442           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@theianmay theianmay merged commit 2bb746b into react-native-elements:next Nov 15, 2025
9 checks passed
github-actions bot pushed a commit to SimenB/react-native-elements that referenced this pull request Nov 15, 2025
github-actions bot pushed a commit to SimenB/react-native-elements that referenced this pull request Nov 15, 2025
@theianmay theianmay added this to the v5.0.0 milestone Nov 16, 2025
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Closed or Merged 🏁 in Community Roadmap 🛣 Nov 16, 2025
@github-project-automation github-project-automation bot moved this to In Progress 🚧 in Community Roadmap 🛣 Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Closed or Merged 🏁

Development

Successfully merging this pull request may close these issues.

2 participants