From b319df86a769467e0d6173e9d36142c059800038 Mon Sep 17 00:00:00 2001 From: jennyjoo <100cllr@gmail.com> Date: Tue, 9 Jul 2024 09:10:34 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=95=8C=EB=B0=94=EC=83=9D=20=EC=BA=98?= =?UTF-8?q?=EB=A6=B0=EB=8D=94=20=EC=83=81=EC=84=B8=20=EA=B7=BC=EB=AC=B4=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/employee/DetailWorkInfo.tsx | 86 ++++++++++++++++++++++ src/pages/LoginPgae/LoginPage.tsx | 4 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/components/employee/DetailWorkInfo.tsx diff --git a/src/components/employee/DetailWorkInfo.tsx b/src/components/employee/DetailWorkInfo.tsx new file mode 100644 index 0000000..1bafee9 --- /dev/null +++ b/src/components/employee/DetailWorkInfo.tsx @@ -0,0 +1,86 @@ +import ColorTag from '../ui/ColorTag'; +import WhiteBox from '../ui/WhiteBox'; +import WorkPlaceName from '../ui/WorkPlaceName'; + +type Prop = { + scheduleInfo: ScheduleInfo; +}; + +type ScheduleInfo = { + id: number; + workPlaceName: string; // + workPlaceColorCode: string; // + attendDate: string; + startTime: Date; + endDate: Date; + payment: number; + isConnected?: boolean; + restMinute?: number; + attendanceType?: string; +}; + +const DetailWorkInfo = ({ scheduleInfo }: Prop) => { + const dateConvert = (date: string) => { + const year = +date.substring(0, 4); + const month = +date.substring(4, 6); + const day = +date.substring(6); + + // const dat = new Date(); + // dat.setFullYear(+year); + // dat.setMonth(+month); + // dat.setDate(+day); + + return { year, month, day }; + }; + + const dateFormat = ({ + year, + month, + day, + }: { + year: number; + month: number; + day: number; + }) => { + return `${year}.${month === 0 ? '00' : month}.${day === 0 ? '00' : day}`; + }; + + return ( + <> + +
+
+ +
+ {scheduleInfo.attendanceType === 'REAL' && ( + + 출석 완료 + + )} +
+
+ +
+
+
근무일자
+
+ {dateFormat(dateConvert(scheduleInfo.attendDate))} +
+
+
+
시급
+
+ {scheduleInfo.payment.toLocaleString()}원 +
+
+
+
+
+ + ); +}; + +export default DetailWorkInfo; diff --git a/src/pages/LoginPgae/LoginPage.tsx b/src/pages/LoginPgae/LoginPage.tsx index e9c64da..6dec998 100644 --- a/src/pages/LoginPgae/LoginPage.tsx +++ b/src/pages/LoginPgae/LoginPage.tsx @@ -4,6 +4,7 @@ import BtnBottom from '../../components/BtnBottom'; import login, { LoginReturnType, ROLE } from '../../components/login'; import ModalCenter from '../../components/ModalCenter'; import { useNavigate } from 'react-router-dom'; +import DetailWorkInfo from '../../components/employee/DetailWorkInfo'; const LoginPage = () => { const [pwErr, pwIdErr] = useState(''); @@ -51,7 +52,7 @@ const LoginPage = () => { )}
-
+
Log-in
간편 비밀번호를 입력해주세요 @@ -67,6 +68,7 @@ const LoginPage = () => { {pwErr}
+