From 8f2eba0f4f2a18807681203d5108c92d315e6aef Mon Sep 17 00:00:00 2001 From: Oleg Pecherin Date: Mon, 24 Jan 2022 14:07:01 +0300 Subject: [PATCH] add sectionIndexColor property --- README.md | 1 + RNTableView/RNTableView.h | 1 + RNTableView/RNTableView.m | 1 + RNTableView/RNTableViewManager.m | 1 + src/TableView.js | 2 ++ src/index.d.ts | 1 + 6 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 3eeae82..bfe2e7c 100755 --- a/README.md +++ b/README.md @@ -403,6 +403,7 @@ Colors: - `selectedTextColor` - `detailTextColor` - `separatorColor` +- `sectionIndexColor` - `headerTextColor` - `headerBackgroundColor` - `footerTextColor` diff --git a/RNTableView/RNTableView.h b/RNTableView/RNTableView.h index efe5048..5fb7ab6 100644 --- a/RNTableView/RNTableView.h +++ b/RNTableView/RNTableView.h @@ -70,6 +70,7 @@ @property(nonatomic, strong) UIColor *selectedBackgroundColor; @property(nonatomic, strong) UIColor *detailTextColor; @property(nonatomic, strong) UIColor *separatorColor; +@property(nonatomic, strong) UIColor *sectionIndexColor; @property(nonatomic) BOOL autoFocus; @property(nonatomic) BOOL autoFocusAnimate; @property(nonatomic) BOOL allowsToggle; diff --git a/RNTableView/RNTableView.m b/RNTableView/RNTableView.m index c728382..5da8535 100644 --- a/RNTableView/RNTableView.m +++ b/RNTableView/RNTableView.m @@ -229,6 +229,7 @@ - (void)createTableView { _tableView.tableFooterView = view; _tableView.separatorStyle = self.separatorStyle; _tableView.separatorColor = self.separatorColor; + _tableView.sectionIndexColor = self.sectionIndexColor; _tableView.scrollEnabled = self.scrollEnabled; _tableView.editing = self.editing; _reactModuleCellReuseIndentifier = @"ReactModuleCell"; diff --git a/RNTableView/RNTableViewManager.m b/RNTableView/RNTableViewManager.m index 9f8ed41..6caf41a 100644 --- a/RNTableView/RNTableViewManager.m +++ b/RNTableView/RNTableViewManager.m @@ -61,6 +61,7 @@ - (NSArray *)customDirectEventTypes RCT_EXPORT_VIEW_PROPERTY(headerBackgroundColor, UIColor) RCT_EXPORT_VIEW_PROPERTY(footerTextColor, UIColor) RCT_EXPORT_VIEW_PROPERTY(separatorColor, UIColor) +RCT_EXPORT_VIEW_PROPERTY(sectionIndexColor, UIColor) RCT_EXPORT_VIEW_PROPERTY(moveWithinSectionOnly, BOOL) RCT_EXPORT_VIEW_PROPERTY(allowsToggle, BOOL) RCT_EXPORT_VIEW_PROPERTY(allowsMultipleSelection, BOOL) diff --git a/src/TableView.js b/src/TableView.js index 67bc0cb..2acf0f5 100644 --- a/src/TableView.js +++ b/src/TableView.js @@ -149,6 +149,7 @@ class TableView extends React.Component { footerFontStyle: FontStyle, footerFontFamily: PropTypes.string, separatorColor: PropTypes.string, + sectionIndexColor: PropTypes.string, separatorStyle: PropTypes.number, scrollEnabled: PropTypes.bool, sectionIndexTitlesEnabled: PropTypes.bool, @@ -228,6 +229,7 @@ class TableView extends React.Component { headerTextColor: null, footerTextColor: null, separatorColor: null, + sectionIndexColor: null, onChange: () => null, onScroll: () => null, onPress: () => null, diff --git a/src/index.d.ts b/src/index.d.ts index 0851e6c..a659084 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -268,6 +268,7 @@ export interface TableViewProps { headerBackgroundColor?: string; footerTextColor?: string; separatorColor?: string; + sectionIndexColor?: string; fontSize?: number; fontWeight?: FontWeight; fontStyle?: FontStyle;