diff --git a/.all-contributorsrc b/.all-contributorsrc index b3eafe3..09bef1c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -154,6 +154,15 @@ "contributions": [ "code" ] + }, + { + "login": "KeshShan", + "name": "Keshan Nageswaran", + "avatar_url": "https://avatars3.githubusercontent.com/u/12506034?v=4", + "profile": "http://keshShan.github.io", + "contributions": [ + "code" + ] } ], "repoType": "github" diff --git a/components/ConversionPanel.js b/components/ConversionPanel.js index 1358f19..d743ac9 100644 --- a/components/ConversionPanel.js +++ b/components/ConversionPanel.js @@ -137,7 +137,8 @@ export default class ConversionPanel extends PureComponent { clearText = () => { this.setState({ - value: "" + value: "", + resultValue: "" }); }; diff --git a/components/Layout.js b/components/Layout.js index 06cbb25..451c5fd 100644 --- a/components/Layout.js +++ b/components/Layout.js @@ -81,14 +81,23 @@ export default class Layout extends PureComponent { this.setKey(this.props.pathname); } + componentWillUnmount() { + window.removeEventListener("beforeunload", this.alertExistHandler); + } + componentDidMount() { Layout.loadCarbonAds(); + window.addEventListener("beforeunload", this.alertExistHandler); } componentWillReceiveProps({ pathname }) { this.setKey(pathname); } + alertExistHandler(event) { + event.preventDefault(); + return (event.returnValue = "Are you sure you want to close?"); // currently newer version of chrome and other browsers deosn't support customized string so returning a string or empty string won't be of much impact + } static loadCarbonAds() { // const script = document.createElement("script"); // diff --git a/readme.md b/readme.md index 6b52b15..c5fd61a 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds | [
Ritesh Kumar](http://riteshkr.com)
[📖](https://github.com/ritz078/transform-www/commits?author=ritz078 "Documentation") [💻](https://github.com/ritz078/transform-www/commits?author=ritz078 "Code") [🤔](#ideas-ritz078 "Ideas, Planning, & Feedback") [👀](#review-ritz078 "Reviewed Pull Requests") | [
Florian Gilcher](http://asquera.de)
[💻](https://github.com/ritz078/transform-www/commits?author=skade "Code") | [
Pascal Hertleif](http://pascalhertleif.de/)
[💻](https://github.com/ritz078/transform-www/commits?author=killercup "Code") | [
Lado Lomidze](http://landish.github.io)
[💻](https://github.com/ritz078/transform-www/commits?author=Landish "Code") | [
Mattia Manzati](https://github.com/mattiamanzati)
[💻](https://github.com/ritz078/transform-www/commits?author=mattiamanzati "Code") | [
Mohammad Rajabifard](https://tarino.ir)
[🤔](#ideas-morajabi "Ideas, Planning, & Feedback") [💻](https://github.com/ritz078/transform-www/commits?author=morajabi "Code") | [
Raathigeshan Kugarajan](http://raathigesh.com/)
[💻](https://github.com/ritz078/transform-www/commits?author=Raathigesh "Code") | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | [
Gyandeep Singh](https://gyandeeps.com)
[💻](https://github.com/ritz078/transform-www/commits?author=gyandeeps "Code") | [
Matt Holt](https://matt.life)
[💻](https://github.com/ritz078/transform-www/commits?author=mholt "Code") | [
sreenivas alapati](https://medium.com/@sreenivas)
[💻](https://github.com/ritz078/transform-www/commits?author=cg-cnu "Code") | [
Boris Cherny](https://performancejs.com)
[💻](https://github.com/ritz078/transform-www/commits?author=bcherny "Code") | [
Mark Lussier](http://www.twitter.com/intabulas)
[💻](https://github.com/ritz078/transform-www/commits?author=intabulas "Code") | [
Brice BERNARD](https://github.com/brikou)
[💻](https://github.com/ritz078/transform-www/commits?author=brikou "Code") | [
Satyajit Sahoo](https://twitter.com/@satya164)
[💻](https://github.com/ritz078/transform-www/commits?author=satya164 "Code") | -| [
Shane Osbourne](https://medium.com/@shakyShane)
[💻](https://github.com/ritz078/transform-www/commits?author=shakyShane "Code") | [
Rongjian Zhang](https://github.com/pd4d10)
[💻](https://github.com/ritz078/transform-www/commits?author=pd4d10 "Code") | +| [
Shane Osbourne](https://medium.com/@shakyShane)
[💻](https://github.com/ritz078/transform-www/commits?author=shakyShane "Code") | [
Rongjian Zhang](https://github.com/pd4d10)
[💻](https://github.com/ritz078/transform-www/commits?author=pd4d10 "Code") | [
Keshan Nageswaran](http://keshShan.github.io)
[💻](https://github.com/ritz078/transform-www/commits?author=KeshShan "Code") | This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!