- 수기발행,1:1문의 등록, 빌링 모바일 용 패딩 추가 로직 추가
This commit is contained in:
@@ -5,6 +5,7 @@ import { useSetOnBack } from '@/widgets/sub-layout/use-sub-layout';
|
|||||||
import { CashReceiptPurposeType } from '../model/types';
|
import { CashReceiptPurposeType } from '../model/types';
|
||||||
import { PatternFormat } from 'react-number-format';
|
import { PatternFormat } from 'react-number-format';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware';
|
||||||
|
|
||||||
export interface CashReceiptHandWrittenIssuanceStep1Props {
|
export interface CashReceiptHandWrittenIssuanceStep1Props {
|
||||||
businessNumber?: string;
|
businessNumber?: string;
|
||||||
@@ -41,6 +42,7 @@ export const CashReceiptHandWrittenIssuanceStep1 = ({
|
|||||||
}: CashReceiptHandWrittenIssuanceStep1Props) => {
|
}: CashReceiptHandWrittenIssuanceStep1Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
const { handleInputFocus, keyboardAwarePadding } = useKeyboardAware();
|
||||||
|
|
||||||
useSetOnBack(() => {
|
useSetOnBack(() => {
|
||||||
navigate(PATHS.transaction.cashReceipt.list);
|
navigate(PATHS.transaction.cashReceipt.list);
|
||||||
@@ -86,6 +88,7 @@ export const CashReceiptHandWrittenIssuanceStep1 = ({
|
|||||||
placeholder={t('transaction.handWrittenIssuance.productNamePlaceholder')}
|
placeholder={t('transaction.handWrittenIssuance.productNamePlaceholder')}
|
||||||
value={productName}
|
value={productName}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setProductName(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setProductName(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -97,6 +100,7 @@ export const CashReceiptHandWrittenIssuanceStep1 = ({
|
|||||||
placeholder={t('transaction.handWrittenIssuance.buyerNamePlaceholder')}
|
placeholder={t('transaction.handWrittenIssuance.buyerNamePlaceholder')}
|
||||||
value={buyerName}
|
value={buyerName}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setBuyerName(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setBuyerName(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -109,6 +113,7 @@ export const CashReceiptHandWrittenIssuanceStep1 = ({
|
|||||||
valueIsNumericString
|
valueIsNumericString
|
||||||
format="###########"
|
format="###########"
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setIssueNumber(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setIssueNumber(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></PatternFormat>
|
></PatternFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -120,10 +125,11 @@ export const CashReceiptHandWrittenIssuanceStep1 = ({
|
|||||||
placeholder={t('transaction.handWrittenIssuance.emailPlaceholder')}
|
placeholder={t('transaction.handWrittenIssuance.emailPlaceholder')}
|
||||||
value={email}
|
value={email}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setEmail(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setEmail(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="issue-row">
|
<div className="issue-row" style={keyboardAwarePadding}>
|
||||||
<div className="issue-label">{t('account.phoneNumber')}</div>
|
<div className="issue-label">{t('account.phoneNumber')}</div>
|
||||||
<div className="issue-field">
|
<div className="issue-field">
|
||||||
<PatternFormat
|
<PatternFormat
|
||||||
@@ -132,6 +138,7 @@ export const CashReceiptHandWrittenIssuanceStep1 = ({
|
|||||||
valueIsNumericString
|
valueIsNumericString
|
||||||
format="###########"
|
format="###########"
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setPhoneNumber(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setPhoneNumber(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></PatternFormat>
|
></PatternFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useSetOnBack } from '@/widgets/sub-layout/use-sub-layout';
|
|||||||
import { ProcessStep } from '../model/types';
|
import { ProcessStep } from '../model/types';
|
||||||
import { NumericFormat } from 'react-number-format';
|
import { NumericFormat } from 'react-number-format';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware';
|
||||||
|
|
||||||
export interface CashReceiptHandWrittenIssuanceStep2Props {
|
export interface CashReceiptHandWrittenIssuanceStep2Props {
|
||||||
setProcessStep: (processStep: ProcessStep) => void;
|
setProcessStep: (processStep: ProcessStep) => void;
|
||||||
@@ -33,6 +34,7 @@ export const CashReceiptHandWrittenIssuanceStep2 = ({
|
|||||||
onClickToVatCalculate
|
onClickToVatCalculate
|
||||||
}: CashReceiptHandWrittenIssuanceStep2Props) => {
|
}: CashReceiptHandWrittenIssuanceStep2Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { handleInputFocus, keyboardAwarePadding } = useKeyboardAware();
|
||||||
|
|
||||||
useSetOnBack(() => {
|
useSetOnBack(() => {
|
||||||
setProcessStep(ProcessStep.One);
|
setProcessStep(ProcessStep.One);
|
||||||
@@ -52,6 +54,7 @@ export const CashReceiptHandWrittenIssuanceStep2 = ({
|
|||||||
allowNegative={ false }
|
allowNegative={ false }
|
||||||
displayType="input"
|
displayType="input"
|
||||||
onChange={ (e: ChangeEvent<HTMLInputElement>) => setIssueAmount(parseInt(e.target.value)) }
|
onChange={ (e: ChangeEvent<HTMLInputElement>) => setIssueAmount(parseInt(e.target.value)) }
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></NumericFormat>
|
></NumericFormat>
|
||||||
<button
|
<button
|
||||||
className="btn-40 btn-white"
|
className="btn-40 btn-white"
|
||||||
@@ -70,6 +73,7 @@ export const CashReceiptHandWrittenIssuanceStep2 = ({
|
|||||||
allowNegative={ false }
|
allowNegative={ false }
|
||||||
displayType="input"
|
displayType="input"
|
||||||
onChange={ (e: ChangeEvent<HTMLInputElement>) => setSupplyAmount(parseInt(e.target.value)) }
|
onChange={ (e: ChangeEvent<HTMLInputElement>) => setSupplyAmount(parseInt(e.target.value)) }
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></NumericFormat>
|
></NumericFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,6 +85,7 @@ export const CashReceiptHandWrittenIssuanceStep2 = ({
|
|||||||
allowNegative={ false }
|
allowNegative={ false }
|
||||||
displayType="input"
|
displayType="input"
|
||||||
onChange={ (e: ChangeEvent<HTMLInputElement>) => setVatAmount(parseInt(e.target.value)) }
|
onChange={ (e: ChangeEvent<HTMLInputElement>) => setVatAmount(parseInt(e.target.value)) }
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></NumericFormat>
|
></NumericFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -92,10 +97,11 @@ export const CashReceiptHandWrittenIssuanceStep2 = ({
|
|||||||
allowNegative={ false }
|
allowNegative={ false }
|
||||||
displayType="input"
|
displayType="input"
|
||||||
onChange={ (e: ChangeEvent<HTMLInputElement>) => setTaxFreeAmount(parseInt(e.target.value)) }
|
onChange={ (e: ChangeEvent<HTMLInputElement>) => setTaxFreeAmount(parseInt(e.target.value)) }
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></NumericFormat>
|
></NumericFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="issue-row">
|
<div className="issue-row" style={keyboardAwarePadding}>
|
||||||
<div className="issue-label">{t('transaction.fields.serviceAmount')}</div>
|
<div className="issue-label">{t('transaction.fields.serviceAmount')}</div>
|
||||||
<div className="issue-field">
|
<div className="issue-field">
|
||||||
<NumericFormat
|
<NumericFormat
|
||||||
@@ -103,6 +109,7 @@ export const CashReceiptHandWrittenIssuanceStep2 = ({
|
|||||||
allowNegative={ false }
|
allowNegative={ false }
|
||||||
displayType="input"
|
displayType="input"
|
||||||
onChange={ (e: ChangeEvent<HTMLInputElement>) => setServiceCharge(parseInt(e.target.value)) }
|
onChange={ (e: ChangeEvent<HTMLInputElement>) => setServiceCharge(parseInt(e.target.value)) }
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></NumericFormat>
|
></NumericFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { overlay } from 'overlay-kit';
|
|||||||
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
import { Dialog } from '@/shared/ui/dialogs/dialog';
|
||||||
import { QnaSaveParams, QnaSaveResponse } from '@/entities/support/model/types';
|
import { QnaSaveParams, QnaSaveResponse } from '@/entities/support/model/types';
|
||||||
import { checkGrant } from '@/shared/lib/check-grant';
|
import { checkGrant } from '@/shared/lib/check-grant';
|
||||||
|
import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware';
|
||||||
|
|
||||||
export enum QnaRegisterPropsName {
|
export enum QnaRegisterPropsName {
|
||||||
Mid = 'Mid',
|
Mid = 'Mid',
|
||||||
@@ -39,6 +40,7 @@ export const QnaRegisterPage = () => {
|
|||||||
const [requestEmail, setRequestEmail] = useState<string>('');
|
const [requestEmail, setRequestEmail] = useState<string>('');
|
||||||
const [title, setTitle] = useState<string>('');
|
const [title, setTitle] = useState<string>('');
|
||||||
const [contents, setContents] = useState<string>('');
|
const [contents, setContents] = useState<string>('');
|
||||||
|
const { handleInputFocus, keyboardAwarePadding } = useKeyboardAware();
|
||||||
|
|
||||||
useSetHeaderTitle(t('support.qna.title'));
|
useSetHeaderTitle(t('support.qna.title'));
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
useSetHeaderType(HeaderType.LeftArrow);
|
||||||
@@ -171,6 +173,7 @@ export const QnaRegisterPage = () => {
|
|||||||
value={title}
|
value={title}
|
||||||
required={true}
|
required={true}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.Title)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.Title)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -205,6 +208,7 @@ export const QnaRegisterPage = () => {
|
|||||||
value={requestName}
|
value={requestName}
|
||||||
required={true}
|
required={true}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.RequestName)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.RequestName)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -219,6 +223,7 @@ export const QnaRegisterPage = () => {
|
|||||||
valueIsNumericString
|
valueIsNumericString
|
||||||
format="###########"
|
format="###########"
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.RequestTel)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.RequestTel)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></PatternFormat>
|
></PatternFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -230,10 +235,11 @@ export const QnaRegisterPage = () => {
|
|||||||
placeholder={t('support.qna.formLabels.emailPlaceholder')}
|
placeholder={t('support.qna.formLabels.emailPlaceholder')}
|
||||||
value={requestEmail}
|
value={requestEmail}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.RequestEmail)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setInputValue(e, QnaRegisterPropsName.RequestEmail)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="inq-text">
|
<div className="inq-text" style={keyboardAwarePadding}>
|
||||||
<div className="inq-text-label">
|
<div className="inq-text-label">
|
||||||
{t('support.qna.formLabels.inquiryContents')} <span className="red">{t('support.qna.formLabels.required')}</span>
|
{t('support.qna.formLabels.inquiryContents')} <span className="red">{t('support.qna.formLabels.required')}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -242,6 +248,7 @@ export const QnaRegisterPage = () => {
|
|||||||
value={contents}
|
value={contents}
|
||||||
required={true}
|
required={true}
|
||||||
onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setInputValue(e, QnaRegisterPropsName.Contents)}
|
onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setInputValue(e, QnaRegisterPropsName.Contents)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import moment from 'moment';
|
|||||||
import NiceCalendar from '@/shared/ui/calendar/nice-calendar';
|
import NiceCalendar from '@/shared/ui/calendar/nice-calendar';
|
||||||
import { notiBar, snackBar } from '@/shared/lib';
|
import { notiBar, snackBar } from '@/shared/lib';
|
||||||
import { BillingChargeParams, BillingChargeResponse } from '@/entities/transaction/model/types';
|
import { BillingChargeParams, BillingChargeResponse } from '@/entities/transaction/model/types';
|
||||||
|
import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware';
|
||||||
|
|
||||||
export const BillingChargePage = () => {
|
export const BillingChargePage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
@@ -31,7 +32,7 @@ export const BillingChargePage = () => {
|
|||||||
const [installmentMonth, setInstallmentMonth] = useState<string>('00');
|
const [installmentMonth, setInstallmentMonth] = useState<string>('00');
|
||||||
|
|
||||||
const [calendarOpen, setCalendarOpen] = useState<boolean>(false);
|
const [calendarOpen, setCalendarOpen] = useState<boolean>(false);
|
||||||
|
const { handleInputFocus, keyboardAwarePadding } = useKeyboardAware();
|
||||||
|
|
||||||
useSetHeaderTitle(t('billing.charge'));
|
useSetHeaderTitle(t('billing.charge'));
|
||||||
useSetHeaderType(HeaderType.RightClose);
|
useSetHeaderType(HeaderType.RightClose);
|
||||||
@@ -142,6 +143,7 @@ export const BillingChargePage = () => {
|
|||||||
type="text"
|
type="text"
|
||||||
value={billKey}
|
value={billKey}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => onChangeBillKey(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => onChangeBillKey(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -152,6 +154,7 @@ export const BillingChargePage = () => {
|
|||||||
type="text"
|
type="text"
|
||||||
value={productName}
|
value={productName}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setProductName(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setProductName(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -163,6 +166,7 @@ export const BillingChargePage = () => {
|
|||||||
allowNegative={false}
|
allowNegative={false}
|
||||||
displayType="input"
|
displayType="input"
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setProductAmount(parseInt(e.target.value))}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setProductAmount(parseInt(e.target.value))}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
></NumericFormat>
|
></NumericFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -173,6 +177,7 @@ export const BillingChargePage = () => {
|
|||||||
type="text"
|
type="text"
|
||||||
value={orderNumber}
|
value={orderNumber}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setOrderNumber(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setOrderNumber(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -183,6 +188,7 @@ export const BillingChargePage = () => {
|
|||||||
type="text"
|
type="text"
|
||||||
value={buyerName}
|
value={buyerName}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setBuyerName(e.target.value)}
|
onChange={(e: ChangeEvent<HTMLInputElement>) => setBuyerName(e.target.value)}
|
||||||
|
onFocus={handleInputFocus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -211,7 +217,7 @@ export const BillingChargePage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="billing-row">
|
<div className="billing-row" style={keyboardAwarePadding}>
|
||||||
<div className="billing-label">할부 개월</div>
|
<div className="billing-label">할부 개월</div>
|
||||||
<div className="billing-field">
|
<div className="billing-field">
|
||||||
<select
|
<select
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const useKeyboardAware = (options?: UseKeyboardAwareOptions) => {
|
|||||||
const [keyboardHeight, setKeyboardHeight] = useState<number>(0);
|
const [keyboardHeight, setKeyboardHeight] = useState<number>(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let focusedElement: HTMLInputElement | null = null;
|
let focusedElement: HTMLElement | null = null;
|
||||||
let isKeyboardOpen = false;
|
let isKeyboardOpen = false;
|
||||||
|
|
||||||
// 네이티브에서 호출할 전역 함수 등록
|
// 네이티브에서 호출할 전역 함수 등록
|
||||||
@@ -44,7 +44,7 @@ export const useKeyboardAware = (options?: UseKeyboardAwareOptions) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// focus된 요소를 추적하기 위한 함수
|
// focus된 요소를 추적하기 위한 함수
|
||||||
(window as any).setFocusedElement = (element: HTMLInputElement) => {
|
(window as any).setFocusedElement = (element: HTMLElement) => {
|
||||||
focusedElement = element;
|
focusedElement = element;
|
||||||
|
|
||||||
// 키보드가 이미 열려있으면 즉시 스크롤
|
// 키보드가 이미 열려있으면 즉시 스크롤
|
||||||
@@ -62,8 +62,8 @@ export const useKeyboardAware = (options?: UseKeyboardAwareOptions) => {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// 모든 input에서 사용할 공통 핸들러
|
// input과 textarea 모두에서 사용할 공통 핸들러
|
||||||
const handleInputFocus = (e: React.FocusEvent<HTMLInputElement>) => {
|
const handleInputFocus = (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||||
// focus된 요소를 저장
|
// focus된 요소를 저장
|
||||||
(window as any).setFocusedElement?.(e.target);
|
(window as any).setFocusedElement?.(e.target);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user