Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Vertically Expanding Dot #26

Open
Ved-Ravi opened this issue Jan 16, 2024 · 0 comments
Open

For Vertically Expanding Dot #26

Ved-Ravi opened this issue Jan 16, 2024 · 0 comments

Comments

@Ved-Ravi
Copy link

Currently, ExpandingDot only expands horizontally but how to achieve a vertically expanding dot.

For this, I used a prop isVerticle in ExpandingDot.

Attached, the patch-package if someone needs it.

diff --git a/node_modules/react-native-animated-pagination-dots/src/dots/ExpandingDot.tsx b/node_modules/react-native-animated-pagination-dots/src/dots/ExpandingDot.tsx
index 14895e1..9495aef 100644
--- a/node_modules/react-native-animated-pagination-dots/src/dots/ExpandingDot.tsx
+++ b/node_modules/react-native-animated-pagination-dots/src/dots/ExpandingDot.tsx
@@ -15,6 +15,7 @@ export interface ExpandingDotProps {
   inActiveDotColor?: string;
   expandingDotWidth?: number;
   activeDotColor?: string;
+  isVerticle?: boolean;
 }
 
 const ExpandingDot = ({
@@ -26,6 +27,7 @@ const ExpandingDot = ({
   inActiveDotColor,
   expandingDotWidth,
   activeDotColor,
+  isVerticle,
 }: ExpandingDotProps) => {
   const { width } = useWindowDimensions();
 
@@ -35,6 +37,7 @@ const ExpandingDot = ({
     expandingDotWidth: expandingDotWidth || 20,
     dotWidth: (dotStyle.width as number) || 10,
     activeDotColor: activeDotColor || '#347af0',
+    isVerticle: isVerticle ? isVerticle :  false,
   };
 
   return (
@@ -80,7 +83,7 @@ const ExpandingDot = ({
             style={[
               styles.dotStyle,
               dotStyle,
-              { width: expand },
+              defaultProps.isVerticle ? { height: expand, alignSelf: 'center' } : { width : expand },
               { opacity },
               { backgroundColor: colour },
             ]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant