Skip to content

Commit

Permalink
Disable iOS bouncing
Browse files Browse the repository at this point in the history
  • Loading branch information
kokororin committed Jun 24, 2018
1 parent 24749f0 commit 91a674f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"autobind-decorator": "^1.4.1",
"classlist-polyfill": "^1.2.0",
"classnames": "^2.2.5",
"inobounce": "^0.1.6",
"jszip": "^3.1.4",
"material-design-icons": "^3.0.1",
"material-design-lite": "^1.2.1",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class Login extends React.Component {
this.props.authData.expires_at > moment().unix()
) {
return (
<div>
<React.Fragment>
<div styleName="avatar">
<span styleName="name">
<FormattedMessage id="Nickname" />{
Expand All @@ -106,11 +106,11 @@ export default class Login extends React.Component {
<FormattedMessage id="Logout" />
</Button>
</div>
</div>
</React.Fragment>
);
}
return (
<div>
<React.Fragment>
<Textfield
onChange={event => this.setUsername(event.target.value)}
value={this.getUsername()}
Expand Down Expand Up @@ -146,7 +146,7 @@ export default class Login extends React.Component {
/>
</Button>
</div>
</div>
</React.Fragment>
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/containers/LoginContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default class LoginContainer extends React.Component {

render() {
return (
<div>
<React.Fragment>
<Login
onRef={ref => (this.loginRef = ref)}
onLoginClick={this.onLoginClick}
Expand All @@ -163,7 +163,7 @@ export default class LoginContainer extends React.Component {
authData={this.state.authData}
/>
<Alert ref={ref => (this.alertRef = ref)} />
</div>
</React.Fragment>
);
}
}
20 changes: 8 additions & 12 deletions src/containers/RedirectContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,14 @@ export default class RedirectContainer extends React.Component {
}

render() {
return (
<div>
{this.state.isError ? (
<Message />
) : (
<Message
text={this.props.intl.formatMessage({
id: 'Redirecting to pixiv.net'
})}
/>
)}
</div>
return this.state.isError ? (
<Message />
) : (
<Message
text={this.props.intl.formatMessage({
id: 'Redirecting to pixiv.net'
})}
/>
);
}
}
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer as Root } from 'react-hot-loader';
import { Provider } from 'react-redux';
import iNoBounce from 'inobounce';

import { configureStore } from '@/stores';
import AppContainer from '@/containers/AppContainer';
Expand All @@ -13,6 +14,10 @@ const store = configureStore();

chooseLocale(navigator.language, store.dispatch);

if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
iNoBounce.enable();
}

// Render the main component into the dom
const render = Component => {
ReactDOM.render(
Expand Down
3 changes: 3 additions & 0 deletions src/styles/Reset.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
:global {
.mdl-layout {
.mdl-layout__content {
height: 100%;
}
.mdl-layout__drawer-button,
a.mdl-navigation__link {
outline: 0 none;
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4088,6 +4088,10 @@ ini@^1.3.4, ini@~1.3.0:
version "1.3.5"
resolved "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"

inobounce@^0.1.6:
version "0.1.6"
resolved "https://registry.npmjs.org/inobounce/-/inobounce-0.1.6.tgz#b3912e63cdb2eacbcbfcdce6a0681a105b49a8d2"

inquirer@^3.0.6:
version "3.3.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9"
Expand Down

0 comments on commit 91a674f

Please sign in to comment.