스낵바 기능 추가, 현금영수증 날짜 변경 추가

This commit is contained in:
focp212@naver.com
2025-10-23 16:33:27 +09:00
parent 439ea941b0
commit 372ecfa3f0
3 changed files with 24 additions and 7 deletions

View File

@@ -1,4 +1,3 @@
import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow';
import { InfoSectionProps } from '../../model/types'; import { InfoSectionProps } from '../../model/types';
import moment from 'moment'; import moment from 'moment';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
@@ -11,8 +10,14 @@ export const IssueInfoSection = ({
const [issueDateTime, setIssueDateTime] = useState<string>(''); const [issueDateTime, setIssueDateTime] = useState<string>('');
useEffect(() => { useEffect(() => {
setIssueDateTime(issueInfo?.issueDate + ' ' + issueInfo?.issueTime); let issueDate = issueInfo?.issueDate;
}, []); let issueTime = issueInfo?.issueTime;
if(issueDate && issueTime){
let date = issueDate.substr(0, 4) + '-' + issueDate.substr(4, 2) + '-' + issueDate.substr(6, 2);
let time = issueTime.substr(0, 2) + ':' + issueTime.substr(2, 2) + ':' + issueTime.substr(4, 2);
setIssueDateTime(date + ' '+ time);
}
}, [issueInfo]);
return ( return (
<> <>

View File

@@ -78,8 +78,10 @@ export const BillingChargePage = () => {
installmentMonth: installmentMonth installmentMonth: installmentMonth
}; };
billingCharge(params).then((rs) => { billingCharge(params).then((rs) => {
console.log(rs); snackBar('결제 신청을 성공하였습니다.', function(){
navigate(PATHS.transaction.billing.list); navigate(PATHS.transaction.billing.list);
});
}).catch((e: any) => { }).catch((e: any) => {
/* /*
if(e.response?.data?.message){ if(e.response?.data?.message){

View File

@@ -1,11 +1,21 @@
import { toast } from "react-toastify"; import { toast } from "react-toastify";
export const snackBar = (text: string) => { export const snackBar = (text: string, callback?: () => void) => {
toast.dismiss({ containerId: 'snackbar' }); toast.dismiss({ containerId: 'snackbar' });
toast(text, { containerId: 'snackbar' }); toast(text, { containerId: 'snackbar' });
if(!!callback && typeof(callback) === 'function'){
setTimeout(() => {
callback();
}, 3000);
}
}; };
export const notiBar = (text: string) => { export const notiBar = (text: string, callback?: () => void) => {
toast.dismiss({ containerId: 'notibar' }); toast.dismiss({ containerId: 'notibar' });
toast(text, { containerId: 'notibar' }); toast(text, { containerId: 'notibar' });
if(!!callback && typeof(callback) === 'function'){
setTimeout(() => {
callback();
}, 3000);
}
}; };