-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4d5ab9
commit 0171db6
Showing
2 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
'use strict'; | ||
|
||
let $ = window.cwrcQuery | ||
if ($ === undefined) { | ||
let prevJQuery = window.jQuery | ||
$ = require('jquery') | ||
window.jQuery = $ | ||
require('bootstrap') | ||
window.jQuery = prevJQuery | ||
window.cwrcQuery = $ | ||
} | ||
|
||
let Cookies = require('js-cookie'); | ||
|
||
import React, {Component, Fragment} from 'react' | ||
import { Modal, Button } from 'react-bootstrap'; | ||
|
||
function doLogOut() { | ||
Cookies.remove('cwrc-token'); | ||
window.location.reload(); | ||
} | ||
|
||
class LogOutDialog extends Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
const handleClose = this.props.handleClose; | ||
return ( | ||
<Fragment> | ||
<Modal.Header>CWRC-Writer Logout</Modal.Header> | ||
<Modal.Body> | ||
<Fragment> | ||
<p>You are about to log out of CWRC-Writer (i.e. revoke the GitHub authentication). Any unsaved changes will be lost.</p> | ||
<p>Do you want to continue?</p> | ||
</Fragment> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button onClick={handleClose}> | ||
No, Cancel and Return | ||
</Button> | ||
<Button bsStyle="success" onClick={doLogOut}> | ||
Yes, Log Out | ||
</Button> | ||
</Modal.Footer> | ||
</Fragment> | ||
) | ||
} | ||
} | ||
|
||
export default LogOutDialog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters