Skip to content

add separatorBackgroundColor to Section #785

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ It's possible to use the `Flatlist` component instead ([Example](#render-with-fl
| separatorInsetLeft | `15` | `number` | Left inset of separator |
| separatorInsetRight | `0` | `number` | Right inset of separator |
| separatorTintColor | `#C8C7CC` | `string` | Color of separator |
| separatorBackgroundColor | `#FFF` | `string` | Background color of separator |
| withSafeAreaView | `true / false (on iOS <= 10)` | `bool` | Render section header and footer with SafeAreaView |

### `Cell`
Expand Down
3 changes: 2 additions & 1 deletion src/components/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
separatorInsetLeft = 15,
separatorInsetRight = 0,
separatorTintColor,
separatorBackgroundColor,

Check failure on line 59 in src/components/Section.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'separatorBackgroundColor' is missing in props validation
withSafeAreaView = Platform.OS === 'ios'
? parseInt(`${Platform.Version}`, 10) <= 10
? false
Expand Down Expand Up @@ -156,7 +157,7 @@
{React.cloneElement(child, propsToAdd)}
<Separator
isHidden={invisibleSeparator}
backgroundColor={childProps?.backgroundColor}
backgroundColor={separatorBackgroundColor || childProps?.backgroundColor}

Check failure on line 160 in src/components/Section.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `separatorBackgroundColor·||·childProps?.backgroundColor` with `⏎············separatorBackgroundColor·||·childProps?.backgroundColor⏎··········`

Check failure on line 160 in src/components/Section.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

Unsafe assignment of an `any` value
tintColor={separatorTintColor}
insetLeft={separatorInsetLeftSupportImage}
insetRight={separatorInsetRight}
Expand Down
Loading