import { ComponentProps } from 'react'; import { BottomFixedButton } from './BottomFixedButton'; /** * safe area 제외한, BottomFixedButton 컴포넌트 자체의 높이 반환 * * ### 사용처 * - `BottomFixedButton` 컴포넌트 내부 구현에 사용됩니다. * - `KeyboardAwareScrollView` + `BottomFixedButton` 사용시 텍스트 인풋이 버튼이 가려지지 않도록 offset 설정하는데 사용하세요. * - 이 경우 `getBottomFixedButtonHeight('keyboard')`로 호출하면 됩니다. * * ### BottomFixedButton 컴포넌트가 'custom' 타입일 경우 * - 컨텐츠가 Button 계열이면 'solid', 'two_button*' 타입과 높이가 같습니다. * - 하지만 컨텐츠 구현에 따라 달라질 수 있습니다. 그럴 경우 이 함수를 호출하는 대신, 알맞은 값을 호출처에서 결정해 사용하세요. */ export function getBottomFixedButtonHeight( type: ComponentProps['type'] | 'keyboard', ): number { switch (type) { case 'full': return 54; case 'solid': return 60; case 'keyboard': // 키보드 위에 붙는 버튼의 높이. KeyboardAwareScrollView > bottomOffset prop 값으로 사용하세요. return 48; case 'two_button_3to7': case 'two_button_5to5': case 'two_button_2to8': return 60; case 'custom': return 60; } }