How to use the @cycle/dom.a function in @cycle/dom

To help you get started, we’ve selected a few @cycle/dom 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 shesek / spark-wallet / client / src / views / home.js View on Github external
const home = ({ feed, feedStart, feedActive, unitf, obalance, cbalance, channels, funds, conf: { expert } }) => !feed ? '' : div([

  // Main buttons
  div('.row.mb-2', [
    div('.col-sm-6.mb-2', a('.btn.btn-lg.btn-primary.btn-block', { attrs: { href: preferCam ? '#/scan' : '#/payreq' } }, 'Pay'))
  , div('.col-sm-6.mb-2', a('.btn.btn-lg.btn-secondary.btn-block', { attrs: { href: '#/recv' } }, 'Request'))
  , expert ? div('.col-sm-6', a('.btn.btn-lg.btn-info.btn-block.mb-2', { attrs: { href: '#/logs' } }, 'Logs')) : ''
  , expert ? div('.col-sm-6', a('.btn.btn-lg.btn-warning.btn-block.mb-2', { attrs: { href: '#/rpc' } }, 'Console')) : ''
  ])

 // Balance overview
, channels && funds ? balanceOverview({ obalance, cbalance, channels, funds, unitf }) : ''


  // Payments feed
, ...(!feed.length ? [ p('.text-center.text-muted.mt-4', 'You have no incoming or outgoing payments.') ] : [
    ul('.list-group.feed', feed.slice(feedStart, feedStart+perPage).map(itemRenderer({ feedActive, unitf, expert })))
  , paging(feed.length, feedStart)
  ])])
github ivan-kleshnin / cyclejs-examples / 2.3-routing / src / pages / complex2.js View on Github external
DOM: src.navi.map((navi) => {
      console.log("render complex2")
      return div([
        h1("Complex"),
        menu({navi}),
        p(".special", [
          span(a({href: "#local1"}, "Local link #1")),
          span(" "),
          span(a({href: "#local2"}, "Local link #2")),
        ])
      ])
    }),
github ivan-kleshnin / cyclejs-examples / 2.3-routing / src / pages / complex.js View on Github external
DOM: src.navi.map((navi) => {
      console.log("render complex")
      return div([
        h1("Complex"),
        menu({navi}),
        p(".special", [
          span(a({href: "#local1"}, "Local link #1")),
          span(" "),
          span(a({href: "#local2"}, "Local link #2")),
        ])
      ])
    }),
github cyclejs / cyclejs / examples / advanced / isomorphic / app.js View on Github external
function renderMenu() {
  return (
    ul([
      li([ a('.link', {attrs: {href: '/'}}, 'Home') ]),
      li([ a('.link', {attrs: {href: '/about'}}, 'About') ]),
    ])
  );
}
github tryanzu / frontend / src / components / post / views / postView.js View on Github external
const c = comments.map[id];

                      return commentView({
                          comment: c,
                          state,
                      });
                  })
                : comments.resolving
                    ? h('div.pv2', h('div.loading'))
                    : []
        ),
        div(
            '.new-comments.shadow.toast.toast-success',
            { class: { dn: comments.missing == 0 } },
            [
                a(
                    '.load-more',
                    { dataset: { count: comments.missing } },
                    `Cargar ${comments.missing} ${
                        comments.missing > 1
                            ? 'nuevos comentarios'
                            : 'nuevo comentario'
                    }`
                ),
                span('.icon-cancel.fr'),
            ]
        ),
        user !== false ? replyView({ state, type: 'post', id: post.id }) : null,
    ]);
}
github cyclejs / cyclejs / examples / intermediate / http-search-github / src / main.js View on Github external
ul('.search-results', results.map(result =>
          li('.search-result', [
            a({attrs: {href: result.html_url}}, result.name)
          ])
        ))
github router5 / router5 / packages / examples / apps / cycle / components / InboxList.js View on Github external
emails.map(({ id, mailTitle, mailMessage }) =>
            li(
                a({ href: buildUrl('inbox.message', { id }) }, [
                    h4(mailTitle),
                    p(mailMessage)
                ])
            )
        )
github cyclejs / todomvc-cycle / src / components / TaskList / view.js View on Github external
function renderFilterButton(todosData, filterTag, path, label) {
  return li([
    a({
      props: {href: path},
      class: {selected: todosData.filter === filterTag}
    }, label)
  ]);
}
github andreloureiro / cyclejs-starter / js / components / Router / index.js View on Github external
  const makeLink = (path, label) => a({props: {href: path}, style: {padding: '1em'}}, label);
github wizardwerdna / FRPBowlingKata / src / view.ts View on Github external
function vFooter() {
  return div('#footer', [
    a(
      '.footlink',
      {props: {href: 'https://github.com/wizardwerdna/FRPBowlingKata'}},
      'FRP Bowling'
    ),
    span(' built by '),
    a(
      '.footlinke',
      {props: {href: 'mailto:wizardwerdna@gmail.com'}},
      'Andrew C. Greenberg'
    )
  ]);
}