Skip to content

Commit 3dfef42

Browse files
App stoped - fixed
1 parent f96bfa4 commit 3dfef42

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ const image = { uri: "https://reactjs.org/logo-og.png" };
6868
| Property |Type|Description|Default|
6969
|----------------|-------------------------------|-----------------------------|--------|
7070
|display |`boolean`|Tooltip content | `true` |
71-
|selected |`bool`|Custom style | `null` |
72-
|fgColor |`string`|Text color |`"rgba(0, 0, 0, 0.7)"`|
71+
|style |`bool`|Custom style | `null` |
72+
|bgColor |`string`|Background color |`"rgba(0, 0, 0, 0.7)"`|
7373

7474
## 🚩 Changelog
7575
Details about each version are documented in the [releases section](https://github.com/wniemiec-component-reactnative/full-tooltip/releases).

src/FullTooltip/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@
1111
import React from 'react';
1212
import { View } from 'react-native';
1313
import styles from './styles';
14-
import Triangle from './components/Triangle';
15-
import Rectangle from './components/Rectangle';
14+
import Triangle from '../components/Triangle';
15+
import Rectangle from '../components/Rectangle';
1616

1717
/**
1818
* Full-width tooltip.
1919
*
2020
* @param {object} children Tooltip content
2121
* @param {boolean} [display=true] Indicates whether the tooltip should be displayed
2222
* @param {object} [style=null] Custom style
23-
* @param {string} [fgColor='rgba(0, 0, 0, 0.7)'] Text color
23+
* @param {string} [bgColor='rgba(0, 0, 0, 0.7)'] Background color
2424
*/
2525
export default function FullTooltip({
2626
children,
2727
display=true,
2828
style=null,
29-
fgColor='rgba(0, 0, 0, 0.7)'
29+
bgColor='rgba(0, 0, 0, 0.7)'
3030
}) {
3131

3232
return (
33-
<View style={[styles.area, style, {display: display}]}>
34-
<Triangle fgColor={fgColor} />
35-
<Rectangle fgColor={fgColor}>
33+
<View style={[styles.area, style, !display ? styles.hide : null]}>
34+
<Triangle bgColor={bgColor} />
35+
<Rectangle bgColor={bgColor}>
3636
{children}
3737
</Rectangle>
3838
</View>

src/FullTooltip/styles.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ export default StyleSheet.create({
55
width: '100%',
66
justifyContent: "center",
77
alignItems: 'center'
8+
},
9+
hide: {
10+
transform: [{ scale: 0 }]
811
}
912
});

src/FullTooltip/components/Rectangle/index.js renamed to src/components/Rectangle/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import React from 'react';
1212
import { View } from 'react-native';
1313
import styles from './styles';
1414

15-
export default function Rectangle({ children, fgColor }) {
15+
export default function Rectangle({ children, bgColor }) {
1616
return (
17-
<View style={[styles.area, { backgroundColor: fgColor }]}>
17+
<View style={[styles.area, { backgroundColor: bgColor }]}>
1818
{children}
1919
</View>
2020
);

src/FullTooltip/components/Triangle/index.js renamed to src/components/Triangle/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import React from 'react';
1212
import { View } from 'react-native';
1313
import styles from './styles';
1414

15-
export default function Triangle({ fgColor }) {
15+
export default function Triangle({ bgColor }) {
1616
return (
17-
<View style={[styles.triangle, { borderBottomColor: fgColor }]}>
17+
<View style={[styles.triangle, { borderBottomColor: bgColor }]}>
1818
</View>
1919
);
2020
}

0 commit comments

Comments
 (0)