File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -187,30 +187,34 @@ export default function App(): React.JSX.Element {
187187 thumbnails = { ThumbnailItems }
188188 toggle = { func => ( toggleRef . current = func ) }
189189 onSelect = { item => setSelected ( item ) }
190+ activeColor = { color . red }
190191 />
191192 </ SafeAreaView >
192193 ) ;
193194}
194195
196+ const color = {
197+ black : 'black' ,
198+ red : 'red' ,
199+ whitesmoke : 'whitesmoke' ,
200+ }
201+
195202const styles = StyleSheet . create ( {
196- // eslint-disable-next-line react-native/no-color-literals
197203 button : {
198- backgroundColor : ' black' ,
204+ backgroundColor : color . black ,
199205 borderRadius : 6 ,
200206 borderWidth : 1 ,
201207 margin : 16 ,
202208 padding : 16 ,
203209 } ,
204- // eslint-disable-next-line react-native/no-color-literals
205210 buttonText : {
206- color : ' whitesmoke' ,
211+ color : color . whitesmoke ,
207212 fontSize : 18 ,
208213 fontWeight : 'bold' ,
209214 textAlign : 'center' ,
210215 } ,
211- // eslint-disable-next-line react-native/no-color-literals
212216 safeAreaView : {
213- backgroundColor : ' whitesmoke' ,
217+ backgroundColor : color . whitesmoke ,
214218 flex : 1 ,
215219 } ,
216220} ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Button } from 'react-native';
44// Step 1: Import ThumbnailSelector.
55import ThumbnailSelector from 'react-native-thumbnail-selector' ;
66
7- // Step 2: Define one or more thumbnails.
7+ // Step 2: Define one or more thumbnails like below .
88const Thumbnails = [
99 {
1010 caption : 'Caption 1' ,
@@ -22,9 +22,10 @@ export default function App(): React.JSX.Element {
2222
2323 return (
2424 < >
25- { /* Step 4: Depending on your use case, use toggleRef to open and close ThumbnailSelector. */ }
25+ { /* Step 4: Depending on your use case, use toggleRef to open and close the ThumbnailSelector. */ }
2626 < Button title = { 'Toggle' } onPress = { ( ) => toggleRef . current ( ) } />
27- { /* Step 5: Add ThumbnailSelector at last position in document tree so it overlaps other elements. */ }
27+ { /* Step 5: Add ThumbnailSelector at last position in document tree so it overlaps other components. */ }
28+ { /* Step 6: Define the thumbnails and toggle props like below. */ }
2829 < ThumbnailSelector
2930 thumbnails = { Thumbnails }
3031 toggle = { func => ( toggleRef . current = func ) }
You can’t perform that action at this time.
0 commit comments