GuideHeaderBar.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React from "react";
  2. import { Button, Layout, useTheme, Text } from "@ui-kitten/components";
  3. import { useModel } from "flooks";
  4. import { Image, StyleSheet } from "react-native";
  5. export default function GuideHeaderBar(props) {
  6. const theme = useTheme();
  7. const { registerInfo, showName } = useModel("userModel");
  8. return (
  9. <Layout
  10. style={[
  11. styles.container,
  12. { backgroundColor: theme["color-primary-500"] },
  13. ]}
  14. >
  15. <Image
  16. source={require("../assets/images/logo_bai.png")}
  17. style={styles.icon}
  18. />
  19. <Text style={styles.text} category='h6'>
  20. {showName
  21. ? showName
  22. : registerInfo
  23. ? registerInfo.showName
  24. : "商家名称"}
  25. </Text>
  26. </Layout>
  27. );
  28. }
  29. const styles = StyleSheet.create({
  30. container: {
  31. height: 70,
  32. flexDirection: "row",
  33. paddingVertical: 10,
  34. paddingHorizontal: 65,
  35. alignItems: "center",
  36. justifyContent: "center",
  37. },
  38. icon: { width: 49, height: 49, position: "absolute", left: 15, top: 10 },
  39. text: {
  40. color: "#fff",
  41. },
  42. });