Toolbar.js 2.0 KB

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