Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
xJkit committed Apr 20, 2018
1 parent a48d515 commit b4fd214
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions example/src/Containers/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ class Settings extends React.Component {
const isModified = initialValue !== currentValue;
return (
<div>
<GoodBye when={isModified}>
<GoodBye
when={isModified}
alertBeforeUnload
alertMessage="Save before leave. Do you want to continue?" // only work for IE
>
{({ isShow, handleOk, handleCancel }) =>
isShow && (
<Modal>
Expand Down Expand Up @@ -50,7 +54,12 @@ class Settings extends React.Component {
}
</GoodBye>
<h2>Settings Page</h2>
<div style={{ color: isModified ? 'red' : 'black' }}>
<div
style={{
color: isModified ? 'red' : 'black',
marginBottom: 24
}}
>
<span>Portfolio Status: </span>
<select
value={currentValue}
Expand All @@ -60,6 +69,13 @@ class Settings extends React.Component {
<option value="private">Private</option>
</select>
</div>
<div style={{ color: 'grey' }}>
<p>change status and do the following:</p>
<ul className="note">
<li>change route will popup custom dialogue</li>
<li>reload or close window will trigger browser alert </li>
</ul>
</div>
</div>
);
}
Expand Down

0 comments on commit b4fd214

Please sign in to comment.