accidently swapped verb and namespace order for action creators originally; fixed

This commit is contained in:
Daniel Ternyak 2017-06-20 01:28:22 -05:00
parent ba6d46e91d
commit 1a4fac1dec
7 changed files with 55 additions and 55 deletions

View File

@ -5,18 +5,18 @@ import {
GENERATE_WALLET_SHOW_PASSWORD
} from 'actions/generateWalletConstants';
export const generateWalletShowPassword = () => {
export const showPasswordGenerateWallet = () => {
return { type: GENERATE_WALLET_SHOW_PASSWORD };
};
export const generateWalletGenerateFile = () => {
export const generateFileGenerateWallet = () => {
return { type: GENERATE_WALLET_FILE };
};
export const generateWalletDownloadFile = () => {
export const downloadFileGenerateWallet = () => {
return { type: GENERATE_WALLET_DOWNLOAD_FILE };
};
export const generateWalletConfirmContinueToPaper = () => {
export const confirmContinueToPaperGenerateWallet = () => {
return { type: GENERATE_WALLET_CONFIRM_CONTINUE_TO_PAPER };
};

View File

@ -6,35 +6,35 @@ import {
SWAP_UPDATE_BITY_RATES
} from './swapConstants';
export const swapOriginKind = value => {
export const originKindSwap = value => {
return {
type: SWAP_ORIGIN_KIND,
value
};
};
export const swapDestinationKind = value => {
export const destinationKindSwap = value => {
return {
type: SWAP_DESTINATION_KIND,
value
};
};
export const swapOriginAmount = value => {
export const originAmountSwap = value => {
return {
type: SWAP_ORIGIN_AMOUNT,
value
};
};
export const swapDestinationAmount = value => {
export const destinationAmountSwap = value => {
return {
type: SWAP_DESTINATION_AMOUNT,
value
};
};
export const swapUpdateBityRates = value => {
export const updateBityRatesSwap = value => {
return {
type: SWAP_UPDATE_BITY_RATES,
value

View File

@ -31,10 +31,10 @@ class GenerateWalletPasswordComponent extends Component {
hasDownloadedWalletFile: PropTypes.bool,
canProceedToPaper: PropTypes.bool,
// actions
generateWalletShowPassword: PropTypes.func,
generateWalletGenerateFile: PropTypes.func,
generateWalletDownloadFile: PropTypes.func,
generateWalletConfirmContinueToPaper: PropTypes.func
showPasswordGenerateWallet: PropTypes.func,
generateFileGenerateWallet: PropTypes.func,
downloadFileGenerateWallet: PropTypes.func,
confirmContinueToPaperGenerateWallet: PropTypes.func
};
continueToPaper() {}
@ -51,10 +51,10 @@ class GenerateWalletPasswordComponent extends Component {
showPassword,
generateWalletFile,
hasDownloadedWalletFile,
generateWalletShowPassword,
generateWalletGenerateFile,
generateWalletDownloadFile,
generateWalletConfirmContinueToPaper
showPasswordGenerateWallet,
generateFileGenerateWallet,
downloadFileGenerateWallet,
confirmContinueToPaperGenerateWallet
} = this.props;
return (
@ -72,13 +72,13 @@ class GenerateWalletPasswordComponent extends Component {
validate={[required, minLength9]}
component={GenerateWalletPasswordInputComponent}
showPassword={showPassword}
generateWalletShowPassword={generateWalletShowPassword}
showPasswordGenerateWallet={showPasswordGenerateWallet}
name="password"
type="text"
/>
<br />
<button
onClick={() => generateWalletGenerateFile()}
onClick={() => generateFileGenerateWallet()}
disabled={
generateWalletPassword
? generateWalletPassword.syncErrors
@ -114,7 +114,7 @@ class GenerateWalletPasswordComponent extends Component {
download="UTC--2017-04-26T23-07-03.538Z--c5b7fff4e1669e38e8d6bc8fffe7e562b2b70f43"
aria-label="Download Keystore File (UTC / JSON · Recommended · Encrypted)"
aria-describedby="x_KeystoreDesc"
onClick={() => generateWalletDownloadFile()}
onClick={() => downloadFileGenerateWallet()}
>
{translate('x_Download')}
</a>
@ -140,7 +140,7 @@ class GenerateWalletPasswordComponent extends Component {
className={`btn btn-info ${hasDownloadedWalletFile
? ''
: 'disabled'}`}
onClick={() => generateWalletConfirmContinueToPaper()}
onClick={() => confirmContinueToPaperGenerateWallet()}
>
{' '}I understand. Continue.{' '}
</a>

View File

@ -7,7 +7,7 @@ export default class GenerateWalletPasswordInputComponent extends Component {
}
static propTypes = {
generateWalletShowPassword: PropTypes.func,
showPasswordGenerateWallet: PropTypes.func,
showPassword: PropTypes.bool,
input: PropTypes.object,
meta: PropTypes.object
@ -31,7 +31,7 @@ export default class GenerateWalletPasswordInputComponent extends Component {
aria-label="Enter a strong password (at least 9 characters)"
/>
<span
onClick={() => this.props.generateWalletShowPassword()}
onClick={() => this.props.showPasswordGenerateWallet()}
aria-label="make password visible"
role="button"
className="input-group-addon eye"

View File

@ -17,10 +17,10 @@ class GenerateWallet extends Component {
generateWalletFile: PropTypes.bool,
canProceedToPaper: PropTypes.bool,
// actions
generateWalletShowPassword: PropTypes.func,
generateWalletGenerateFile: PropTypes.func,
generateWalletDownloadFile: PropTypes.func,
generateWalletConfirmContinueToPaper: PropTypes.func
showPasswordGenerateWallet: PropTypes.func,
generateFileGenerateWallet: PropTypes.func,
downloadFileGenerateWallet: PropTypes.func,
confirmContinueToPaperGenerateWallet: PropTypes.func
};
render() {

View File

@ -44,10 +44,10 @@ export default class WantToSwapMy extends Component {
destinationKind: PropTypes.string,
destinationKindOptions: PropTypes.array,
originKindOptions: PropTypes.array,
swapOriginKind: PropTypes.func,
swapDestinationKind: PropTypes.func,
swapOriginAmount: PropTypes.func,
swapDestinationAmount: PropTypes.func
originKindSwap: PropTypes.func,
destinationKindSwap: PropTypes.func,
originAmountSwap: PropTypes.func,
destinationAmountSwap: PropTypes.func
};
onClickStartSwap() {}
@ -60,38 +60,38 @@ export default class WantToSwapMy extends Component {
this.props.destinationKind
);
let bityRate = this.props.bityRates[pairName];
this.props.swapOriginAmount(originAmountAsNumber);
this.props.swapDestinationAmount(originAmountAsNumber * bityRate);
this.props.originAmountSwap(originAmountAsNumber);
this.props.destinationAmountSwap(originAmountAsNumber * bityRate);
} else {
this.props.swapOriginAmount('');
this.props.swapDestinationAmount('');
this.props.originAmountSwap('');
this.props.destinationAmountSwap('');
}
};
onChangeDestinationAmount(amount) {
let destinationAmountAsNumber = parseFloat(amount);
if (destinationAmountAsNumber) {
this.props.swapDestinationAmount(destinationAmountAsNumber);
this.props.destinationAmountSwap(destinationAmountAsNumber);
let pairName = combineAndUpper(
this.props.destinationKind,
this.props.originKind
);
let bityRate = this.props.bityRates[pairName];
this.props.swapOriginAmount(destinationAmountAsNumber * bityRate);
this.props.originAmountSwap(destinationAmountAsNumber * bityRate);
} else {
this.props.swapOriginAmount('');
this.props.swapDestinationAmount('');
this.props.originAmountSwap('');
this.props.destinationAmountSwap('');
}
}
async onChangeDestinationKind(event) {
let newDestinationKind = event.target.value;
this.props.swapDestinationKind(newDestinationKind);
this.props.destinationKindSwap(newDestinationKind);
}
async onChangeOriginKind(event) {
let newOriginKind = event.target.value;
this.props.swapOriginKind(newOriginKind);
this.props.originKindSwap(newOriginKind);
}
render() {

View File

@ -21,11 +21,11 @@ class Swap extends Component {
destinationKind: PropTypes.string,
destinationKindOptions: PropTypes.array,
originKindOptions: PropTypes.array,
swapOriginKind: PropTypes.func,
swapDestinationKind: PropTypes.func,
swapOriginAmount: PropTypes.func,
swapDestinationAmount: PropTypes.func,
swapUpdateBityRates: PropTypes.func
originKindSwap: PropTypes.func,
destinationKindSwap: PropTypes.func,
originAmountSwap: PropTypes.func,
destinationAmountSwap: PropTypes.func,
updateBityRatesSwap: PropTypes.func
};
componentDidMount() {
@ -38,7 +38,7 @@ class Swap extends Component {
!bityRates.BTCREP
) {
this.bity.getAllRates().then(data => {
this.props.swapUpdateBityRates(data);
this.props.updateBityRatesSwap(data);
});
}
}
@ -52,10 +52,10 @@ class Swap extends Component {
destinationKind,
destinationKindOptions,
originKindOptions,
swapOriginKind,
swapDestinationKind,
swapOriginAmount,
swapDestinationAmount
originKindSwap,
destinationKindSwap,
originAmountSwap,
destinationAmountSwap
} = this.props;
let wantToSwapMyProps = {
@ -66,10 +66,10 @@ class Swap extends Component {
destinationKind,
destinationKindOptions,
originKindOptions,
swapOriginKind,
swapDestinationKind,
swapOriginAmount,
swapDestinationAmount
originKindSwap,
destinationKindSwap,
originAmountSwap,
destinationAmountSwap
};
return (