Skip to content

Commit 7d84480

Browse files
chore: added extra props and improved importing
1 parent e44f919 commit 7d84480

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,11 @@ export const AppBodyLargeText: React.FC<PropsWithChildren> = ({children}) => {
222222
| name | description | type | default |
223223
| ------ | ------ | ------ | ----|
224224
| iconButtons | required | IconButtonProps[] | - |
225-
| scrollDirection | UP or DOWN | sharedValue<ScrollDirection> | - |
225+
| scrollDirection | UP or DOWN | sharedValue<ScrollDirection> | UP |
226226
| FabIcon | Pass an icon to show FAB | React.FC | - |
227227
| fabLabel | - | string | - |
228+
| animationDelay | - | number | 80 |
229+
| animationDumping | - | number | 20 |
228230
| onFabPress | - | () => void | - |
229231

230232
To enable animation on scroll use ScrollView from Animated, create a shared value with a ScrollDirection value, scrollContext with a number value and manage them onScroll.

src/app-bars/bottom-app-bar/BottomAppBar.component.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export interface BottomAppBarProps<T extends IconProps> extends ViewProps {
2121
FabIcon?: React.FC;
2222
fabLabel?: string;
2323
scrollDirection?: SharedValue<ScrollDirection>;
24+
animationDelay?: number;
25+
animationDumping?: number;
2426

2527
onFabPress?: () => void;
2628
}
@@ -33,7 +35,7 @@ const FAB_BOTTOM_GAP = 12;
3335

3436
export const BottomAppBar = forwardRef(
3537
<T extends IconProps>(
36-
{iconButtons, scrollDirection, FabIcon, fabLabel, style, onFabPress, onLayout, ...props}: BottomAppBarProps<T>,
38+
{iconButtons, scrollDirection, FabIcon, fabLabel, style, onFabPress, onLayout, animationDelay, animationDumping, ...props}: BottomAppBarProps<T>,
3739
ref: React.Ref<BottomAppBarRef>
3840
) => {
3941
const [bottomBarHeight, setBottombarHeight] = useState(0);
@@ -64,6 +66,8 @@ export const BottomAppBar = forwardRef(
6466
index={index}
6567
scrollDirection={scrollDirection}
6668
bottomBarHeight={bottomBarHeight}
69+
animationDelay={animationDelay}
70+
animationDumping={animationDumping}
6771
/>
6872
);
6973

src/app-bars/bottom-app-bar/animated-bottom-app-bar-action-button/AnimatedBottomAppBarActionButton.component.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ interface AnimatedBottomAppBarActionButtonProps<T extends IconProps> {
1212
bottomBarHeight: number;
1313
buttonProps: IconButtonProps<T>;
1414

15+
animationDelay?: number;
16+
animationDumping?: number;
1517
scrollDirection?: SharedValue<ScrollDirection>;
1618
}
1719

@@ -20,6 +22,8 @@ export const AnimatedBottomAppBarActionButton = <T extends IconProps>({
2022
buttonProps,
2123
bottomBarHeight,
2224
scrollDirection,
25+
animationDumping = 20,
26+
animationDelay = 80,
2327
}: AnimatedBottomAppBarActionButtonProps<T>) => {
2428
const {surface} = useTheme();
2529

@@ -28,16 +32,16 @@ export const AnimatedBottomAppBarActionButton = <T extends IconProps>({
2832
{
2933
translateY:
3034
scrollDirection?.value === ScrollDirection.DOWN
31-
? withSpring(bottomBarHeight, {damping: 20})
32-
: withDelay(index * 80, withSpring(0, {damping: 20})),
35+
? withSpring(bottomBarHeight, {damping: animationDumping})
36+
: withDelay(index * animationDelay, withSpring(0, {damping: animationDumping})),
3337
},
3438
],
3539
}));
3640

3741
return (
3842
<Animated.View
3943
exiting={FadeOut}
40-
entering={FadeInDown.damping(20).delay((index + 1) * 80)}
44+
entering={FadeInDown.damping(animationDumping).delay((index + 1) * animationDelay)}
4145
key={`${index}-${buttonProps.Icon.toString()}`}
4246
style={iconButtonAnimatedStyle}>
4347
<StandartIconButton iconProps={{color: surface.textVariant} as T} {...buttonProps} />

src/app-bars/bottom-app-bar/bottom-app-bar.styles.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ export const BOTTOM_APP_BAR_PADDING_VARTICAL = 20;
44

55
export const styles = StyleSheet.create({
66
container: {
7-
// position: 'absolute',
8-
// bottom: 0,
9-
// left: 0,
10-
// right: 0,
11-
// marginTop: 'auto',
12-
137
flexDirection: 'row',
148
alignItems: 'center',
159
justifyContent: 'space-between',

src/index.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
export {
2-
EditIcon,
3-
PlusIcon,
4-
CloseIcon,
5-
TodayIcon,
6-
SearchIcon,
7-
DeleteIcon,
8-
MoreVertIcon,
9-
ArrowBackIcon,
10-
CheckSmallIcon,
11-
AttachFileIcon,
12-
FileDownloadIcon,
13-
BookmarkBorderIcon,
14-
AccountCircleFilledIcon,
15-
} from './icons';
1+
export * from './icons';
162

173
export {Divider, type DividerProps} from './divider/Divider.component';
184

0 commit comments

Comments
 (0)