Toolbar.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import React from 'react';
  2. import { Image, Pressable, StyleSheet, View } from 'react-native';
  3. export const BackButton = () => {
  4. return (
  5. <Pressable
  6. style={Styles.backIcon}
  7. android_ripple = {{
  8. color: '#909090',
  9. radius: 22,
  10. borderless: true
  11. }}
  12. onPress={() => {
  13. goBack();
  14. }}>
  15. <BackIcon/>
  16. </Pressable>
  17. )
  18. }
  19. export const BackIcon = () => {
  20. return <MaterialIcons name={isIOS ? 'arrow-back-ios' : 'arrow-back'} size={24} color={'#333333'} />
  21. }
  22. export const StationBack = ({bottom = 24}) => {
  23. return (
  24. <Image
  25. style={{
  26. right: 0,
  27. bottom: bottom,
  28. width: 125.8,
  29. height: 137.64,
  30. position: 'absolute'
  31. }}
  32. source={require('../images/charge/bg-top-station.png')}/>
  33. );
  34. }
  35. export const Styles = StyleSheet.create({
  36. toolbar: {
  37. height: toolbarSize,
  38. paddingLeft: 2,
  39. paddingRight: 2,
  40. paddingTop: isIOS ? statusHeight : 0,
  41. alignItems: 'center',
  42. flexDirection: 'row',
  43. justifyContent: 'center',
  44. backgroundColor: colorPrimary
  45. },
  46. backIcon: {
  47. width: 48,
  48. height: 48,
  49. alignItems: 'center',
  50. justifyContent: 'center'
  51. },
  52. content: {
  53. flex: 1,
  54. paddingRight: 48,
  55. alignItems: 'center'
  56. },
  57. logo: {
  58. width:123.8,
  59. height: 38.95
  60. }
  61. });
  62. export default Toolbar = (props) => {
  63. return (
  64. <View style={Styles.toolbar}>
  65. <BackButton/>
  66. <View style={Styles.content}>
  67. <Image
  68. source={require('../images/tool-logo.png')}
  69. style={Styles.logo}
  70. />
  71. </View>
  72. </View>
  73. )
  74. }