Browse Source

Merge pull request #754 from mrfelton/refactor/group-components

refactor(fs): group files by component
renovate/lint-staged-8.x
JimmyMow 6 years ago
committed by GitHub
parent
commit
4bf6eb1d9c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/components/Activity/ActivityModal/ActivityModal.js
  2. 2
      app/components/Activity/ActivityModal/ActivityModal.scss
  3. 3
      app/components/Activity/ActivityModal/index.js
  4. 0
      app/components/Activity/Countdown/Countdown.js
  5. 2
      app/components/Activity/Countdown/Countdown.scss
  6. 3
      app/components/Activity/Countdown/index.js
  7. 2
      app/components/Activity/InvoiceModal/InvoiceModal.js
  8. 2
      app/components/Activity/InvoiceModal/InvoiceModal.scss
  9. 3
      app/components/Activity/InvoiceModal/index.js
  10. 0
      app/components/Activity/PaymentModal/PaymentModal.js
  11. 2
      app/components/Activity/PaymentModal/PaymentModal.scss
  12. 3
      app/components/Activity/PaymentModal/index.js
  13. 0
      app/components/Activity/TransactionModal/TransactionModal.js
  14. 2
      app/components/Activity/TransactionModal/TransactionModal.scss
  15. 3
      app/components/Activity/TransactionModal/index.js
  16. 171
      app/components/Contacts/AddChannel.js
  17. 158
      app/components/Contacts/AddChannel/AddChannel.js
  18. 2
      app/components/Contacts/AddChannel/AddChannel.scss
  19. 3
      app/components/Contacts/AddChannel/index.js
  20. 4
      app/components/Contacts/ChannelForm/ChannelForm.js
  21. 2
      app/components/Contacts/ChannelForm/ChannelForm.scss
  22. 3
      app/components/Contacts/ChannelForm/index.js
  23. 0
      app/components/Contacts/ConnectManually/ConnectManually.js
  24. 2
      app/components/Contacts/ConnectManually/ConnectManually.scss
  25. 3
      app/components/Contacts/ConnectManually/index.js
  26. 0
      app/components/Contacts/ContactModal/ContactModal.js
  27. 2
      app/components/Contacts/ContactModal/ContactModal.scss
  28. 3
      app/components/Contacts/ContactModal/index.js
  29. 0
      app/components/Contacts/ContactsForm/ContactsForm.js
  30. 2
      app/components/Contacts/ContactsForm/ContactsForm.scss
  31. 3
      app/components/Contacts/ContactsForm/index.js
  32. 2
      app/components/Contacts/Network/Network.js
  33. 2
      app/components/Contacts/Network/Network.scss
  34. 3
      app/components/Contacts/Network/index.js
  35. 0
      app/components/Contacts/SubmitChannelForm/SubmitChannelForm.js
  36. 2
      app/components/Contacts/SubmitChannelForm/SubmitChannelForm.scss
  37. 3
      app/components/Contacts/SubmitChannelForm/index.js
  38. 0
      app/components/Contacts/SuggestedNodes/SuggestedNodes.js
  39. 2
      app/components/Contacts/SuggestedNodes/SuggestedNodes.scss
  40. 3
      app/components/Contacts/SuggestedNodes/index.js
  41. 0
      app/components/Form/Pay/Pay.js
  42. 2
      app/components/Form/Pay/Pay.scss
  43. 3
      app/components/Form/Pay/index.js
  44. 149
      app/components/Form/Request.js
  45. 128
      app/components/Form/Request/Request.js
  46. 2
      app/components/Form/Request/Request.scss
  47. 3
      app/components/Form/Request/index.js
  48. 0
      app/components/Onboarding/Alias/Alias.js
  49. 2
      app/components/Onboarding/Alias/Alias.scss
  50. 3
      app/components/Onboarding/Alias/index.js
  51. 0
      app/components/Onboarding/Autopilot/Autopilot.js
  52. 2
      app/components/Onboarding/Autopilot/Autopilot.scss
  53. 3
      app/components/Onboarding/Autopilot/index.js
  54. 0
      app/components/Onboarding/BtcPayServer/BtcPayServer.js
  55. 2
      app/components/Onboarding/BtcPayServer/BtcPayServer.scss
  56. 3
      app/components/Onboarding/BtcPayServer/index.js
  57. 0
      app/components/Onboarding/ConnectionConfirm/ConnectionConfirm.js
  58. 2
      app/components/Onboarding/ConnectionConfirm/ConnectionConfirm.scss
  59. 3
      app/components/Onboarding/ConnectionConfirm/index.js
  60. 0
      app/components/Onboarding/ConnectionDetails/ConnectionDetails.js
  61. 2
      app/components/Onboarding/ConnectionDetails/ConnectionDetails.scss
  62. 3
      app/components/Onboarding/ConnectionDetails/index.js
  63. 0
      app/components/Onboarding/ConnectionType/ConnectionType.js
  64. 2
      app/components/Onboarding/ConnectionType/ConnectionType.scss
  65. 3
      app/components/Onboarding/ConnectionType/index.js
  66. 0
      app/components/Onboarding/FormContainer/FormContainer.js
  67. 2
      app/components/Onboarding/FormContainer/FormContainer.scss
  68. 3
      app/components/Onboarding/FormContainer/index.js
  69. 4
      app/components/Onboarding/InitWallet/InitWallet.js
  70. 2
      app/components/Onboarding/InitWallet/InitWallet.scss
  71. 3
      app/components/Onboarding/InitWallet/index.js
  72. 0
      app/components/Onboarding/Login/Login.js
  73. 2
      app/components/Onboarding/Login/Login.scss
  74. 3
      app/components/Onboarding/Login/index.js
  75. 0
      app/components/Onboarding/NewWalletPassword/NewWalletPassword.js
  76. 2
      app/components/Onboarding/NewWalletPassword/NewWalletPassword.scss
  77. 3
      app/components/Onboarding/NewWalletPassword/index.js
  78. 0
      app/components/Onboarding/NewWalletSeed/NewWalletSeed.js
  79. 2
      app/components/Onboarding/NewWalletSeed/NewWalletSeed.scss
  80. 3
      app/components/Onboarding/NewWalletSeed/index.js
  81. 0
      app/components/Onboarding/ReEnterSeed/ReEnterSeed.js
  82. 2
      app/components/Onboarding/ReEnterSeed/ReEnterSeed.scss
  83. 3
      app/components/Onboarding/ReEnterSeed/index.js
  84. 0
      app/components/Onboarding/RecoverForm/RecoverForm.js
  85. 2
      app/components/Onboarding/RecoverForm/RecoverForm.scss
  86. 3
      app/components/Onboarding/RecoverForm/index.js
  87. 0
      app/components/Onboarding/Signup/Signup.js
  88. 2
      app/components/Onboarding/Signup/Signup.scss
  89. 3
      app/components/Onboarding/Signup/index.js
  90. 0
      app/components/Onboarding/Syncing/Syncing.js
  91. 2
      app/components/Onboarding/Syncing/Syncing.scss
  92. 3
      app/components/Onboarding/Syncing/index.js
  93. 0
      app/components/Settings/Fiat/Fiat.js
  94. 2
      app/components/Settings/Fiat/Fiat.scss
  95. 3
      app/components/Settings/Fiat/index.js
  96. 0
      app/components/Settings/Menu/Menu.js
  97. 0
      app/components/Settings/Menu/Menu.scss
  98. 3
      app/components/Settings/Menu/index.js
  99. 3
      app/components/Settings/index.js
  100. 0
      app/components/Wallet/ReceiveModal/ReceiveModal.js

