import React from 'react';
import { IconName } from '../../foundation';
/**
* key에는 ScreenKeyEnum을 사용
*/
export type BottomTabDescriptor = {
[key: string]: BottomNavigationDescriptor;
};
/**
* BottomNavigationBar 컴포넌트에 전달할 탭 정보를 담은 배열 타입
* Screen의 route 정보와 필요한 아이콘,탭 정보를 조합
*/
type BottomTabList = Array<{
routeKey: string;
routeName: string;
} & BottomNavigationDescriptor>;
/**
* 탭 라벨과 아이콘, 알림 카운트, 알림 뱃지(닷)를 정의하기 위한 타입
*/
type BottomNavigationDescriptor = {
label: string;
count?: number;
showDot?: boolean;
defaultIconName: IconName;
focusedIconName: IconName;
};
type BottomNavigationBarProps = {
/**
* 탭 정보를 담은 배열
*/
bottomTabList: BottomTabList;
/**
* 탭 선택시 이벤트
*/
onPress: (args: {
routeKey: string;
routeName: string;
isFocused: boolean;
}) => void;
/**
* 현재 선택된 탭의 index
*/
focusedIndex: number;
};
/**
* 바텀 네비게이션 바
*
* 실제 사용 예시는 BottomNavigationBarStory.tsx 파일 하단에 주석 내용을 참고해 주세요.
* BottomNavigation 사용 예시:
* 1. '@react-navigation/bottom-tabs' 설치합니다.
* 2. 'createBottomTabNavigator'를 사용하여 ${FooTab} 탭 네비게이션을 생성합니다.
* 3. 내부에 을 추가합니다.
* 4. 내부에 tabBar 속성을 추가하고, BottomNavigationBar 컴포넌트를 호출합니다.
* 5. tabBar 속성 반환 받는 props state 이용하여 BottomNavigationBar에 필요한 정보를 전달합니다.
* - 5-1. bottomTabList: props.state.routes 배열을 순회하면서 필요한 라벨,아이콘 정보를 담은 배열을 생성하여 props로 전달합니다.
* - 5-2. onPress: 탭 선택시 이벤트를 처리할 함수를 정의합니다.
* - 5-3. focusedIndex: props.state.index를 사용해 현재 선택된 탭의 index를 전달합니다.
*/
export declare function BottomNavigationBar({ bottomTabList, onPress, focusedIndex }: BottomNavigationBarProps): React.JSX.Element;
export {};