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

Commit

Permalink
feat: prompt component (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImmanuelSegol authored and michael1011 committed Dec 10, 2018
1 parent 29962db commit 5e88fd0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/prompt/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

const Prompt = () => {
window.onbeforeunload = () => {
return true;
};
return <span style={{ display: 'none' }} />;
};

export default Prompt;
2 changes: 2 additions & 0 deletions src/views/refund/refund.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import injectSheet from 'react-jss';
import { FaArrowRight } from 'react-icons/fa';
import Background from '../../components/background';
import StepsWizard from '../../components/stepswizard';
import Prompt from '../../components/prompt';
import View from '../../components/view';
import { StepOne, StepTwo, StepFour } from './steps';

Expand Down Expand Up @@ -41,6 +42,7 @@ class Refund extends React.Component {
const { classes, inRefundMode, goHome } = this.props;
return (
<Background>
<Prompt />
<View className={classes.wrapper}>
<StepsWizard
dark={true}
Expand Down
2 changes: 2 additions & 0 deletions src/views/swap/swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { generateKeys } from '../../action';
import View from '../../components/view';
import BackGround from '../../components/background';
import StepsWizard from '../../components/stepswizard';
import Prompt from '../../components/prompt';
import { FEE } from '../../constants/fees';
import { StepOne, StepTwo, StepThree, StepFour } from './steps';

Expand Down Expand Up @@ -51,6 +52,7 @@ const Swap = ({
}) => {
return (
<BackGround>
<Prompt />
<View className={classes.wrapper}>
<StepsWizard
range={4}
Expand Down

0 comments on commit 5e88fd0

Please sign in to comment.