Created
January 18, 2019 11:58
-
-
Save diego3g/de223ea7fcbd918e499d1837627dcb10 to your computer and use it in GitHub Desktop.
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
import React, { Component } from "react"; | |
import { Animated } from "react-native"; | |
import { | |
Container, | |
TypeImage, | |
TypeTitle, | |
TypeDescription, | |
RequestButton, | |
RequestButtonText | |
} from "./styles"; | |
import uberx from "../../assets/uberx.png"; | |
const AnimatedContainer = Animated.createAnimatedComponent(Container); | |
export default class Details extends Component { | |
state = { | |
position: new Animated.Value(300) | |
}; | |
componentDidMount() { | |
Animated.timing(this.state.position, { | |
duration: 500, | |
toValue: 0 | |
}).start(); | |
} | |
render() { | |
return ( | |
<AnimatedContainer | |
style={{ | |
transform: [{ translateY: this.state.position }] | |
}} | |
> | |
<TypeTitle>Popular</TypeTitle> | |
<TypeDescription>Viagens baratas para o dia a dia</TypeDescription> | |
<TypeImage source={uberx} /> | |
<TypeTitle>UberX</TypeTitle> | |
<TypeDescription>R$6,00</TypeDescription> | |
<RequestButton onPress={() => {}}> | |
<RequestButtonText>SOLICITAR UBERX</RequestButtonText> | |
</RequestButton> | |
</AnimatedContainer> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment