How to use the reason-react/lib/es6/src/ReasonReact.js.statelessComponent function in reason-react

To help you get started, we’ve selected a few reason-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mike-engel / Barnacal / lib / es6 / src / popover.js View on Github external
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE

import * as ReasonReact from "reason-react/lib/es6/src/ReasonReact.js";

var component = ReasonReact.statelessComponent("Popover");

var popover_styles = {
  backgroundColor: "#000",
  cursor: "default",
  height: "100vh",
  margin: "0 auto",
  marginTop: "10px",
  padding: "0",
  paddingBottom: "1px",
  position: "relative",
  width: "300px",
  borderRadius: "5px"
};

function make(children) {
  var newrecord = component.slice();
github mike-engel / Barnacal / lib / es6 / src / calendar.js View on Github external
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE

import * as React from "react";
import * as ReasonReact from "reason-react/lib/es6/src/ReasonReact.js";
import * as CalendarBody from "./CalendarBody.js";
import * as CalendarHeader from "./CalendarHeader.js";

var component = ReasonReact.statelessComponent("Calendar");

var calendar_styles = {
  padding: "0 1em",
  width: "100%"
};

function make(date, _) {
  var newrecord = component.slice();
  newrecord[/* render */9] = (function () {
      return React.createElement("table", {
                  style: calendar_styles
                }, ReasonReact.element(/* None */0, /* None */0, CalendarHeader.make(/* array */[])), ReasonReact.element(/* None */0, /* None */0, CalendarBody.make(date, /* array */[])));
    });
  return newrecord;
}
github mike-engel / Barnacal / lib / es6 / src / week.js View on Github external
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE

import * as $$Array from "bs-platform/lib/es6/array.js";
import * as React from "react";
import * as ReasonReact from "reason-react/lib/es6/src/ReasonReact.js";

var component = ReasonReact.statelessComponent("Week");

var week_styles = {
  color: "#FFF",
  textAlign: "center"
};

function day_styles(is_today) {
  return {
          color: is_today !== 0 ? "#F012BE" : "#FFF",
          fontWeight: "700",
          padding: "0.25em 0"
        };
}

function weekday(idx, date) {
  var match = date[0];
github mike-engel / Barnacal / lib / es6 / src / header.js View on Github external
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE

import * as Curry from "bs-platform/lib/es6/curry.js";
import * as React from "react";
import * as ReasonReact from "reason-react/lib/es6/src/ReasonReact.js";
import * as Format from "date-fns/format";

var component = ReasonReact.statelessComponent("Header");

var header_styles = {
  backgroundColor: "#000",
  display: "flex",
  marginBottom: "10px",
  paddingTop: "0px",
  textAlign: "center",
  borderTopLeftRadius: "4px",
  borderTopRightRadius: "4px",
  alignItems: "center"
};

var header_text_styles = {
  color: "#fff",
  cursor: "pointer",
  fontSize: "22px",
github mike-engel / Barnacal / lib / es6 / src / calendarHeader.js View on Github external
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE

import * as $$Array from "bs-platform/lib/es6/array.js";
import * as React from "react";
import * as Electron from "electron";
import * as ReasonReact from "reason-react/lib/es6/src/ReasonReact.js";

var component = ReasonReact.statelessComponent("CalendarHeader");

function weekdays() {
  var day = Electron.remote.getGlobal("global").firstWeekday;
  var index = day - 1 | 0;
  var list = /* array */[
    "S",
    "M",
    "T",
    "W",
    "T",
    "F",
    "S"
  ];
  var before = $$Array.sub(list, index, list.length - index | 0);
  var after = $$Array.sub(list, 0, index);
  return $$Array.append(before, after);
github mike-engel / Barnacal / lib / es6 / src / calendarBody.js View on Github external
// Generated by BUCKLESCRIPT VERSION 2.2.3, PLEASE EDIT WITH CARE

import * as FFI from "./FFI.js";
import * as Week from "./Week.js";
import * as $$Array from "bs-platform/lib/es6/array.js";
import * as Electron from "electron";
import * as Caml_array from "bs-platform/lib/es6/caml_array.js";
import * as ReasonReact from "reason-react/lib/es6/src/ReasonReact.js";
import * as Get_day from "date-fns/get_day";
import * as Is_today from "date-fns/is_today";
import * as Caml_builtin_exceptions from "bs-platform/lib/es6/caml_builtin_exceptions.js";
import * as Get_days_in_month from "date-fns/get_days_in_month";

var component = ReasonReact.statelessComponent("CalendarBody");

var table_styles = { };

function week_day_number(date) {
  var user_first_day = Electron.remote.getGlobal("global").firstWeekday;
  var day_index = Get_day(date);
  var offset_index = user_first_day - 1 | 0;
  var index = day_index - offset_index | 0;
  if (index === day_index) {
    return day_index;
  } else if (index > 0) {
    return index;
  } else if (index < 0) {
    return 7 + index | 0;
  } else if (index === 0) {
    return 0;
github mike-engel / Barnacal / lib / es6 / src / menu.js View on Github external
textDecoration: "none",
  width: "15px"
};

var update_styles = {
  color: "#FFF",
  fontSize: "12px"
};

var link_styles = {
  color: "#F012BE",
  fontSize: "12px",
  textDecoration: "none"
};

var component = ReasonReact.statelessComponent("Menu");

var power = React.createElement("svg", {
      fill: "none",
      stroke: "#FFF",
      strokeLinecap: "round",
      strokeLinejoin: "round",
      strokeWidth: "2",
      viewBox: "0 0 24 24"
    }, React.createElement("path", {
          d: "M18.36 6.64a9 9 0 1 1-12.73 0"
        }), React.createElement("line", {
          x1: "12",
          x2: "12",
          y1: "2",
          y2: "12"
        }));