aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/modals/buy-modal.js
blob: c69433b1fa3e79e002385209a7ebb2b897afe61b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const BuyOptions = require('../buy-options')
const Modal = require('./modal.js')

inherits(BuyModal, Component)
function BuyModal () {
  Component.call(this)
}

module.exports = BuyModal

BuyModal.prototype.render = function () {
  return h(Modal, {
    ref: "modalRef",
  }, [
    h(BuyOptions, {}, []),
  ])

}

// TODO: specify default props and proptypes

// Generalize to multiple modals:
//   Modal API:
//    - props {
//      key: ['BUY', 'EDIT_ACCOUNT_NAME', 'ACCOUNT_DETAILS']
//    }
//    - These props will be passed as 'active'
//      mapStateToProps(state, ownProps) {
//        active: state.appState.modal[key]
//      }
//    - Modal accepts:
//      - mobileModalStyles, for mobile viewports
//      - laptopModalStyles, for laptop viewports
//      - backdropStyles
//      - Do not set defaults, they are unneeded here
// 
// If multiple-step modals are needed:
//  - pass a component with internal state that tracks buy steps
//    - steps could technically be in redux
//  - it renders and does not trigger open/close actions until done