6
app/components/Activity/ActivityModal.js → app/components/Activity/ActivityModal/ActivityModal.js

@ -3,9 +3,9 @@ import PropTypes from 'prop-types'
import Isvg from 'react-inlinesvg'
import x from 'icons/x.svg'
import TransactionModal from './TransactionModal'
import PaymentModal from './PaymentModal'
import InvoiceModal from './InvoiceModal'
import TransactionModal from '../TransactionModal'
import PaymentModal from '../PaymentModal'
import InvoiceModal from '../InvoiceModal'
import styles from './ActivityModal.scss'

2
app/components/Activity/ActivityModal.scss → app/components/Activity/ActivityModal/ActivityModal.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: relative;

3
app/components/Activity/ActivityModal/index.js

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

0
app/components/Activity/Countdown.js → app/components/Activity/Countdown/Countdown.js

2
app/components/Activity/Countdown.scss → app/components/Activity/Countdown/Countdown.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
display: block;

3
app/components/Activity/Countdown/index.js

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

2
app/components/Activity/InvoiceModal.js → app/components/Activity/InvoiceModal/InvoiceModal.js

@ -10,7 +10,7 @@ import { showNotification } from 'lib/utils/notifications'
import FaAngleDown from 'react-icons/lib/fa/angle-down'
import Value from 'components/Value'
import Countdown from './Countdown'
import Countdown from '../Countdown'
import styles from './InvoiceModal.scss'

