Skip to content

Commit eaebbde

Browse files
committed
Update example
1 parent 2ef1251 commit eaebbde

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

example/src/Containers/Portfolio.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import React from 'react';
2+
3+
/** Use Your Own Custom Save Reminder Component */
24
import SaveReminder from '../components/SaveReminder';
35

46
class Portfolio extends React.Component {
@@ -15,7 +17,11 @@ class Portfolio extends React.Component {
1517
const isValueModified = initialValue !== currentValue;
1618
return (
1719
<div>
18-
<SaveReminder when={initialValue !== currentValue} />
20+
<SaveReminder
21+
when={initialValue !== currentValue}
22+
alertBeforeUnload
23+
alertMessage="No! No! No! Save before leave! Do you want to leave? Q.Q" // only work for IE
24+
/>
1925
<h2>Portfolio Page</h2>
2026
<span>Your Name:</span>
2127
<span>

example/src/Containers/Settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Settings extends React.Component {
2020
<GoodBye
2121
when={isModified}
2222
alertBeforeUnload
23-
alertMessage="Save before leave. Do you want to continue?" // only work for IE
23+
alertMessage="No! No! No! Save before leave! Do you want to leave? Q.Q" // only work for IE
2424
>
2525
{({ isShow, handleOk, handleCancel }) =>
2626
isShow && (

example/src/components/SaveReminder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import '@trendmicro/react-modal/dist/react-modal.css';
99
/** */
1010

1111
/** Custom Common Save Reminder Modal */
12-
export default ({ when }) => (
13-
<GoodBye when={when}>
12+
export default (props) => (
13+
<GoodBye {...props}>
1414
{({ isShow, handleCancel, handleOk }) => isShow && (
1515
<Modal
1616
show

0 commit comments

Comments
 (0)