Skip to content

Commit

Permalink
(Bug) 2764 native checkmark animation not working (#2771)
Browse files Browse the repository at this point in the history
* fix: spinner checkmark animation for native

* update: fix PR comments
  • Loading branch information
mauriguz committed Dec 2, 2020
1 parent c316235 commit aa864d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { Platform } from 'react-native'
import Lottie from 'lottie-react-native'
import { View } from 'react-native-animatable'
import AnimationBase from '../Base'
Expand Down Expand Up @@ -78,7 +79,8 @@ class SpinnerCheckMark extends AnimationBase {
}

render() {
const { height = 196, width = 196, marginTop } = this.props
const { width = 196, height, marginTop } = this.props
const _height = height !== undefined ? height : Platform.select({ web: 'auto', default: width })
return (
<View>
<Lottie
Expand All @@ -88,9 +90,9 @@ class SpinnerCheckMark extends AnimationBase {
source={this.improveAnimationData(animationData)}
speed={this.state.speed}
style={{
marginTop: marginTop !== undefined ? marginTop : -height / (isMobileNative ? 6 : 2.4),
width,
height,
height: _height,
marginTop: marginTop !== undefined ? marginTop : -_height / (isMobileNative ? 6 : 2.4),
}}
/>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default ({
countryCode = `+${phoneInputRef.current.getCountryCode()}`
}

if (!isUserTypingCountry) {
if (!isUserTypingCountry && value) {
phoneNumber = value.replace(countryCode, '')
}

Expand Down
7 changes: 6 additions & 1 deletion src/components/dashboard/Claim.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ const log = logger.child({ from: 'Claim' })

const LoadingAnimation = ({ success, speed = 3 }) => (
<View style={{ alignItems: 'center' }}>
<SpinnerCheckMark successSpeed={speed} success={success} width={175} height={'auto'} />
<SpinnerCheckMark
successSpeed={speed}
success={success}
width={145}
marginTop={Platform.select({ web: undefined, default: 5 })}
/>
</View>
)

Expand Down

0 comments on commit aa864d3

Please sign in to comment.