Skip to content

Commit b4fd214

Browse files
committed
Update example
1 parent a48d515 commit b4fd214

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

example/src/Containers/Settings.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ class Settings extends React.Component {
1717
const isModified = initialValue !== currentValue;
1818
return (
1919
<div>
20-
<GoodBye when={isModified}>
20+
<GoodBye
21+
when={isModified}
22+
alertBeforeUnload
23+
alertMessage="Save before leave. Do you want to continue?" // only work for IE
24+
>
2125
{({ isShow, handleOk, handleCancel }) =>
2226
isShow && (
2327
<Modal>
@@ -50,7 +54,12 @@ class Settings extends React.Component {
5054
}
5155
</GoodBye>
5256
<h2>Settings Page</h2>
53-
<div style={{ color: isModified ? 'red' : 'black' }}>
57+
<div
58+
style={{
59+
color: isModified ? 'red' : 'black',
60+
marginBottom: 24
61+
}}
62+
>
5463
<span>Portfolio Status: </span>
5564
<select
5665
value={currentValue}
@@ -60,6 +69,13 @@ class Settings extends React.Component {
6069
<option value="private">Private</option>
6170
</select>
6271
</div>
72+
<div style={{ color: 'grey' }}>
73+
<p>change status and do the following:</p>
74+
<ul className="note">
75+
<li>change route will popup custom dialogue</li>
76+
<li>reload or close window will trigger browser alert </li>
77+
</ul>
78+
</div>
6379
</div>
6480
);
6581
}

0 commit comments

Comments
 (0)