Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
feat: add details about swap to success page (#114)
Browse files Browse the repository at this point in the history
* feat: add details about swap to success page

* refactor: confetti component

* refactor: review changes

* refactor: swap
  • Loading branch information
ImmanuelSegol authored and michael1011 committed Mar 4, 2019
1 parent 7c75be9 commit efdaad9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
16 changes: 10 additions & 6 deletions src/components/confetti/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ const confettiStyles = () => ({
justifyContent: 'center',
},
text: {
fontSize: '30px',
fontSize: '40px',
},
notifie: {
fontSize: '25px',
fontWeight: 300,
},
});

const StyledConfetti = ({ classes }) => (
const Confetti = ({ classes, notifie }) => (
<View className={classes.wrapper}>
<ReactConfetti
height={window.innerHeight}
Expand All @@ -25,13 +29,13 @@ const StyledConfetti = ({ classes }) => (
recycle={false}
/>
<span className={classes.text}>Viola! Swap successful!</span>
{notifie(classes.notifie)}
</View>
);

StyledConfetti.propTypes = {
Confetti.propTypes = {
classes: PropTypes.object.isRequired,
notifie: PropTypes.func,
};

const Confetti = injectSheet(confettiStyles)(StyledConfetti);

export default Confetti;
export default injectSheet(confettiStyles)(Confetti);
6 changes: 1 addition & 5 deletions src/components/stepswizard/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import View from '../view';

const Step = ({ render, stage, num }) => {
if (stage === num) {
return render();
} else return null;
};
const Step = ({ render, stage, num }) => (stage === num ? render() : null);

Step.propTypes = {
num: PropTypes.number,
Expand Down
14 changes: 13 additions & 1 deletion src/views/reverse/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,19 @@ class ReverseSwap extends React.Component {
/>
)}
/>
<StepsWizard.Step num={4} render={() => <Confetti />} />
<StepsWizard.Step
num={4}
render={() => (
<Confetti
notifie={style => (
<span className={style}>
You sent {swapInfo.baseAmount} {swapInfo.base} and
received {swapInfo.quoteAmount} {swapInfo.quote}
</span>
)}
/>
)}
/>
</StepsWizard.Steps>
<StepsWizard.Controls>
<StepsWizard.Control
Expand Down
14 changes: 13 additions & 1 deletion src/views/swap/swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,19 @@ const Swap = ({
/>
)}
/>
<StepsWizard.Step num={4} render={() => <Confetti />} />
<StepsWizard.Step
num={4}
render={() => (
<Confetti
notifie={style => (
<span className={style}>
You sent {swapInfo.baseAmount} {swapInfo.base} and
received {swapInfo.quoteAmount} {swapInfo.quote}
</span>
)}
/>
)}
/>
</StepsWizard.Steps>
<StepsWizard.Controls>
<StepsWizard.Control
Expand Down

0 comments on commit efdaad9

Please sign in to comment.