import React from 'react';
import { BackgroundColor, SemanticColor } from '../../foundation';
import { StyleSheet, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { GosuProps, GosuTopNavigation } from './GosuTopNavigation';
import { CustomerProps, CustomerTopNavigation } from './CustomerTopNavigation';
import { getTopNavigationHeight } from './utils';
import { ContainerBottomDivider } from '../utils/ContainerBottomDivider';
/**
* 상단 네비게이션 바
* - 고수, 고객, 비회원에따라 다른 ui를 보여줍니다. (gosu, customer 모드로 구분)
* - 현재 탭에 따라 우측 아이콘 또는 텍스트가 변경됩니다. 아이콘 또는 텍스트를 선택할때 발생할 이벤트를 전달해주세요.
* - 도메인(domain) 에 따라 노출하는 우측 컨텐츠가 다르며, 각 종류별 전달해야할 이벤트 핸들러를 정의해두었습니다.
* - 고수의 경우, 대시보드에서는 userName을 전달해주세요. 대시보드에서 'mm 고수님' 표기를 위함입니다.
* - 고객의 경우, 로그인 여부 isLogin을 전달해주세요. 로그인 상태에 따라 다른 ui를 보여줍니다.
*
* @example
* ```tsx
*
*
* // 배경색 변경 예시
*
* ```
*/
export function TopNavigationBar(
props: (GosuProps | CustomerProps) & {
showDivider?: boolean;
isSafeAreaEnabled?: boolean;
backgroundColor?: BackgroundColor | 'transparent';
},
) {
const safeAreaInsets = useSafeAreaInsets();
function renderTopNavigation() {
if (props.mode === 'gosu') {
return ;
}
return ;
}
const { showDivider = true, isSafeAreaEnabled = true, backgroundColor = 'bg_primary' } = props;
return (
{renderTopNavigation()}
{showDivider && }
);
}
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
},
row: {
flex: 1,
height: getTopNavigationHeight(),
paddingHorizontal: 16,
justifyContent: 'space-between',
flexDirection: 'row',
alignItems: 'center',
},
});