-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Showing
394 changed files
with
16,424 additions
and
9,636 deletions.
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
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
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
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
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,57 @@ | ||
/* jshint ignore:start */ | ||
import React from 'react'; | ||
import ajax from 'misago/services/ajax' | ||
|
||
export default class AcceptAgreement extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { submiting: false }; | ||
} | ||
|
||
handleDecline = () => { | ||
if (this.state.submiting) return; | ||
|
||
const confirmation = confirm(gettext("Declining will result in immediate deactivation and deletion of your account. This action is not reversible.")); | ||
if (!confirmation) return; | ||
|
||
this.setState({ submiting: true }); | ||
|
||
ajax.post(this.props.api, { accept: false }).then(() => { | ||
location.reload(true) | ||
}) | ||
} | ||
|
||
handleAccept = () => { | ||
if (this.state.submiting) return; | ||
|
||
this.setState({ submiting: true }); | ||
|
||
ajax.post(this.props.api, { accept: true }).then(() => { | ||
location.reload(true) | ||
}) | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<button | ||
className="btn btn-default" | ||
disabled={this.state.submiting} | ||
type="buton" | ||
onClick={this.handleDecline} | ||
> | ||
{gettext("Decline")} | ||
</button> | ||
<button | ||
className="btn btn-primary" | ||
disabled={this.state.submiting} | ||
type="buton" | ||
onClick={this.handleAccept} | ||
> | ||
{gettext("Accept and continue")} | ||
</button> | ||
</div> | ||
); | ||
} | ||
} |
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
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
Oops, something went wrong.