import React from 'react';
import { View } from 'react-native';
import { BrandLogoPurple, Typo } from '../../foundation';
import { TopNavigationIcon } from './TopNavigationIcon';
import { Button } from '../button/Button';
export type CustomerProps = {
mode: 'customer';
isLogin: boolean; // 로그인 여부
onPressBell: () => void;
onPressProfile: () => void;
showDot: boolean;
} & (
| {
domain: 'home';
onPressChangeRoleToGosu: () => void;
onPressGosuJoin: () => void;
}
| {
domain: 'gosuFind';
}
| {
domain: 'community';
onPressSearch: () => void;
}
| {
domain: 'chat';
onPressSetting: () => void;
}
| {
domain: 'receivedQuote';
onPressInformation: () => void;
}
);
/**
* 고객 상단 네비게이션
*/
export function CustomerTopNavigation(props: CustomerProps) {
const { domain, isLogin } = props;
const title = getTitle(domain);
return (
<>
{domain === 'home' ? (
<>
>
) : (
{title}
)}
{/* 홈 */}
{domain === 'home' && (
<>
{isLogin && (
)}
{isLogin ? (
) : (
)}
>
)}
{/* 고수찾기 */}
{domain === 'gosuFind' && (
<>
{isLogin && (
)}
>
)}
{/* 커뮤니티 */}
{domain === 'community' && (
<>
{isLogin && (
)}
>
)}
{/* 채팅 */}
{domain === 'chat' && (
<>
{isLogin && (
<>
>
)}
>
)}
{/* 받은견적 */}
{domain === 'receivedQuote' && (
<>
{isLogin && (
)}
>
)}
>
);
}
function getTitle(domain: CustomerProps['domain']) {
switch (domain) {
case 'home':
return '홈'; // 로고 사용
case 'gosuFind':
return '고수찾기';
case 'community':
return '커뮤니티';
case 'chat':
return '채팅';
case 'receivedQuote':
return '받은견적';
}
}