forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fba2945
commit 53b76c9
Showing
2 changed files
with
67 additions
and
5 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 |
---|---|---|
@@ -1,15 +1,46 @@ | ||
import type {Animated} from 'react-native'; | ||
import type {ThemeColors} from '@styles/theme/types'; | ||
|
||
/** | ||
* Configuration for the getBackgroundColor function. | ||
*/ | ||
type GetBackgroudColorConfig = { | ||
/** | ||
* The number of routes. | ||
*/ | ||
routesLength: number; | ||
|
||
/** | ||
* The index of the current tab. | ||
*/ | ||
tabIndex: number; | ||
|
||
/** | ||
* The indices of the affected tabs. | ||
*/ | ||
affectedTabs: number[]; | ||
|
||
/** | ||
* The theme colors. | ||
*/ | ||
theme: ThemeColors; | ||
position?: Animated.AnimatedInterpolation<number>; | ||
isActive?: boolean; | ||
|
||
/** | ||
* The animated position interpolation. | ||
*/ | ||
position: Animated.AnimatedInterpolation<number>; | ||
|
||
/** | ||
* Whether the tab is active. | ||
*/ | ||
isActive: boolean; | ||
}; | ||
|
||
/** | ||
* Function to get the background color. | ||
* @param args - The configuration for the background color. | ||
* @returns The interpolated background color or a string. | ||
*/ | ||
type GetBackgroudColor = (args: GetBackgroudColorConfig) => Animated.AnimatedInterpolation<string> | string; | ||
|
||
export default GetBackgroudColor; |
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 |
---|---|---|
@@ -1,14 +1,45 @@ | ||
import type {Animated} from 'react-native'; | ||
|
||
/** | ||
* Configuration for the getOpacity function. | ||
*/ | ||
type GetOpacityConfig = { | ||
/** | ||
* The number of routes in the tab bar. | ||
*/ | ||
routesLength: number; | ||
|
||
/** | ||
* The index of the tab. | ||
*/ | ||
tabIndex: number; | ||
|
||
/** | ||
* Whether we are calculating the opacity for the active tab. | ||
*/ | ||
active: boolean; | ||
|
||
/** | ||
* The indexes of the tabs that are affected by the animation. | ||
*/ | ||
affectedTabs: number[]; | ||
position?: Animated.AnimatedInterpolation<number>; | ||
isActive?: boolean; | ||
|
||
/** | ||
* Scene's position, value which we would like to interpolate. | ||
*/ | ||
position: Animated.AnimatedInterpolation<number>; | ||
|
||
/** | ||
* Whether the tab is active. | ||
*/ | ||
isActive: boolean; | ||
}; | ||
|
||
type GetOpacity = (args: GetOpacityConfig) => 1 | 0 | Animated.AnimatedInterpolation<number> | undefined; | ||
/** | ||
* Function to get the opacity. | ||
* @param args - The configuration for the opacity. | ||
* @returns The interpolated opacity or a fixed value (1 or 0). | ||
*/ | ||
type GetOpacity = (args: GetOpacityConfig) => 1 | 0 | Animated.AnimatedInterpolation<number>; | ||
|
||
export default GetOpacity; |