Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class App extends React.Component {
| buttonComponentExpandRatio | `number` | 1.0 | Ratio of button component expansion after tooltip poped up.
| setBelow | `Boolean` | false | Sets the default position of the tooltip to appear below the intended target.
| triangleOffset | `Number` | 0 | Number of pixels to offset triangle from center. Positive numbers will push right. Negative Numbers will push left.
| showTriangle | `Boolean` | true | Optional. Set this to false if you want to hide the triangle.

## Methods:

Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type Props = {
timingConfig?: { duration?: number },
springConfig?: { tension?: number, friction?: number },
opacityChangeDuration?: number,
showTriangle?: bool,
};
type State = {
isModalOpen: bool,
Expand Down Expand Up @@ -92,6 +93,7 @@ class PopoverTooltip extends React.PureComponent<Props, State> {
timingConfig: PropTypes.object,
springConfig: PropTypes.object,
opacityChangeDuration: PropTypes.number,
showTriangle: PropTypes.bool,
};
static defaultProps = {
buttonComponentExpandRatio: 1.0,
Expand All @@ -100,6 +102,7 @@ class PopoverTooltip extends React.PureComponent<Props, State> {
setBelow: false,
delayLongPress: 100,
triangleOffset: 0,
showTriangle: true
};
wrapperComponent: ?TouchableOpacity;

Expand Down Expand Up @@ -328,14 +331,14 @@ class PopoverTooltip extends React.PureComponent<Props, State> {
onLayout={this.onInnerContainerLayout}
style={styles.innerContainer}
>
{triangleUp}
{this.props.showTriangle && triangleUp}
<View style={[
styles.allItemContainer,
this.props.tooltipContainerStyle,
]}>
{items}
</View>
{triangleDown}
{this.props.showTriangle && triangleDown}
</View>
</Animated.View>
</TouchableOpacity>
Expand Down