Guest User

Untitled

a guest
Dec 13th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. const CrumbTemplate: React.SFC<{ uri: string, title: string, subTitle?: string }> = (info) => {
  2.  
  3.  
  4. const themeColors = appConfig.theme.colors
  5. const isUriDefined = (info.uri || "").length
  6. const _color = isUriDefined ? themeColors.normal.foreground : themeColors.hover.background
  7. const _borderBottom = isUriDefined ? "thin solid gray" : "none"
  8. const _cursor = isUriDefined ? "pointer" : "initial"
  9.  
  10. return (
  11. <StackPanel
  12. key={info.title}
  13. itemsAlignV={Component.Alignment.center}
  14. style={{ margin: "0", height: "auto" }}>
  15.  
  16. <HoverBox key={info.title}
  17. style={{
  18. padding: "0",
  19. textDecoration: "none",
  20. backgroundColor: "transparent",
  21. color: _color,
  22. borderBottom: _borderBottom,
  23. cursor: _cursor
  24. }}
  25. hoverStyle={{
  26. backgroundColor: "transparent",
  27. textDecoration: "none",
  28. borderColor: appConfig.theme.colors.hover.background,
  29. color: appConfig.theme.colors.hover.background
  30. }}>
  31.  
  32. <a key={info.title}
  33. href={info.uri}
  34. style={{
  35. color: _color,
  36. padding: "0.5rem",
  37. paddingLeft: "0.1rem",
  38. paddingRight: 0
  39. }}>
  40.  
  41. <b style={{ marginRight: "0.25rem" }}>
  42. {new String(info.title).toTitleCase()}
  43. </b>
  44.  
  45. <i>
  46. {new String(info.subTitle || "").toTitleCase()}
  47. </i>
  48.  
  49. {_color}
  50. </a>
  51. </HoverBox>
  52.  
  53. <ArrowRight_4 style={{ height: "2.5rem", marginRight: "-0.5rem", marginLeft: "-0.5rem" }} />
  54.  
  55. </StackPanel>
  56. )
  57. }
  58.  
  59. Warning: Each child in an array or iterator should have a unique "key" prop...
  60. in a (created by CrumbTemplate)
  61. in span (created by HoverBox)
  62. in HoverBox (created by CrumbTemplate)
  63. in div (created by StackPanel)
  64. in StackPanel (created by CrumbTemplate)
  65. ...
Add Comment
Please, Sign In to add comment