Skip to content

Commit 0fd445a

Browse files
Fixing TouchableHighlight page (#646)
1 parent eae3915 commit 0fd445a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

NewArch/src/examples/TouchableHighlightExamplePage.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import React, {useState} from 'react';
44
import {Example} from '../components/Example';
55
import {Page} from '../components/Page';
66
import {useTheme} from '../Navigation';
7+
import {usePageFocusManagement} from '../hooks/usePageFocusManagement';
78

8-
export const TouchableHighlightExamplePage: React.FunctionComponent<{}> =
9-
() => {
9+
export const TouchableHighlightExamplePage: React.FunctionComponent<{navigation?: any}> =
10+
({navigation}) => {
11+
const firstTouchableHighlightRef = usePageFocusManagement(navigation);
1012
const [title, setTitle] = useState(0);
1113
const {colors} = useTheme();
1214

@@ -77,6 +79,7 @@ export const TouchableHighlightExamplePage: React.FunctionComponent<{}> =
7779
]}>
7880
<Example title="A simple TouchableHighlight." code={example1jsx}>
7981
<TouchableHighlight
82+
ref={firstTouchableHighlightRef}
8083
accessibilityRole="button"
8184
accessibilityLabel={'example TouchableHighlight'}
8285
style={{
@@ -122,7 +125,7 @@ export const TouchableHighlightExamplePage: React.FunctionComponent<{}> =
122125
accessibilityValue={{text: `${title}`}}
123126
style={{
124127
height: 40,
125-
backgroundColor: PlatformColor(TextFillColorPrimary),
128+
backgroundColor: colors.text,
126129
borderRadius: 3,
127130
justifyContent: 'center',
128131
alignItems: 'center',
@@ -135,7 +138,7 @@ export const TouchableHighlightExamplePage: React.FunctionComponent<{}> =
135138
}}
136139
activeOpacity={0.2}
137140
underlayColor={'white'}>
138-
<Text style={{color: PlatformColor('TextFillColorPrimary')}}>{String(title)}</Text>
141+
<Text style={{color: 'white'}}>{String(title)}</Text>
139142
</TouchableHighlight>
140143
</Example>
141144
</Page>

0 commit comments

Comments
 (0)