2
app/components/Activity/InvoiceModal.scss → app/components/Activity/InvoiceModal/InvoiceModal.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Activity/InvoiceModal/index.js

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

0
app/components/Activity/PaymentModal.js → app/components/Activity/PaymentModal/PaymentModal.js

2
app/components/Activity/PaymentModal.scss → app/components/Activity/PaymentModal/PaymentModal.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Activity/PaymentModal/index.js

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

0
app/components/Activity/TransactionModal.js → app/components/Activity/TransactionModal/TransactionModal.js

2
app/components/Activity/TransactionModal.scss → app/components/Activity/TransactionModal/TransactionModal.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Activity/TransactionModal/index.js

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

171
app/components/Contacts/AddChannel.js

@ -1,171 +0,0 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Isvg from 'react-inlinesvg'
import x from 'icons/x.svg'
import styles from './AddChannel.scss'
class AddChannel extends Component {
constructor(props) {
super(props)
this.searchInput = React.createRef()
}
componentDidMount() {
// Focus the search input field.
this.searchInput.current.focus()
}
render() {
const {
contactsform,
closeContactsForm,
openSubmitChannelForm,
updateContactFormSearchQuery,
updateManualFormSearchQuery,
setNode,
activeChannelPubkeys,
nonActiveChannelPubkeys,
pendingOpenChannelPubkeys,
filteredNetworkNodes,
loadingChannelPubkeys,
showManualForm,
openManualForm
} = this.props
const renderRightSide = node => {
if (loadingChannelPubkeys.includes(node.pub_key)) {
return (
<span className={styles.inactive}>
<div className={styles.loading}>
<div className={styles.spinner} />
</div>
</span>
)
}
if (activeChannelPubkeys.includes(node.pub_key)) {
return (
<span className={`${styles.online} ${styles.inactive}`}>
<span>Online</span>
</span>
)
}
if (nonActiveChannelPubkeys.includes(node.pub_key)) {
return (
<span className={`${styles.offline} ${styles.inactive}`}>
<span>Offline</span>
</span>
)
}
if (pendingOpenChannelPubkeys.includes(node.pub_key)) {
return (
<span className={`${styles.pending} ${styles.inactive}`}>
<span>Pending</span>
</span>
)
}
if (!node.addresses.length) {
return <span className={`${styles.private} ${styles.inactive}`}>Private</span>
}
return (
<span
className={styles.connect}
onClick={() => {
// set the node public key for the submit form
setNode(node)
// open the submit form
openSubmitChannelForm()
}}
>
Connect
</span>
)
}
const searchUpdated = search => {
updateContactFormSearchQuery(search)
if (search.includes('@') && search.split('@')[0].length === 66) {
updateManualFormSearchQuery(search)
}
}
return (
<div className={styles.container}>
<header className={styles.header}>
<input
type="text"
placeholder="Search the network..."
className={styles.searchInput}
value={contactsform.searchQuery}
onChange={event => searchUpdated(event.target.value)}
ref={this.searchInput}
/>
<span onClick={closeContactsForm} className={styles.closeIcon}>
<Isvg src={x} />
</span>
</header>
<section className={styles.nodes}>
<ul className={styles.networkResults}>
{filteredNetworkNodes.map(node => (
<li key={node.pub_key}>
<section>
{node.alias.length > 0 ? (
<h2>
<span>{node.alias.trim()}</span>
<span>
({node.pub_key.substr(0, 10)}
...
{node.pub_key.substr(node.pub_key.length - 10)})
</span>
</h2>
) : (
<h2>
<span>{node.pub_key}</span>
</h2>
)}
</section>
<section>{renderRightSide(node)}</section>
</li>
))}
</ul>
</section>
{showManualForm && (
<section className={styles.manualForm}>
<p>
Hm, looks like we can&apos;t see that node from here, wanna try to manually connect?
</p>
<div className={styles.manualConnectButton} onClick={openManualForm}>
Connect Manually
</div>
</section>
)}
</div>
)
}
}
AddChannel.propTypes = {
contactsform: PropTypes.object.isRequired,
closeContactsForm: PropTypes.func.isRequired,
openSubmitChannelForm: PropTypes.func.isRequired,
updateContactFormSearchQuery: PropTypes.func.isRequired,
updateManualFormSearchQuery: PropTypes.func.isRequired,
setNode: PropTypes.func.isRequired,
activeChannelPubkeys: PropTypes.array.isRequired,
nonActiveChannelPubkeys: PropTypes.array.isRequired,
pendingOpenChannelPubkeys: PropTypes.array.isRequired,
filteredNetworkNodes: PropTypes.array.isRequired,
loadingChannelPubkeys: PropTypes.array.isRequired,
showManualForm: PropTypes.bool.isRequired,
openManualForm: PropTypes.func.isRequired
}
export default AddChannel

