MainBar.js 792 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import React from 'react';
  2. import {StyleSheet, View, Text , Button} from 'react-native';
  3. import { TextInput } from 'react-native';
  4. export default class MainBar{
  5. constructor(){
  6. this.__save = null
  7. }
  8. onSave(fn){
  9. this.__save = fn;
  10. }
  11. save(){
  12. this.__save && this.__save();
  13. }
  14. triggerSave(){
  15. this.save();
  16. }
  17. none(){
  18. }
  19. render(){
  20. return (
  21. <View style={styles.container}>
  22. <Text>
  23. Structure
  24. </Text>
  25. <Text>
  26. Design
  27. </Text>
  28. <Button
  29. onPress={(e) => this.triggerSave()}
  30. title="Save"
  31. color="#841584" />
  32. <Button
  33. onPress={(e) => this.none()}
  34. title="AnotherFunc"
  35. color="#841584" />
  36. </View>)
  37. }
  38. }
  39. const styles = StyleSheet.create({
  40. container:{
  41. flex:1,
  42. justifyContent: 'space-around',
  43. flexDirection:'row',
  44. }
  45. })