Toolbar.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. alignItems: 'center',
  62. justifyContent: 'center'
  63. },
  64. content: {
  65. flex: 1,
  66. paddingRight: 48,
  67. alignItems: 'center'
  68. },
  69. logo: {
  70. width:123.8,
  71. height: 38.95
  72. }
  73. });
  74. export default Toolbar = (props) => {
  75. return (
  76. <View style={Styles.toolbar}>
  77. <BackButton/>
  78. <View style={Styles.content}>
  79. <Image
  80. source={require('../images/tool-logo.png')}
  81. style={Styles.logo}
  82. />
  83. </View>
  84. </View>
  85. )
  86. }