158
app/components/Contacts/AddChannel/AddChannel.js

@ -0,0 +1,158 @@
import React from 'react'
import PropTypes from 'prop-types'
import Isvg from 'react-inlinesvg'
import x from 'icons/x.svg'
import styles from './AddChannel.scss'
const AddChannel = ({
contactsform,
closeContactsForm,
openSubmitChannelForm,
updateContactFormSearchQuery,
updateManualFormSearchQuery,
setNode,
activeChannelPubkeys,
nonActiveChannelPubkeys,
pendingOpenChannelPubkeys,
filteredNetworkNodes,
loadingChannelPubkeys,
showManualForm,
openManualForm
}) => {
const renderRightSide = node => {
if (loadingChannelPubkeys.includes(node.pub_key)) {
return (
<span className={styles.inactive}>
<div className={styles.loading}>
<div className={styles.spinner} />
</div>
</span>
)
}
if (activeChannelPubkeys.includes(node.pub_key)) {
return (
<span className={`${styles.online} ${styles.inactive}`}>
<span>Online</span>
</span>
)
}
if (nonActiveChannelPubkeys.includes(node.pub_key)) {
return (
<span className={`${styles.offline} ${styles.inactive}`}>
<span>Offline</span>
</span>
)
}
if (pendingOpenChannelPubkeys.includes(node.pub_key)) {
return (
<span className={`${styles.pending} ${styles.inactive}`}>
<span>Pending</span>
</span>
)
}
if (!node.addresses.length) {
return <span className={`${styles.private} ${styles.inactive}`}>Private</span>
}
return (
<span
className={styles.connect}
onClick={() => {
// set the node public key for the submit form
setNode(node)
// open the submit form
openSubmitChannelForm()
}}
>
Connect
</span>
)
}
const searchUpdated = search => {
updateContactFormSearchQuery(search)
if (search.includes('@') && search.split('@')[0].length === 66) {
updateManualFormSearchQuery(search)
}
}
return (
<div className={styles.container}>
<header className={styles.header}>
<input
type="text"
placeholder="Search the network..."
className={styles.searchInput}
value={contactsform.searchQuery}
onChange={event => searchUpdated(event.target.value)}
// ref={input => input && input.focus()}
/>
<span onClick={closeContactsForm} className={styles.closeIcon}>
<Isvg src={x} />
</span>
</header>
<section className={styles.nodes}>
<ul className={styles.networkResults}>
{filteredNetworkNodes.map(node => (
<li key={node.pub_key}>
<section>
{node.alias.length > 0 ? (
<h2>
<span>{node.alias.trim()}</span>
<span>
({node.pub_key.substr(0, 10)}
...
{node.pub_key.substr(node.pub_key.length - 10)})
</span>
</h2>
) : (
<h2>
<span>{node.pub_key}</span>
</h2>
)}
</section>
<section>{renderRightSide(node)}</section>
</li>
))}
</ul>
</section>
{showManualForm && (
<section className={styles.manualForm}>
<p>
Hm, looks like we can&apos;t see that node from here, wanna try to manually connect?
</p>
<div className={styles.manualConnectButton} onClick={openManualForm}>
Connect Manually
</div>
</section>
)}
</div>
)
}
AddChannel.propTypes = {
contactsform: PropTypes.object.isRequired,
closeContactsForm: PropTypes.func.isRequired,
openSubmitChannelForm: PropTypes.func.isRequired,
updateContactFormSearchQuery: PropTypes.func.isRequired,
updateManualFormSearchQuery: PropTypes.func.isRequired,
setNode: PropTypes.func.isRequired,
activeChannelPubkeys: PropTypes.array.isRequired,
nonActiveChannelPubkeys: PropTypes.array.isRequired,
pendingOpenChannelPubkeys: PropTypes.array.isRequired,
filteredNetworkNodes: PropTypes.array.isRequired,
loadingChannelPubkeys: PropTypes.array.isRequired,
showManualForm: PropTypes.bool.isRequired,
openManualForm: PropTypes.func.isRequired
}
export default AddChannel

