getTheme()

in js/common/F8Button.js [117:184]


  getTheme() {
    const { theme } = this.props;
    let buttonTheme, iconTheme, captionTheme;
    if (theme === "yellow") {
      buttonTheme = { backgroundColor: F8Colors.yellow };
      iconTheme = { tintColor: F8Colors.pink };
      captionTheme = { color: F8Colors.pink };
    } else if (theme === "blue") {
      buttonTheme = { backgroundColor: F8Colors.blue };
      iconTheme = { tintColor: F8Colors.white };
      captionTheme = { color: F8Colors.white };
    } else if (theme === "fb") {
      buttonTheme = { backgroundColor: F8Colors.facebookBlue };
      iconTheme = { tintColor: F8Colors.white };
      captionTheme = { color: F8Colors.white };
    } else if (theme === "white") {
      buttonTheme = { backgroundColor: F8Colors.white };
      iconTheme = { tintColor: F8Colors.pink };
      captionTheme = { color: F8Colors.pink };
    } else if (theme === "bordered") {
      buttonTheme = {
        backgroundColor: "transparent",
        borderWidth: 1,
        borderColor: F8Colors.tangaroa
      };
      iconTheme = { tintColor: F8Colors.tangaroa };
      captionTheme = { color: F8Colors.tangaroa };
    } else if (theme === "bordered-pink") {
      buttonTheme = {
        backgroundColor: "transparent",
        borderWidth: 1,
        borderColor: F8Colors.pink
      };
      iconTheme = { tintColor: F8Colors.pink };
      captionTheme = { color: F8Colors.pink };
    } else if (theme === "maps") {
      buttonTheme = {
        backgroundColor: "transparent",
        borderWidth: 1,
        borderColor: F8Colors.purple
      };
      iconTheme = { tintColor: F8Colors.tangaroa };
      captionTheme = { color: F8Colors.tangaroa };
    } else if (theme === "mapsInactive") {
      buttonTheme = {
        backgroundColor: "transparent",
        borderWidth: 1,
        borderColor: "transparent"
      };
      iconTheme = { tintColor: F8Colors.tangaroa };
      captionTheme = { color: F8Colors.tangaroa };
    } else if (theme === "disabled") {
      buttonTheme = { backgroundColor: F8Colors.blueBayoux };
      iconTheme = { tintColor: F8Colors.white, opacity: 0.5 };
      captionTheme = { color: F8Colors.white, opacity: 0.5 };
    } else if (theme === "transparent") {
      buttonTheme = { backgroundColor: "transparent" };
      iconTheme = { tintColor: F8Colors.tangaroa };
      captionTheme = { color: F8Colors.tangaroa };
    } else {
      // pink/white is default
      buttonTheme = { backgroundColor: F8Colors.pink };
      iconTheme = { tintColor: "white" };
      captionTheme = { color: "white" };
    }

    return { buttonTheme, iconTheme, captionTheme };
  }