Toolbar.js 2.0 KB

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