2
app/components/Contacts/AddChannel.scss → app/components/Contacts/AddChannel/AddChannel.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: relative;

3
app/components/Contacts/AddChannel/index.js

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

4
app/components/Contacts/ChannelForm.js → app/components/Contacts/ChannelForm/ChannelForm.js

@ -4,8 +4,8 @@ import PropTypes from 'prop-types'
import Isvg from 'react-inlinesvg'
import x from 'icons/x.svg'
import ConnectManually from './ConnectManually'
import SubmitChannelForm from './SubmitChannelForm'
import ConnectManually from '../ConnectManually'
import SubmitChannelForm from '../SubmitChannelForm'
import styles from './ChannelForm.scss'

2
app/components/Contacts/ChannelForm.scss → app/components/Contacts/ChannelForm/ChannelForm.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: absolute;

3
app/components/Contacts/ChannelForm/index.js

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

0
app/components/Contacts/ConnectManually.js → app/components/Contacts/ConnectManually/ConnectManually.js

2
app/components/Contacts/ConnectManually.scss → app/components/Contacts/ConnectManually/ConnectManually.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: absolute;

3
app/components/Contacts/ConnectManually/index.js

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

0
app/components/Contacts/ContactModal.js → app/components/Contacts/ContactModal/ContactModal.js

