Skip to content

Commit 85dc24e

Browse files
author
Javier Morant
authored
Added paddingLeftIncrement (#68)
1 parent a9590c8 commit 85dc24e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/NestedRowExample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ export default class ExampleApp extends React.Component<Props, State> {
8080
renderNode={(node: Node, level: number) => (
8181
<NestedRow
8282
level={level}
83-
style={{borderColor: 'black', borderWidth: 1}}
84-
>
83+
paddingLeftIncrement={20}
84+
style={{borderColor: 'black', borderWidth: 1}}>
8585
<Text>{node.name}</Text>
8686
</NestedRow>
8787
)}

src/NestedRow.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ export interface IProps {
1414
height?: number
1515
children: any
1616
level?: number
17+
paddingLeftIncrement?: number,
1718
style?: any
1819
}
1920

2021
export default class NestedRow extends React.PureComponent<IProps> {
2122
public render() {
22-
const {height = 50, children, level = 0, style} = this.props
23+
const {height = 50, children, level = 0, paddingLeftIncrement = 10, style} = this.props
2324

2425
return (
2526
<View
@@ -28,7 +29,7 @@ export default class NestedRow extends React.PureComponent<IProps> {
2829
{
2930
...style,
3031
height,
31-
paddingLeft: level * 10,
32+
paddingLeft: level * paddingLeftIncrement,
3233
},
3334
]}>
3435
{children}

0 commit comments

Comments
 (0)