From 486055574f512aff797fe102c5de0ebfe1a5b2f1 Mon Sep 17 00:00:00 2001 From: Guilherme Santiago Date: Tue, 17 Oct 2023 10:29:01 -0300 Subject: [PATCH] feat: add props `getPathDown` and `getPathUp` --- src/CurvedBottomBar/components/BottomBarView/index.tsx | 6 ++++-- src/CurvedBottomBar/components/BottomBarView/model.ts | 4 ++++ src/CurvedBottomBar/components/BottomBarViewExpo/index.tsx | 6 ++++-- src/CurvedBottomBar/components/BottomBarViewExpo/model.ts | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/CurvedBottomBar/components/BottomBarView/index.tsx b/src/CurvedBottomBar/components/BottomBarView/index.tsx index 05f7a93..61fad20 100644 --- a/src/CurvedBottomBar/components/BottomBarView/index.tsx +++ b/src/CurvedBottomBar/components/BottomBarView/index.tsx @@ -12,8 +12,8 @@ import React, { import { Dimensions, Text, TouchableOpacity, View } from 'react-native'; import { scale } from 'react-native-size-scaling'; import { useDeviceOrientation } from '../../../useDeviceOrientation'; -import { getPathDown } from '../../utils/pathDown'; -import { getPathUp } from '../../utils/pathUp'; +import { getPathDown as getPathDownDefault } from '../../utils/pathDown'; +import { getPathUp as getPathUpDefault } from '../../utils/pathUp'; import { CurvedViewComponent } from '../CurvedView/curvedView'; import type { NavigatorBottomBarProps } from './model'; import { styles } from './styles'; @@ -38,6 +38,8 @@ const BottomBarComponent: ( renderCircle, borderTopLeftRight = false, shadowStyle, + getPathDown = getPathDownDefault, + getPathUp = getPathUpDefault, } = props; const [itemLeft, setItemLeft] = useState([]); diff --git a/src/CurvedBottomBar/components/BottomBarView/model.ts b/src/CurvedBottomBar/components/BottomBarView/model.ts index 1447090..7a316eb 100644 --- a/src/CurvedBottomBar/components/BottomBarView/model.ts +++ b/src/CurvedBottomBar/components/BottomBarView/model.ts @@ -10,6 +10,8 @@ import { } from '@react-navigation/native'; import React from 'react'; import { StyleProp, ViewStyle } from 'react-native'; +import { getPathDown } from '../../utils/pathDown'; +import { getPathUp } from '../../utils/pathUp'; type Enumerate< N extends number, @@ -62,6 +64,8 @@ interface Props { selectedTab: string; navigate: (selectedTab: string) => void; }) => JSX.Element; + getPathUp?: typeof getPathUp; + getPathDown?: typeof getPathDown; } export type NavigatorBottomBarProps = DefaultNavigatorOptions< diff --git a/src/CurvedBottomBar/components/BottomBarViewExpo/index.tsx b/src/CurvedBottomBar/components/BottomBarViewExpo/index.tsx index 0a8c2a1..e9f40e7 100644 --- a/src/CurvedBottomBar/components/BottomBarViewExpo/index.tsx +++ b/src/CurvedBottomBar/components/BottomBarViewExpo/index.tsx @@ -12,8 +12,8 @@ import React, { import { Dimensions, Text, TouchableOpacity, View } from 'react-native'; import { scale } from 'react-native-size-scaling'; import { useDeviceOrientation } from '../../../useDeviceOrientation'; -import { getPathDown } from '../../utils/pathDown'; -import { getPathUp } from '../../utils/pathUp'; +import { getPathDown as getPathDownDefault } from '../../utils/pathDown'; +import { getPathUp as getPathUpDefault } from '../../utils/pathUp'; import { CurvedViewExpoComponent } from '../CurvedView/curvedViewExpo'; import type { NavigatorBottomBarProps } from './model'; import { styles } from './styles'; @@ -38,6 +38,8 @@ const BottomBarComponent: ( renderCircle, borderTopLeftRight = false, shadowStyle, + getPathDown = getPathDownDefault, + getPathUp = getPathUpDefault, } = props; const [itemLeft, setItemLeft] = useState([]); diff --git a/src/CurvedBottomBar/components/BottomBarViewExpo/model.ts b/src/CurvedBottomBar/components/BottomBarViewExpo/model.ts index 1447090..7a316eb 100644 --- a/src/CurvedBottomBar/components/BottomBarViewExpo/model.ts +++ b/src/CurvedBottomBar/components/BottomBarViewExpo/model.ts @@ -10,6 +10,8 @@ import { } from '@react-navigation/native'; import React from 'react'; import { StyleProp, ViewStyle } from 'react-native'; +import { getPathDown } from '../../utils/pathDown'; +import { getPathUp } from '../../utils/pathUp'; type Enumerate< N extends number, @@ -62,6 +64,8 @@ interface Props { selectedTab: string; navigate: (selectedTab: string) => void; }) => JSX.Element; + getPathUp?: typeof getPathUp; + getPathDown?: typeof getPathDown; } export type NavigatorBottomBarProps = DefaultNavigatorOptions<