Skip to content

Commit

Permalink
add ScaleButton and some utility functions#2
Browse files Browse the repository at this point in the history
  • Loading branch information
ilz5753 committed Dec 17, 2023
1 parent 5c3d789 commit 0abec7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ilz5753/rnutils",
"version": "0.1.11",
"version": "0.1.12",
"description": "React Native Utils",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
8 changes: 5 additions & 3 deletions src/components/ScaleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export type TScaleButton = AnimateProps<TouchableOpacityProps> & {
duration?: number;
toScale?: number;
};
let RV = ReView as any;
let RT = ReTouchableOpacity as any;
export function ScaleButton({
toScale = 0.96,
duration = 200,
Expand All @@ -36,15 +38,15 @@ export function ScaleButton({
],
}));
return (
<ReView style={[scaleAnimation]}>
<ReTouchableOpacity
<RV style={[scaleAnimation]}>
<RT
{...{
activeOpacity: activeOpacity ?? 0.69,
onPressIn,
onPressOut,
...rest,
}}
/>
</ReView>
</RV>
);
}

0 comments on commit 0abec7e

Please sign in to comment.