2
app/components/Contacts/ContactModal.scss → app/components/Contacts/ContactModal/ContactModal.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.header {
display: flex;

3
app/components/Contacts/ContactModal/index.js

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

0
app/components/Contacts/ContactsForm.js → app/components/Contacts/ContactsForm/ContactsForm.js

2
app/components/Contacts/ContactsForm.scss → app/components/Contacts/ContactsForm/ContactsForm.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.modal {
position: absolute;

3
app/components/Contacts/ContactsForm/index.js

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

2
app/components/Contacts/Network.js → app/components/Contacts/Network/Network.js

@ -10,7 +10,7 @@ import plus from 'icons/plus.svg'
import search from 'icons/search.svg'
import Value from 'components/Value'
import SuggestedNodes from './SuggestedNodes'
import SuggestedNodes from '../SuggestedNodes'
import styles from './Network.scss'

2
app/components/Contacts/Network.scss → app/components/Contacts/Network/Network.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.network {
position: relative;

3
app/components/Contacts/Network/index.js

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

0
app/components/Contacts/SubmitChannelForm.js → app/components/Contacts/SubmitChannelForm/SubmitChannelForm.js

2
app/components/Contacts/SubmitChannelForm.scss → app/components/Contacts/SubmitChannelForm/SubmitChannelForm.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.content {
padding: 0 40px;

3
app/components/Contacts/SubmitChannelForm/index.js

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

0
app/components/Contacts/SuggestedNodes.js → app/components/Contacts/SuggestedNodes/SuggestedNodes.js

2
app/components/Contacts/SuggestedNodes.scss → app/components/Contacts/SuggestedNodes/SuggestedNodes.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Contacts/SuggestedNodes/index.js

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

0
app/components/Form/Pay.js → app/components/Form/Pay/Pay.js

2
app/components/Form/Pay.scss → app/components/Form/Pay/Pay.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
padding: 0 40px;

3
app/components/Form/Pay/index.js

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

149
app/components/Form/Request.js

@ -1,149 +0,0 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Isvg from 'react-inlinesvg'
import hand from 'icons/hand.svg'
import FaAngleDown from 'react-icons/lib/fa/angle-down'
import { btc } from 'lib/utils'
import AmountInput from 'components/AmountInput'
import styles from './Request.scss'
class Request extends Component {
constructor(props) {
super(props)
this.amountInput = React.createRef()
}
componentDidMount() {
const { setRequestMemo, setRequestAmount } = this.props
// Clear the form of any previous data.
setRequestMemo('')
setRequestAmount('')
// Focus the amount input field.
this.amountInput.current.focusTextInput()
}
render() {
const {
requestform: { amount, memo, showCurrencyFilters },
ticker,
setRequestAmount,
setRequestMemo,
setCurrency,
setRequestCurrencyFilters,
currencyName,
requestFiatAmount,
currentCurrencyFilters,
onRequestSubmit
} = this.props
const onCurrencyFilterClick = currency => {
// change the input amount
setRequestAmount(btc.convert(ticker.currency, currency, amount))
setCurrency(currency)
setRequestCurrencyFilters(false)
}
return (
<div className={styles.container}>
<header className={styles.header}>
<Isvg src={hand} />
<h1>Request Payment</h1>
</header>
<div className={styles.content}>
<section className={styles.amount}>
<div className={styles.top}>
<label htmlFor="amount">Amount</label>
<span />
</div>
<div className={styles.bottom}>
<AmountInput
id="amount"
amount={amount}
currency={ticker.currency}
onChangeEvent={setRequestAmount}
ref={this.amountInput}
/>
<div className={styles.currency}>
<section
className={styles.currentCurrency}
onClick={() => setRequestCurrencyFilters(!showCurrencyFilters)}
>
<span>{currencyName}</span>
<span>
<FaAngleDown />
</span>
</section>
<ul className={showCurrencyFilters ? styles.active : undefined}>
{currentCurrencyFilters.map(filter => (
<li key={filter.key} onClick={() => onCurrencyFilterClick(filter.key)}>
{filter.name}
</li>
))}
</ul>
</div>
</div>
<div className={styles.fiatAmount}>{`${requestFiatAmount || 0} ${
ticker.fiatTicker
}`}</div>
</section>
<section className={styles.memo}>
<div className={styles.top}>
<label htmlFor="memo">Memo</label>
</div>
<div className={styles.bottom}>
<input
type="text"
placeholder="Details about the request"
value={memo}
onChange={event => setRequestMemo(event.target.value)}
id="memo"
/>
</div>
</section>
<section className={styles.submit}>
<div
className={`${styles.button} ${amount > 0 ? styles.active : undefined}`}
onClick={onRequestSubmit}
>
Request
</div>
</section>
</div>
</div>
)
}
}
Request.propTypes = {
requestform: PropTypes.shape({
amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
memo: PropTypes.string
}).isRequired,
requestFiatAmount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
currencyName: PropTypes.string.isRequired,
currentCurrencyFilters: PropTypes.array.isRequired,
setRequestAmount: PropTypes.func.isRequired,
setRequestMemo: PropTypes.func.isRequired,
onRequestSubmit: PropTypes.func.isRequired,
setCurrency: PropTypes.func.isRequired,
setRequestCurrencyFilters: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired
}
export default Request

128
app/components/Form/Request/Request.js

@ -0,0 +1,128 @@
import React from 'react'
import PropTypes from 'prop-types'
import Isvg from 'react-inlinesvg'
import hand from 'icons/hand.svg'
import FaAngleDown from 'react-icons/lib/fa/angle-down'
import { btc } from 'lib/utils'
import AmountInput from 'components/AmountInput'
import styles from './Request.scss'
const Request = ({
requestform: { amount, memo, showCurrencyFilters },
ticker,
setRequestAmount,
setRequestMemo,
setCurrency,
setRequestCurrencyFilters,
currencyName,
requestFiatAmount,
currentCurrencyFilters,
onRequestSubmit
}) => {
const onCurrencyFilterClick = currency => {
// change the input amount
setRequestAmount(btc.convert(ticker.currency, currency, amount))
setCurrency(currency)
setRequestCurrencyFilters(false)
}
return (
<div className={styles.container}>
<header className={styles.header}>
<Isvg src={hand} />
<h1>Request Payment</h1>
</header>
<div className={styles.content}>
<section className={styles.amount}>
<div className={styles.top}>
<label htmlFor="amount">Amount</label>
<span />
</div>
<div className={styles.bottom}>
<AmountInput
id="amount"
amount={amount}
currency={ticker.currency}
onChangeEvent={setRequestAmount}
/>
<div className={styles.currency}>
<section
className={styles.currentCurrency}
onClick={() => setRequestCurrencyFilters(!showCurrencyFilters)}
>
<span>{currencyName}</span>
<span>
<FaAngleDown />
</span>
</section>
<ul className={showCurrencyFilters ? styles.active : undefined}>
{currentCurrencyFilters.map(filter => (
<li key={filter.key} onClick={() => onCurrencyFilterClick(filter.key)}>
{filter.name}
</li>
))}
</ul>
</div>
</div>
<div className={styles.fiatAmount}>{`${requestFiatAmount || 0} ${
ticker.fiatTicker
}`}</div>
</section>
<section className={styles.memo}>
<div className={styles.top}>
<label htmlFor="memo">Memo</label>
</div>
<div className={styles.bottom}>
<input
type="text"
placeholder="Details about the request"
value={memo}
onChange={event => setRequestMemo(event.target.value)}
id="memo"
/>
</div>
</section>
<section className={styles.submit}>
<div
className={`${styles.button} ${amount > 0 ? styles.active : undefined}`}
onClick={onRequestSubmit}
>
Request
</div>
</section>
</div>
</div>
)
}
Request.propTypes = {
requestform: PropTypes.shape({
amount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
memo: PropTypes.string
}).isRequired,
requestFiatAmount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
currencyName: PropTypes.string.isRequired,
currentCurrencyFilters: PropTypes.array.isRequired,
setRequestAmount: PropTypes.func.isRequired,
setRequestMemo: PropTypes.func.isRequired,
onRequestSubmit: PropTypes.func.isRequired,
setCurrency: PropTypes.func.isRequired,
setRequestCurrencyFilters: PropTypes.func.isRequired,
ticker: PropTypes.object.isRequired
}
export default Request

2
app/components/Form/Request.scss → app/components/Form/Request/Request.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
padding: 0 40px;

3
app/components/Form/Request/index.js

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

0
app/components/Onboarding/Alias.js → app/components/Onboarding/Alias/Alias.js

2
app/components/Onboarding/Alias.scss → app/components/Onboarding/Alias/Alias.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.alias {
background: transparent;

3
app/components/Onboarding/Alias/index.js

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

0
app/components/Onboarding/Autopilot.js → app/components/Onboarding/Autopilot/Autopilot.js

2
app/components/Onboarding/Autopilot.scss → app/components/Onboarding/Autopilot/Autopilot.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Onboarding/Autopilot/index.js

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

0
app/components/Onboarding/BtcPayServer.js → app/components/Onboarding/BtcPayServer/BtcPayServer.js

2
app/components/Onboarding/BtcPayServer.scss → app/components/Onboarding/BtcPayServer/BtcPayServer.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Onboarding/BtcPayServer/index.js

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

0
app/components/Onboarding/ConnectionConfirm.js → app/components/Onboarding/ConnectionConfirm/ConnectionConfirm.js

2
app/components/Onboarding/ConnectionConfirm.scss → app/components/Onboarding/ConnectionConfirm/ConnectionConfirm.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Onboarding/ConnectionConfirm/index.js

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

0
app/components/Onboarding/ConnectionDetails.js → app/components/Onboarding/ConnectionDetails/ConnectionDetails.js

2
app/components/Onboarding/ConnectionDetails.scss → app/components/Onboarding/ConnectionDetails/ConnectionDetails.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Onboarding/ConnectionDetails/index.js

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

0
app/components/Onboarding/ConnectionType.js → app/components/Onboarding/ConnectionType/ConnectionType.js

2
app/components/Onboarding/ConnectionType.scss → app/components/Onboarding/ConnectionType/ConnectionType.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Onboarding/ConnectionType/index.js

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

0
app/components/Onboarding/FormContainer.js → app/components/Onboarding/FormContainer/FormContainer.js

2
app/components/Onboarding/FormContainer.scss → app/components/Onboarding/FormContainer/FormContainer.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: relative;

3
app/components/Onboarding/FormContainer/index.js

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

4
app/components/Onboarding/InitWallet.js → app/components/Onboarding/InitWallet/InitWallet.js

@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import Login from './Login'
import Signup from './Signup'
import Signup from 'components/Onboarding/Signup'
import Login from 'components/Onboarding/Login'
import styles from './InitWallet.scss'
const InitWallet = ({ hasSeed, loginProps, signupProps }) => (

2
app/components/Onboarding/InitWallet.scss → app/components/Onboarding/InitWallet/InitWallet.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: relative;

3
app/components/Onboarding/InitWallet/index.js

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

0
app/components/Onboarding/Login.js → app/components/Onboarding/Login/Login.js

2
app/components/Onboarding/Login.scss → app/components/Onboarding/Login/Login.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: relative;

3
app/components/Onboarding/Login/index.js

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

0
app/components/Onboarding/NewWalletPassword.js → app/components/Onboarding/NewWalletPassword/NewWalletPassword.js

2
app/components/Onboarding/NewWalletPassword.scss → app/components/Onboarding/NewWalletPassword/NewWalletPassword.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.input:nth-child(2) {
margin-top: 30px;

3
app/components/Onboarding/NewWalletPassword/index.js

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

0
app/components/Onboarding/NewWalletSeed.js → app/components/Onboarding/NewWalletSeed/NewWalletSeed.js

2
app/components/Onboarding/NewWalletSeed.scss → app/components/Onboarding/NewWalletSeed/NewWalletSeed.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
font-size: 14px;

3
app/components/Onboarding/NewWalletSeed/index.js

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

0
app/components/Onboarding/ReEnterSeed.js → app/components/Onboarding/ReEnterSeed/ReEnterSeed.js

2
app/components/Onboarding/ReEnterSeed.scss → app/components/Onboarding/ReEnterSeed/ReEnterSeed.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.seedContainer {
display: flex;

3
app/components/Onboarding/ReEnterSeed/index.js

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

0
app/components/Onboarding/RecoverForm.js → app/components/Onboarding/RecoverForm/RecoverForm.js

2
app/components/Onboarding/RecoverForm.scss → app/components/Onboarding/RecoverForm/RecoverForm.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.seedContainer {
position: relative;

3
app/components/Onboarding/RecoverForm/index.js

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

0
app/components/Onboarding/Signup.js → app/components/Onboarding/Signup/Signup.js

2
app/components/Onboarding/Signup.scss → app/components/Onboarding/Signup/Signup.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
color: $white;

3
app/components/Onboarding/Signup/index.js

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

0
app/components/Onboarding/Syncing.js → app/components/Onboarding/Syncing/Syncing.js

2
app/components/Onboarding/Syncing.scss → app/components/Onboarding/Syncing/Syncing.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.container {
position: relative;

3
app/components/Onboarding/Syncing/index.js

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

0
app/components/Settings/Fiat.js → app/components/Settings/Fiat/Fiat.js

2
app/components/Settings/Fiat.scss → app/components/Settings/Fiat/Fiat.scss

@ -1,4 +1,4 @@
@import '../../styles/variables.scss';
@import '../../../styles/variables.scss';
.submenuHeader {
padding: 20px;

3
app/components/Settings/Fiat/index.js

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

0
app/components/Settings/Menu.js → app/components/Settings/Menu/Menu.js

0
app/components/Settings/Menu.scss → app/components/Settings/Menu/Menu.scss

3
app/components/Settings/Menu/index.js

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

3
app/components/Settings/index.js

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

0
app/components/Wallet/ReceiveModal.js → app/components/Wallet/ReceiveModal/ReceiveModal.js

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save