From e3f3a94980b6c380ab8c812d303268e1ef0d8f4e Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 30 Jan 2019 13:07:47 -0600 Subject: [PATCH] Remove shake animation from auth field errors --- src/UiEffects.js | 27 ------------------- src/components/views/auth/PasswordLogin.js | 7 ----- src/components/views/auth/RegistrationForm.js | 2 -- 3 files changed, 36 deletions(-) delete mode 100644 src/UiEffects.js diff --git a/src/UiEffects.js b/src/UiEffects.js deleted file mode 100644 index 06b0a0e3b7..0000000000 --- a/src/UiEffects.js +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2016 OpenMarket Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - * Functions for applying common thematic effects to UI elements. - * Ideally this would be themeable. - */ - -import Velocity from 'velocity-vector'; -import 'velocity-vector/velocity.ui'; - -export function fieldInputIncorrect(element) { - Velocity(element, "callout.shake", 300); -} diff --git a/src/components/views/auth/PasswordLogin.js b/src/components/views/auth/PasswordLogin.js index 022de34011..5bc6d6e05b 100644 --- a/src/components/views/auth/PasswordLogin.js +++ b/src/components/views/auth/PasswordLogin.js @@ -20,7 +20,6 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import sdk from '../../../index'; import { _t } from '../../../languageHandler'; -import {fieldInputIncorrect} from '../../../UiEffects'; import SdkConfig from '../../../SdkConfig'; /** @@ -71,12 +70,6 @@ class PasswordLogin extends React.Component { this._loginField = null; } - componentWillReceiveProps(nextProps) { - if (!this.props.loginIncorrect && nextProps.loginIncorrect) { - fieldInputIncorrect(this.isLoginEmpty() ? this._loginField : this._passwordField); - } - } - onSubmitForm(ev) { ev.preventDefault(); diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index 14d170ecaa..b38a7d47fc 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -18,7 +18,6 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import { fieldInputIncorrect } from '../../../UiEffects'; import sdk from '../../../index'; import Email from '../../../email'; import { looksValid as phoneNumberLooksValid } from '../../../phonenumber'; @@ -211,7 +210,6 @@ module.exports = React.createClass({ fieldValid[fieldID] = val; this.setState({fieldValid: fieldValid}); if (!val) { - fieldInputIncorrect(this.fieldElementById(fieldID)); this.props.onError(errorCode); } },