Skip to content

Commit 3df8094

Browse files
authored
Update ImageExample.js
1 parent 7aae0a8 commit 3df8094

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

packages/rn-tester/js/examples/Image/ImageExample.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const {
2020
Image,
2121
ImageBackground,
2222
StyleSheet,
23+
Switch,
2324
Text,
2425
View,
2526
} = require('react-native');
@@ -850,6 +851,10 @@ const styles = StyleSheet.create({
850851
experimental_boxShadow: '80px 0px 10px 0px hotpink',
851852
transform: 'rotate(-15deg)',
852853
},
854+
switch: {
855+
flexDirection: 'row',
856+
alignItems: 'center',
857+
},
853858
});
854859

855860
exports.displayName = (undefined: ?string);
@@ -1530,10 +1535,22 @@ exports.examples = [
15301535
{
15311536
title: 'Accessibility',
15321537
description:
1533-
('If the `accessible` (boolean) prop is set to True, the image will be indicated as an accessbility element.': string),
1538+
('If the `accessible` (boolean) prop is set to True, the image will be indicated as an accessbility element. If the `accessible` (boolean) prop is set to False, the image will not be indicated as an accessbility element.': string),
15341539
render: function (): React.Node {
1535-
return <Image accessible source={fullImage} style={styles.base} />;
1536-
},
1540+
const [isAccessible, setIsAccessible] = React.useState(true);
1541+
return (
1542+
<>
1543+
<View style={styles.switch}>
1544+
<Text>Set acccessible:</Text>
1545+
<Switch
1546+
value={isAccessible}
1547+
onValueChange={setIsAccessible}
1548+
/>
1549+
</View>
1550+
<Image accessible={isAccessible} source={fullImage} style={styles.base} />
1551+
</>
1552+
);
1553+
}
15371554
},
15381555
{
15391556
title: 'Accessibility Label',

0 commit comments

Comments
 (0)