Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ff2b4ba

Browse files
committed
Fixed raw text display, Scrolling in example
1 parent 68f6d60 commit ff2b4ba

File tree

2 files changed

+50
-54
lines changed

2 files changed

+50
-54
lines changed

‎examples/app/Examples.js‎

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,57 @@
11
import { Map } from 'immutable';
22
import React, { Component } from 'react';
3-
import { StyleSheet,Text, View } from 'react-native';
3+
import { ScrollView,StyleSheet, View } from 'react-native';
44
import JSONTree from 'react-native-json-tree';
55
import Heading from './Heading';
66

77
const styles = StyleSheet.create({
88
container: {
9-
backgroundColor: '#F5FCFF',
109
flex: 1,
1110
padding: 20,
1211
},
1312
});
1413

15-
// const exampleJson = {
16-
// array: [1, 2, 3],
17-
// emptyArray: [],
18-
// bool: true,
19-
// date: new Date(),
20-
// object: {
21-
// foo: {
22-
// bar: 'baz',
23-
// nested: {
24-
// moreNested: {
25-
// evenMoreNested: {
26-
// veryNested: {
27-
// insanelyNested: {
28-
// ridiculouslyDeepValue: 'Hello',
29-
// levels: 9,
30-
// tooMany: true,
31-
// },
32-
// },
33-
// },
34-
// },
35-
// },
36-
// },
37-
// baz: undefined,
38-
// func: function User() {},
39-
// },
40-
// emptyObject: {},
41-
// immutable: Map({ key: 'value' }), // eslint-disable-line new-cap
42-
// hugeArray: Array.from({ length: 100 }).map((_, i) => `item #${i}`),
43-
// longString: 'Loremipsumdolorsitamet,consecteturadipiscingelit.Namtempusipsumutfelisdignissimauctor',
44-
// };
45-
4614
const exampleJson = {
47-
key: 'val',
48-
secondDey: 2,
49-
nestedArray: [1,2,3]
15+
array: [1, 2, 3],
16+
emptyArray: [],
17+
bool: true,
18+
date: new Date(),
19+
object: {
20+
foo: {
21+
bar: 'baz',
22+
nested: {
23+
moreNested: {
24+
evenMoreNested: {
25+
veryNested: {
26+
insanelyNested: {
27+
ridiculouslyDeepValue: 'Hello',
28+
levels: 9,
29+
tooMany: true,
30+
},
31+
},
32+
},
33+
},
34+
},
35+
},
36+
baz: undefined,
37+
func: function User() {},
38+
},
39+
emptyObject: {},
40+
immutable: Map({ key: 'value' }), // eslint-disable-line new-cap
41+
hugeArray: Array.from({ length: 100 }).map((_, i) => `item #${i}`),
42+
longString: 'Loremipsumdolorsitamet,consecteturadipiscingelit.Namtempusipsumutfelisdignissimauctor',
5043
};
5144

45+
5246
// eslint-disable-next-line
5347
class Examples extends Component {
5448
render() {
5549
return (
5650
<View style={styles.container}>
57-
<Heading>react-native-json-tree</Heading>
58-
<JSONTree data={exampleJson} />
51+
<ScrollView>
52+
<Heading>react-native-json-tree</Heading>
53+
<JSONTree data={exampleJson} />
54+
</ScrollView>
5955
</View>
6056
);
6157
}

‎src/ItemRange.js‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component, PropTypes } from 'react';
2-
import { View } from 'react-native';
2+
import { Text,View } from 'react-native';
33
import shouldPureComponentUpdate from 'react-pure-render/function';
44
import JSONArrow from './JSONArrow';
55

@@ -22,22 +22,22 @@ export default class ItemRange extends Component {
2222
const { styling, from, to, renderChildNodes, nodeType } = this.props;
2323

2424
return (this.state.expanded ?
25-
<View {...styling('itemRange', this.state.expanded)}>
26-
{renderChildNodes(this.props, from, to)}
27-
</View> :
28-
<View
29-
{...styling('itemRange', this.state.expanded)}
30-
onPress={this.handlePress}
31-
>
32-
<JSONArrow
33-
nodeType={nodeType}
34-
styling={styling}
35-
expanded={false}
25+
<View {...styling('itemRange', this.state.expanded)}>
26+
{renderChildNodes(this.props, from, to)}
27+
</View> :
28+
<View
29+
{...styling('itemRange', this.state.expanded)}
3630
onPress={this.handlePress}
37-
arrowStyle="double"
38-
/>
39-
{`${from} ... ${to}`}
40-
</View>
31+
>
32+
<JSONArrow
33+
nodeType={nodeType}
34+
styling={styling}
35+
expanded={false}
36+
onPress={this.handlePress}
37+
arrowStyle="double"
38+
/>
39+
<Text>{`${from} ... ${to}`}</Text>
40+
</View>
4141
);
4242
}
4343

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /