GuideHeaderBar.js 1.3 KB

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