Skip to content

Commit

Permalink
App stoped - fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
williamniemiec committed Aug 11, 2021
1 parent f96bfa4 commit 3dfef42
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const image = { uri: "https://reactjs.org/logo-og.png" };
| Property |Type|Description|Default|
|----------------|-------------------------------|-----------------------------|--------|
|display |`boolean`|Tooltip content | `true` |
|selected |`bool`|Custom style | `null` |
|fgColor |`string`|Text color |`"rgba(0, 0, 0, 0.7)"`|
|style |`bool`|Custom style | `null` |
|bgColor |`string`|Background color |`"rgba(0, 0, 0, 0.7)"`|

## 🚩 Changelog
Details about each version are documented in the [releases section](https://github.com/wniemiec-component-reactnative/full-tooltip/releases).
Expand Down
14 changes: 7 additions & 7 deletions src/FullTooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@
import React from 'react';
import { View } from 'react-native';
import styles from './styles';
import Triangle from './components/Triangle';
import Rectangle from './components/Rectangle';
import Triangle from '../components/Triangle';
import Rectangle from '../components/Rectangle';

/**
* Full-width tooltip.
*
* @param {object} children Tooltip content
* @param {boolean} [display=true] Indicates whether the tooltip should be displayed
* @param {object} [style=null] Custom style
* @param {string} [fgColor='rgba(0, 0, 0, 0.7)'] Text color
* @param {string} [bgColor='rgba(0, 0, 0, 0.7)'] Background color
*/
export default function FullTooltip({
children,
display=true,
style=null,
fgColor='rgba(0, 0, 0, 0.7)'
bgColor='rgba(0, 0, 0, 0.7)'
}) {

return (
<View style={[styles.area, style, {display: display}]}>
<Triangle fgColor={fgColor} />
<Rectangle fgColor={fgColor}>
<View style={[styles.area, style, !display ? styles.hide : null]}>
<Triangle bgColor={bgColor} />
<Rectangle bgColor={bgColor}>
{children}
</Rectangle>
</View>
Expand Down
3 changes: 3 additions & 0 deletions src/FullTooltip/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ export default StyleSheet.create({
width: '100%',
justifyContent: "center",
alignItems: 'center'
},
hide: {
transform: [{ scale: 0 }]
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import React from 'react';
import { View } from 'react-native';
import styles from './styles';

export default function Rectangle({ children, fgColor }) {
export default function Rectangle({ children, bgColor }) {
return (
<View style={[styles.area, { backgroundColor: fgColor }]}>
<View style={[styles.area, { backgroundColor: bgColor }]}>
{children}
</View>
);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import React from 'react';
import { View } from 'react-native';
import styles from './styles';

export default function Triangle({ fgColor }) {
export default function Triangle({ bgColor }) {
return (
<View style={[styles.triangle, { borderBottomColor: fgColor }]}>
<View style={[styles.triangle, { borderBottomColor: bgColor }]}>
</View>
);
}
File renamed without changes.

0 comments on commit 3dfef42

Please sign in to comment.