-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: separate
PointerWrapper
component from TooltipWrapper
- Loading branch information
1 parent
f4a4b7c
commit 84eef08
Showing
6 changed files
with
53 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useMemo } from 'react'; | ||
import { StyleSheet, View } from 'react-native'; | ||
|
||
import { getPointerWrapperStyle } from '../../utils'; | ||
import type { PointerWrapperProps } from '../../types'; | ||
|
||
import Pointer from '../Pointer'; | ||
|
||
import styles from './styles'; | ||
|
||
const PointerWrapper: React.FC<PointerWrapperProps> = ({ | ||
tooltipLayout, | ||
...pointerProps | ||
}) => { | ||
const pointerStyles = useMemo( | ||
() => | ||
StyleSheet.flatten([ | ||
styles.wrapper, | ||
getPointerWrapperStyle(pointerProps, tooltipLayout), | ||
]), | ||
[pointerProps, tooltipLayout] | ||
); | ||
|
||
return ( | ||
<View style={pointerStyles}> | ||
<Pointer {...pointerProps} /> | ||
</View> | ||
); | ||
}; | ||
|
||
export default PointerWrapper; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './PointerWrapper'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
const pointerWrapperStyles = StyleSheet.create({ | ||
wrapper: { | ||
position: 'absolute', | ||
}, | ||
}); | ||
|
||
export default pointerWrapperStyles; |
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
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
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