GuideHeaderBar.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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, mid } = useModel("userModel");
  8. const title = React.useMemo(() => {
  9. if (mid) {
  10. return showName;
  11. } else {
  12. return registerInfo.showName;
  13. }
  14. }, [showName, registerInfo]);
  15. return (
  16. <Layout
  17. style={[
  18. styles.container,
  19. { backgroundColor: theme["color-primary-500"] },
  20. ]}
  21. >
  22. <Image
  23. source={require("../assets/images/logo_bai.png")}
  24. style={styles.icon}
  25. />
  26. <Text style={styles.text} category='h6'>
  27. {title}
  28. </Text>
  29. </Layout>
  30. );
  31. }
  32. const styles = StyleSheet.create({
  33. container: {
  34. height: 70,
  35. flexDirection: "row",
  36. paddingVertical: 10,
  37. paddingHorizontal: 65,
  38. alignItems: "center",
  39. justifyContent: "center",
  40. },
  41. icon: { width: 49, height: 49, position: "absolute", left: 15, top: 10 },
  42. text: {
  43. color: "#fff",
  44. },
  45. });