MainBar.js 960 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import React from 'react';
  2. import {StyleSheet, View, Text , Button } from 'react-native';
  3. import { Icon } from 'react-native-elements'
  4. import { TextInput } from 'react-native';
  5. export default class MainBar{
  6. constructor(){
  7. this.__save = null
  8. }
  9. onSave(fn){
  10. this.__save = fn;
  11. }
  12. save(){
  13. this.__save && this.__save();
  14. }
  15. triggerSave(){
  16. this.save();
  17. }
  18. none(){
  19. }
  20. render(){
  21. return (
  22. <View style={styles.container}>
  23. <Button
  24. color="#f1f1f1"
  25. title={<Icon name='menu'
  26. color="#606060"
  27. />}
  28. />
  29. <Button
  30. color="#f1f1f1"
  31. title={<Icon name='home'
  32. color="#606060"
  33. />}
  34. />
  35. <Text style={{height:30,width:80,fontSize:11,marginTop:6}}>
  36. <Button
  37. onPress={(e) => this.triggerSave()}
  38. title="Save"
  39. color="#606060"
  40. />
  41. </Text>
  42. </View>)
  43. }
  44. }
  45. const styles = StyleSheet.create({
  46. container:{
  47. flex:1,
  48. paddingRight:25,
  49. flexDirection:'row',
  50. }
  51. })