invertase / react-native-material-design

React Native UI Components for Material Design
http://react-native-material-design.github.io
MIT License
3.15k stars 365 forks source link

Small tweak to allow children on Toolbar #66

Closed Odinvt closed 8 years ago

Odinvt commented 8 years ago

Hi !

I've added a small line that makes it possible to specify children to the Toolbar Component to render them instead of the title :


             <MaterialToolbar
                primary={'paperDeepPurple'}
                icon={'menu'}
                onIconPress={() => {
                    console.log('expected to open drawer');
                    drawer.openDrawer()
                }}
                actions={[{
                    icon: 'settings',
                    onPress: () => {
                        console.log('navbar right icon pressed')
                    }
                }]}
                rightIconStyle={{
                    margin: 10
                }}
            >
                     <TextInput
                        style={{height: 40, color: 'white', borderColor: 'gray', borderWidth: 1 ,flex: 1}}
                        onChangeText={(text) => {
                            console.log('text typed on top search bar : ' + text)
                        }}
                        value={"Search"}
                    />
            </MaterialToolbar>

alt tag

Ehesp commented 8 years ago

Good idea 👍