Browse Source

Merge pull request #56 from VonIobro/feature/component-refactor-modal

Feature/component refactor modal
renovate/lint-staged-8.x
jackmallers 7 years ago
committed by GitHub
parent
commit
8bf746a930
  1. 0
      app/components/ModalRoot/ModalRoot.js
  2. 4
      app/components/ModalRoot/ModalRoot.scss
  3. 0
      app/components/ModalRoot/SuccessfulSendCoins.js
  4. 4
      app/components/ModalRoot/SuccessfulSendCoins.scss
  5. 0
      app/components/ModalRoot/index.js
  6. 2
      app/routes/app/components/App.js
  7. 3
      app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/index.js
  8. 35
      test/components/ModalRoot.spec.js

0
app/routes/app/components/components/ModalRoot/ModalRoot.js → app/components/ModalRoot/ModalRoot.js

4
app/routes/app/components/components/ModalRoot/ModalRoot.scss → app/components/ModalRoot/ModalRoot.scss

@ -1,4 +1,4 @@
@import '../../../../../variables.scss';
@import '../../variables.scss';
.container {
position: absolute;
@ -39,4 +39,4 @@
width: 32px;
height: 32px;
}
}
}

0
app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/SuccessfulSendCoins.js → app/components/ModalRoot/SuccessfulSendCoins.js

4
app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/SuccessfulSendCoins.scss → app/components/ModalRoot/SuccessfulSendCoins.scss

@ -1,4 +1,4 @@
@import '../../../../../../variables.scss';
@import '../../variables.scss';
.container {
position: relative;
@ -34,4 +34,4 @@
width: 15%;
margin: 0 auto;
}
}
}

0
app/routes/app/components/components/ModalRoot/index.js → app/components/ModalRoot/index.js

2
app/routes/app/components/App.js

@ -2,8 +2,8 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import LoadingBolt from 'components/LoadingBolt'
import Form from 'components/Form'
import ModalRoot from 'components/ModalRoot'
import Nav from 'components/Nav'
import ModalRoot from './components/ModalRoot'
import styles from './App.scss'
class App extends Component {

3
app/routes/app/components/components/ModalRoot/SuccessfulSendCoins/index.js

@ -1,3 +0,0 @@
import SuccessfulSendCoins from './SuccessfulSendCoins'
export default SuccessfulSendCoins

35
test/components/ModalRoot.spec.js

@ -0,0 +1,35 @@
import React from 'react'
import { shallow } from 'enzyme'
import ModalRoot from '../../app/components/ModalRoot'
import SuccessfulSendCoins from '../../app/components/ModalRoot/SuccessfulSendCoins'
const defaultProps = {
hideModal: () => {},
modalProps: {},
currentTicker: {},
currency: ''
}
describe('no modal', () => {
const props = { ...defaultProps }
const el = shallow(<ModalRoot {...props} />)
it('should return null', () => {
expect(el.html()).toBeNull()
})
})
describe('SuccessfulSendCoins modal', () => {
const props = {
...defaultProps,
modalType: 'SUCCESSFUL_SEND_COINS',
modalProps: {
amount: 10000000,
addr: 'mkrfWvHSbUjgyne4EWnydWekywWBjrucKs',
txid: 'fd7dfc8b809a128323b1b679fe31e27ed7b34baae0a79cd4a290fb4dab892d26'
}
}
const el = shallow(<ModalRoot {...props} />)
it('should render specific modal', () => {
expect(el.find(SuccessfulSendCoins).length).toBe(1)
})
});
Loading…
Cancel
Save