diff --git a/web-app/src/Components/Layouts/MainLayout.jsx b/web-app/src/Components/Layouts/MainLayout.jsx index 67b1aaa..57bf751 100644 --- a/web-app/src/Components/Layouts/MainLayout.jsx +++ b/web-app/src/Components/Layouts/MainLayout.jsx @@ -33,10 +33,8 @@ const MainLayout = () => { } menuItems.push( - mainLayoutData.getItem("Мой профиль", "profile", , [ - mainLayoutData.getItem("Перейти в профиль", "/profile", ), - mainLayoutData.getItem("Выйти", "logout", ) - ]) + mainLayoutData.getItem("Перейти в профиль", "/profile", ), + mainLayoutData.getItem("Выйти", "logout", ) ); if (mainLayoutData.isUserError) { @@ -45,48 +43,101 @@ const MainLayout = () => { return ( - -
- Логотип -
- - + {mainLayoutData.screens.xs ? ( + <> + + {mainLayoutData.isUserLoading ? ( + + ) : ( + + )} + + +
+ Логотип +
+ + +
+ Visus+ © {new Date().getFullYear()} +
+ + ) : ( + <> + +
+ Логотип +
+ + + + + + {mainLayoutData.isUserLoading ? ( + + ) : ( + + )} + +
Visus+ © {new Date().getFullYear()}
+
+ + )} - - - {mainLayoutData.isUserLoading ? ( - - ) : ( - - )} - -
Visus+ © {new Date().getFullYear()}
-
); }; diff --git a/web-app/src/Components/Pages/AppointmentsPage/AppointmentsPage.jsx b/web-app/src/Components/Pages/AppointmentsPage/AppointmentsPage.jsx index adc1e10..0ddbc68 100644 --- a/web-app/src/Components/Pages/AppointmentsPage/AppointmentsPage.jsx +++ b/web-app/src/Components/Pages/AppointmentsPage/AppointmentsPage.jsx @@ -7,7 +7,7 @@ import { PlusOutlined, ClockCircleOutlined, } from "@ant-design/icons"; -import AppointmentsCalendarTab from "./Components/AppointmentCalendarTab/AppointmentsCalendarTab.jsx"; +import AppointmentsCalendar from "./Components/AppointmentCalendar/AppointmentsCalendar.jsx"; import useAppointments from "./useAppointments.js"; import dayjs from 'dayjs'; import LoadingIndicator from "../../Widgets/LoadingIndicator/LoadingIndicator.jsx"; @@ -87,7 +87,7 @@ const AppointmentsPage = () => { min="25%" max="90%" > - { - const appointmentsCalendarUI = useAppointmentCalendarUI(appointments, scheduledAppointments); +const AppointmentsCalendar = ({currentMonth, onMonthChange, appointments, scheduledAppointments}) => { + const appointmentsCalendarUI = useAppointmentCalendar(appointments, scheduledAppointments); const dateCellRender = (value) => { const appointmentsForDate = appointmentsCalendarUI.getAppointmentsByListAndDate( @@ -39,12 +39,11 @@ const AppointmentsCalendarTab = ({currentMonth, onMonthChange, appointments, sch
{ appointmentsCalendarUI.onPanelChange(value, mode); if (mode === "month") { - onMonthChange(value); // Вызываем onMonthChange при смене месяца + onMonthChange(value); } }} cellRender={dateCellRender} @@ -54,11 +53,11 @@ const AppointmentsCalendarTab = ({currentMonth, onMonthChange, appointments, sch ); }; -AppointmentsCalendarTab.propTypes = { +AppointmentsCalendar.propTypes = { currentMonth: PropTypes.object.isRequired, onMonthChange: PropTypes.func.isRequired, appointments: PropTypes.array.isRequired, scheduledAppointments: PropTypes.array.isRequired, }; -export default AppointmentsCalendarTab; \ No newline at end of file +export default AppointmentsCalendar; \ No newline at end of file diff --git a/web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendarTab/useAppointmentCalendarUI.js b/web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendar/useAppointmentCalendar.js similarity index 95% rename from web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendarTab/useAppointmentCalendarUI.js rename to web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendar/useAppointmentCalendar.js index 91882a3..fd4cbeb 100644 --- a/web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendarTab/useAppointmentCalendarUI.js +++ b/web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendar/useAppointmentCalendar.js @@ -17,7 +17,7 @@ dayjs.tz.setDefault("Europe/Moscow"); const { useBreakpoint } = Grid; -const useAppointmentCalendarUI = (appointments, scheduledAppointments) => { +const useAppointmentCalendar = (appointments, scheduledAppointments) => { const dispatch = useDispatch(); const selectedDate = dayjs.tz(useSelector((state) => state.appointmentsUI.selectedDate), "Europe/Moscow"); @@ -75,4 +75,4 @@ const useAppointmentCalendarUI = (appointments, scheduledAppointments) => { }; }; -export default useAppointmentCalendarUI; \ No newline at end of file +export default useAppointmentCalendar; \ No newline at end of file diff --git a/web-app/src/Components/Pages/AppointmentsPage/Components/CalendarCell/CalendarCell.jsx b/web-app/src/Components/Pages/AppointmentsPage/Components/CalendarCell/CalendarCell.jsx index a31bfa3..cd58657 100644 --- a/web-app/src/Components/Pages/AppointmentsPage/Components/CalendarCell/CalendarCell.jsx +++ b/web-app/src/Components/Pages/AppointmentsPage/Components/CalendarCell/CalendarCell.jsx @@ -2,7 +2,7 @@ import {Badge, Col, Tag, Tooltip} from "antd"; import PropTypes from "prop-types"; import {AppointmentPropType} from "../../../../../Types/appointmentPropType.js"; import {ScheduledAppointmentPropType} from "../../../../../Types/scheduledAppointmentPropType.js"; -import useCalendarCellUI from "./useCalendarCellUI.js"; +import useCalendarCell from "./useCalendarCell.js"; const CalendarCell = ({allAppointments, onCellClick, onItemClick}) => { const { @@ -18,7 +18,7 @@ const CalendarCell = ({allAppointments, onCellClick, onItemClick}) => { getBadgeText, getTagColor, getBadgeStatus, - } = useCalendarCellUI(); + } = useCalendarCell(); return (
{ +const useCalendarCell = () => { const containerRef = useRef(null); const [isCompressed, setIsCompressed] = useState(false); const COMPRESSION_THRESHOLD = 70; @@ -53,7 +53,7 @@ const useCalendarCellUI = () => { const compressedCountStyle = { position: "absolute", - top: 2, + bottom: 12, right: 2, fontSize: 10, fontWeight: "bold", @@ -108,4 +108,4 @@ const useCalendarCellUI = () => { }; }; -export default useCalendarCellUI; \ No newline at end of file +export default useCalendarCell; \ No newline at end of file diff --git a/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js b/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js index 6e286c1..07e5a42 100644 --- a/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js +++ b/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js @@ -1,12 +1,12 @@ -import { useEffect, useMemo, useState } from "react"; -import { useDispatch, useSelector } from "react-redux"; -import { notification } from "antd"; -import { Grid } from "antd"; +import {useEffect, useMemo, useState} from "react"; +import {useDispatch, useSelector} from "react-redux"; +import {notification} from "antd"; +import {Grid} from "antd"; import { useGetAppointmentsQuery, useGetUpcomingAppointmentsQuery, } from "../../../Api/appointmentsApi.js"; -import { useGetAllPatientsQuery } from "../../../Api/patientsApi.js"; +import {useGetAllPatientsQuery} from "../../../Api/patientsApi.js"; import { openModal, openScheduledModal, @@ -26,12 +26,12 @@ import timezone from "dayjs/plugin/timezone"; dayjs.extend(utc); dayjs.extend(timezone); -const { useBreakpoint } = Grid; +const {useBreakpoint} = Grid; const useAppointments = () => { const dispatch = useDispatch(); - const { userData } = useSelector(state => state.auth); - const { collapsed, siderWidth, hovered, selectedAppointment } = useSelector(state => state.appointmentsUI); + const {userData} = useSelector(state => state.auth); + const {collapsed, siderWidth, hovered, selectedAppointment} = useSelector(state => state.appointmentsUI); const screens = useBreakpoint(); const [currentMonth, setCurrentMonth] = useState(dayjs().startOf('month')); @@ -47,7 +47,7 @@ const useAppointments = () => { data: appointments = [], isLoading: isLoadingAppointments, isError: isErrorAppointments, - } = useGetAppointmentsQuery({ doctor_id: userData.id, start_date: startDate, end_date: endDate }, { + } = useGetAppointmentsQuery({doctor_id: userData.id, start_date: startDate, end_date: endDate}, { pollingInterval: 60000, skip: !userData.id, }); @@ -56,7 +56,7 @@ const useAppointments = () => { data: scheduledAppointments = [], isLoading: isLoadingScheduledAppointments, isError: isErrorScheduledAppointments, - } = useGetScheduledAppointmentsQuery({ doctor_id: userData.id, start_date: startDate, end_date: endDate }, { + } = useGetScheduledAppointmentsQuery({doctor_id: userData.id, start_date: startDate, end_date: endDate}, { pollingInterval: 60000, skip: !userData.id, }); @@ -90,10 +90,10 @@ const useAppointments = () => { const [localSiderWidth, setLocalSiderWidth] = useState(siderWidth); - const splitterStyle = { flex: 1 }; - const splitterContentPanelStyle = { padding: 16 }; - const splitterSiderPanelStyle = { padding: "16px", borderLeft: "1px solid #ddd", overflowY: "auto" }; - const siderTitleStyle = { marginBottom: 36 }; + const splitterStyle = {flex: 1}; + const splitterContentPanelStyle = {padding: 16}; + const splitterSiderPanelStyle = {padding: "16px", borderLeft: "1px solid #ddd", overflowY: "auto"}; + const siderTitleStyle = {marginBottom: 36}; const siderButtonContainerStyle = { position: "fixed", right: 0,