Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
])])
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")),
])
])
}),
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")),
])
])
}),
function renderMenu() {
return (
ul([
li([ a('.link', {attrs: {href: '/'}}, 'Home') ]),
li([ a('.link', {attrs: {href: '/about'}}, 'About') ]),
])
);
}
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,
]);
}
ul('.search-results', results.map(result =>
li('.search-result', [
a({attrs: {href: result.html_url}}, result.name)
])
))
emails.map(({ id, mailTitle, mailMessage }) =>
li(
a({ href: buildUrl('inbox.message', { id }) }, [
h4(mailTitle),
p(mailMessage)
])
)
)
function renderFilterButton(todosData, filterTag, path, label) {
return li([
a({
props: {href: path},
class: {selected: todosData.filter === filterTag}
}, label)
]);
}
const makeLink = (path, label) => a({props: {href: path}, style: {padding: '1em'}}, label);
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'
)
]);
}