import React, { Component } from 'react'; import { Animated, Text, View } from 'react-native'; import styles, { DEFAULT_COLOR } from './styles'; export interface IProps { /** * The position of the parent element (from right to left) to display the * arrow. */ parentPosition: number; /** * Custom styles. */ style?: Object; } interface IState { /** * The opacity animation Object. */ opacityAnimation: Animated.Value; } /** * A react {@code Component} that implements an expanded label as tooltip-like * component to explain the meaning of the {@code Label}. */ export default abstract class ExpandedLabel
extends Component
{
/**
* Instantiates a new {@code ExpandedLabel} instance.
*
* @inheritdoc
*/
constructor(props: P) {
super(props);
this.state = {
opacityAnimation: new Animated.Value(0)
};
}
/**
* Implements React {@code Component}'s componentDidMount.
*
* @inheritdoc
*/
componentDidMount() {
Animated.decay(this.state.opacityAnimation, {
toValue: 1,
velocity: 1,
useNativeDriver: true
} as Animated.DecayAnimationConfig).start();
}
/**
* Implements React {@code Component}'s render.
*
* @inheritdoc
*/
render() {
return (