-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from nfcampos/system-item
Add iOS-only systemItem prop for buttons in Navigator.Config
- Loading branch information
Showing
5 changed files
with
136 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import { Dimensions } from 'react-native'; | ||
|
||
import Navigator from 'native-navigation'; | ||
|
||
import LoremImage from '../components/LoremImage'; | ||
import Screen from '../components/Screen'; | ||
import Row from '../components/Row'; | ||
|
||
const propTypes = {}; | ||
const defaultProps = {}; | ||
const contextTypes = { | ||
nativeNavigationInstanceId: PropTypes.string, | ||
}; | ||
|
||
const { width } = Dimensions.get('window'); | ||
|
||
export default class NavigationExampleScreen extends Component { | ||
state = {}; | ||
|
||
render() { | ||
return ( | ||
<Screen> | ||
<Navigator.Config {...this.state} /> | ||
<LoremImage width={width} height={width / 1.6} /> | ||
<Row | ||
title="Title" | ||
onPress={() => this.setState({ | ||
title: 'A title', | ||
subtitle: undefined, | ||
rightButtons: undefined, | ||
})} | ||
/> | ||
<Row | ||
title="Title and subtitle" | ||
onPress={() => this.setState({ | ||
title: 'A title', | ||
subtitle: 'A subtitle', | ||
rightButtons: undefined, | ||
})} | ||
/> | ||
<Row | ||
title="Right button with title" | ||
onPress={() => this.setState({ | ||
title: 'A title', | ||
subtitle: undefined, | ||
rightButtons: [{ title: 'Hello' }], | ||
})} | ||
/> | ||
<Row | ||
title="Right button with system item" | ||
onPress={() => this.setState({ | ||
title: 'A title', | ||
subtitle: undefined, | ||
rightButtons: [{ systemItem: 'add' }], | ||
})} | ||
/> | ||
<Row | ||
title="Several right buttons" | ||
onPress={() => this.setState({ | ||
title: 'A title', | ||
subtitle: undefined, | ||
rightButtons: [{ systemItem: 'add' }, { systemItem: 'edit' }], | ||
})} | ||
/> | ||
</Screen> | ||
); | ||
} | ||
} | ||
|
||
NavigationExampleScreen.defaultProps = defaultProps; | ||
NavigationExampleScreen.propTypes = propTypes; | ||
NavigationExampleScreen.contextTypes = contextTypes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters