From d955cc79422d75ace6a5eb58497601b4e63008ae Mon Sep 17 00:00:00 2001 From: bragaz_rexita Date: Tue, 4 Nov 2025 17:01:27 +0700 Subject: [PATCH] Repair beautiful apps --- src/components/Global/DateRealTime.jsx | 48 ++++++++++++++++++++++++++ src/layout/LayoutHeader.jsx | 35 ++++++++++++++++--- src/layout/LayoutSidebar.jsx | 4 +++ 3 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 src/components/Global/DateRealTime.jsx diff --git a/src/components/Global/DateRealTime.jsx b/src/components/Global/DateRealTime.jsx new file mode 100644 index 0000000..9e7f174 --- /dev/null +++ b/src/components/Global/DateRealTime.jsx @@ -0,0 +1,48 @@ +import { useState, useEffect } from 'react'; +import { Typography } from 'antd'; + +const { Title, Text } = Typography; + +const JamRealtimeAntd = () => { + const [waktu, setWaktu] = useState(new Date()); + + useEffect(() => { + const interval = setInterval(() => { + setWaktu(new Date()); + }, 1000); + + return () => clearInterval(interval); + }, []); + + // Format custom manual untuk konsistensi + const formatWaktuLengkap = (date) => { + const hari = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu']; + const bulan = [ + 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', + 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember' + ]; + + const namaHari = hari[date.getDay()]; + const tanggal = date.getDate().toString().padStart(2, '0'); + const namaBulan = bulan[date.getMonth()]; + const tahun = date.getFullYear(); + + const jam = date.getHours().toString().padStart(2, '0'); + const menit = date.getMinutes().toString().padStart(2, '0'); + const detik = date.getSeconds().toString().padStart(2, '0'); + + return `${namaHari}, ${tanggal} ${namaBulan} ${tahun} ${jam}:${menit}:${detik}`; + }; + + return ( + + {formatWaktuLengkap(waktu)} + + ); +}; + +export default JamRealtimeAntd; \ No newline at end of file diff --git a/src/layout/LayoutHeader.jsx b/src/layout/LayoutHeader.jsx index 0cb0a8a..2899387 100644 --- a/src/layout/LayoutHeader.jsx +++ b/src/layout/LayoutHeader.jsx @@ -5,6 +5,7 @@ import handleLogOut from '../Utils/Auth/Logout'; import { useBreadcrumb } from './LayoutBreadcrumb'; import { decryptData } from '../components/Global/Formatter'; import { useNavigate } from 'react-router-dom'; +import DateRealTime from '../components/Global/DateRealTime'; const { Link, Text } = Typography; const { Header } = Layout; @@ -17,7 +18,7 @@ const LayoutHeader = () => { const { token } = theme.useToken() || {}; const colorBgContainer = token?.colorBgContainer || '#fff'; const colorBorder = token?.colorBorder || '#d9d9d9'; - const colorText = token?.colorText || '#000'; + const colorText = token?.colorText || '#1BAA56'; // Ambil data user dari localStorage let userData = null; @@ -73,8 +74,9 @@ const LayoutHeader = () => { paddingBottom: 20, paddingLeft: 24, paddingRight: 24, - minHeight: 100, + // minHeight: 100, boxSizing: 'border-box', + boxShadow: '5px 0 10px rgba(0, 0, 0, 0.4)' }} >
{ > - Login AS {roleName} + {/* Login AS {roleName} */} + CALL OF DUTY
+
+ {/* */} + {/* Login AS {roleName} */} + {/* Kamis, 04 November 2025 16:35:00 */} + {/* */} + +
+
{ left: 0, top: 0, bottom: 0, + borderTopRightRadius: '30px', + borderBottomRightRadius: '30px', + boxShadow: '5px 0 10px rgba(0, 0, 0, 0.4)', + zIndex: 9999 }} >