How to use react-hyperscript-helpers - 10 common examples

To help you get started, we’ve selected a few react-hyperscript-helpers 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 ZeusWPI / MOZAIC / planetwars / client / app / components / play / Setup.ts View on Github external
public render() {
    const maps = this.readMaps();
    const mapElements = maps.map((mapPath: path.ParsedPath) => h(MapOption, { path: mapPath }));
    mapElements.push(h("option", { value: "", label: "Select Map" }));
    return h("form", `.${styles.setup}`, { onSubmit: () => this.addToQueue() },
      [
        h("div", `.${styles.selectForm}`, [
          h("div", `.${styles.botSelector}`, [
            h(BotSelector, {
              setPlayers: (players: IBotConfig[]) => this.setPlayers(players),
            }),
          ]),
          h("div", [
            "Map: ",
            h("select", {
              onChange: (evt: any) => this.handleMap(evt),
              value: this.state.map_path.name,
            }, mapElements),
          ]),
          h("div", [
github ZeusWPI / MOZAIC / planetwars / client / app / components / play / Setup.ts View on Github external
public render() {
    const maps = this.readMaps();
    const mapElements = maps.map((mapPath: path.ParsedPath) => h(MapOption, { path: mapPath }));
    mapElements.push(h("option", { value: "", label: "Select Map" }));
    return h("form", `.${styles.setup}`, { onSubmit: () => this.addToQueue() },
      [
        h("div", `.${styles.selectForm}`, [
          h("div", `.${styles.botSelector}`, [
            h(BotSelector, {
              setPlayers: (players: IBotConfig[]) => this.setPlayers(players),
            }),
          ]),
          h("div", [
            "Map: ",
            h("select", {
              onChange: (evt: any) => this.handleMap(evt),
              value: this.state.map_path.name,
            }, mapElements),
          ]),
          h("div", [
            "Max turns: ",
            h("input", {
              type: "number",
              value: this.state.config.game_config.max_turns,
              onChange: (evt: any) => this.handleMaxTurns(evt),
            }),
          ]),
        ]),
        h("div", `.${styles.playContainer}`, [
          h("input", { type: "submit", value: "Play" }),
        ]),
github ZeusWPI / MOZAIC / planetwars / web / frontend / components / Home.ts View on Github external
render() {
    return h(Hero, { isColor: 'primary', isFullHeight: true }, [
      h(HeroHeader, [h(Navbar)]),
      h(HeroBody, [
        h(Container, { hasTextAlign: 'centered' }, [
          h1('.title', ['BottleBats 2.018']),
          h2('.subtitle', ['Coming this spring']),
        ])
      ]),
      h(HeroFooter, [h(Footer)]),
    ])
  }
}
github ZeusWPI / MOZAIC / planetwars / web / frontend / components / Signup.ts View on Github external
render() {
    return [
      h(NavBar),
      h(Hero, '.push', {isColor: 'primary'}, [
          h(HeroBody, '#signup-page', [
            h(SignupBox)
          ])
      ]),
      h(Footer),
    ]
  }
}
github ZeusWPI / MOZAIC / planetwars / web / frontend / components / Info.ts View on Github external
render() {
    return [
      h(NavBar),
      div('#info', [
        h(What),
        h(How),
        h(WhereWhen),
        h(Features),
      ]),
      h(Footer),
    ]
  }
}
github kitspace / kitspace / src / buy_parts / tsv_table.jsx View on Github external
const bodyCells = grouped.map((contents, columnIndex) => {
        if (typeof(contents) === 'object') {
          return this.mpnCells(contents, rowIndex, columnIndex)
        }
        const error     = markPink(columnIndex) && contents === ''
        const className = columnIndex === 0 ? 'marked ' + markerColor(contents) : ''
        const cell = h(semantic.Table.Cell, {
          error,
          className,
        }, contents)
        return cell
      })
      const activePopup    = this.state.activePopup
github ZeusWPI / MOZAIC / planetwars / web / frontend / components / Navbar.ts View on Github external
const CNavLink = (props: NavLinkProps, children: Children) => {
  props.activeClassName = 'is-active';
  return h(NavLink, `.navbar-item`, props, children)
}
github kitspace / kitspace / src / buy_parts / tsv_table.jsx View on Github external
const bodyCells = grouped.map((contents, columnIndex) => {
        if (typeof contents === 'object') {
          return this.mpnCells(contents, rowIndex, columnIndex)
        }
        const error = markPink(columnIndex) && contents === ''
        const className =
          columnIndex === 0 ? 'marked ' + markerColor(contents) : ''
        const cell = h(
          semantic.Table.Cell,
          {
            error,
            className
          },
          contents
        )
        return cell
      })
      const activePopup = this.state.activePopup
github kitspace / kitspace / src / buy_parts / mpn_popup.jsx View on Github external
basic: 'very',
      compact: true,
      tableData,
      renderBodyRow(args) {
        return h(
          semantic.Table.Row,
          {key: String(args)},
          args.map(text => {
            return h(semantic.Table.Cell, text)
          })
        )
      }
    })
    let button
    if ((part.specs || []).length > 4) {
      button = h(div, {style: {display: 'flex', justifyContent: 'center'}}, [
        h(
          semantic.Button,
          {
            onClick: this.toggleExpanded,
            size: 'tiny',
            basic: true
          },
          this.state.expanded ? '⇡' : '...'
        )
      ])
    }
    return h(semantic.Popup, custom, [
      div({className: 'topAreaContainer'}, [
        h(
          div,
          {
github kitspace / kitspace / src / buy_parts / mpn_popup.jsx View on Github external
renderBodyRow(args) {
        return h(
          semantic.Table.Row,
          {key: String(args)},
          args.map(text => {
            return h(semantic.Table.Cell, text)
          })
        )
      }
    })

react-hyperscript-helpers

Terse syntax for hyperscript using react

ISC
Latest version published 6 years ago

Package Health Score

45 / 100
Full package analysis

Popular react-hyperscript-helpers functions