houdini/client/js/nonprofits/supporters/index/sidepanel/supporter-actions.js

26 lines
698 B
JavaScript
Raw Normal View History

// License: LGPL-3.0-or-later
const R = require('ramda')
const flatMap = require('flyd/module/flatmap')
const flyd = require('flyd')
const h = require('snabbdom/h')
flyd.mergeAll = require('flyd/module/mergeall')
2018-10-11 16:35:53 +00:00
const button = (text, stream) =>
h('button.button--tiny.u-marginRight--10', {on: {click: stream}}
, [h('i.fa.fa-plus.u-marginRight--5') , text ])
const view = state =>
h('section.timeline-actions.u-padding--10', [
button('Note', state.newNote$)
, button('Email', state.clickComposing$)
2018-10-11 16:35:53 +00:00
, button('Donation', () => appl.open_donation_modal(state.supporter$().id,
() => {state.offsiteDonationForm.saved$(Math.random())}
)
)
]
)
module.exports = {view}