Appbar.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import React from 'react';
  2. import { Image, Pressable, StyleSheet, View } from 'react-native';
  3. export const BackButton = ({navigation}) => {
  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}) => {
  23. return (
  24. <Image
  25. style={{
  26. right: 0,
  27. bottom: bottom ?? 24,
  28. width: 125.8,
  29. height: 137.64,
  30. zIndex: 0,
  31. position: 'absolute'
  32. }}
  33. source={require('../images/charge/bg-top-station.png')}/>
  34. );
  35. }
  36. export const Styles = StyleSheet.create({
  37. toolbar: {
  38. height: 56,
  39. paddingLeft: 2,
  40. paddingRight: 2,
  41. alignItems: 'center',
  42. flexDirection: 'row',
  43. backgroundColor: colorPrimary
  44. },
  45. backIcon: {
  46. width: 48,
  47. height: 48,
  48. alignItems: 'center',
  49. justifyContent: 'center'
  50. },
  51. content: {
  52. flex: 1,
  53. paddingRight: 48,
  54. alignItems: 'center'
  55. },
  56. logo: {
  57. width:123.8,
  58. height: 38.95
  59. }
  60. });
  61. export default Appbar = (props) => {
  62. return (
  63. <View style={Styles.toolbar}>
  64. <BackButton {...props}/>
  65. <View style={Styles.content}>
  66. <Image
  67. source={require('../images/tool-logo.png')}
  68. style={Styles.logo}
  69. />
  70. </View>
  71. </View>
  72. )
  73. }