diff --git a/.env b/.env index c7c3ef6..54a8f3c 100755 --- a/.env +++ b/.env @@ -18,7 +18,8 @@ REACT_APP_RESOURCES="Resources" REACT_APP_HISTORY="History" REACT_APP_TRACKING_SHOW=1 +REACT_APP_HISTORY_SHOW=1 REACT_APP_RESOURCES_SHOW=1 -REACT_APP_VERSION_NO="DEF-CONFIG" \ No newline at end of file +REACT_APP_VERSION_NO="DEF-CONFIG" diff --git a/.env.development b/.env.development index 32ad057..53af7cc 100644 --- a/.env.development +++ b/.env.development @@ -18,6 +18,7 @@ REACT_APP_RESOURCES="Resources" REACT_APP_HISTORY="History" REACT_APP_TRACKING_SHOW=1 +REACT_APP_HISTORY_SHOW=1 REACT_APP_RESOURCES_SHOW=1 diff --git a/.env.production b/.env.production index 7fa3e8e..4c04cb4 100644 --- a/.env.production +++ b/.env.production @@ -18,6 +18,7 @@ REACT_APP_RESOURCES="Resources" REACT_APP_HISTORY="History" REACT_APP_TRACKING_SHOW=0 +REACT_APP_HISTORY_SHOW=0 REACT_APP_RESOURCES_SHOW=0 diff --git a/src/components/Calendar/CalendarTable.jsx b/src/components/Calendar/CalendarTable.jsx index 6e77c7a..21ef4c1 100755 --- a/src/components/Calendar/CalendarTable.jsx +++ b/src/components/Calendar/CalendarTable.jsx @@ -21,11 +21,11 @@ export default function CalendarTable({ className }) { const [value, onChange] = useState(new Date()); // value of calendar date and onchange handler for calendar const [remDate, setRemDate] = useState([]) // for holding dates on reminders to display on calendar - const reminderApi = new usersService(); // instantiating the API SERVICE + const calenderApi = new usersService(); // instantiating the API SERVICE const getUserReminders = async () => { try { - const res = await reminderApi.getUserReminders(); + const res = await calenderApi.getUserReminders(); if(res.status == 200 && res.data.status > 0){ setRemDate(res.data.reminders) setIsLoading(false) @@ -117,32 +117,46 @@ export default function CalendarTable({ className }) { ); } -const ReminderThumbnail = ({reminders}) => { +/** + * Renders a list of reminder thumbnails. + * Each thumbnail displays the reminder's category image, description, and start date. + + * Each object should have the following properties: + * - category (string): The category of the reminder. + * - description (string): The description of the reminder. + * - start_date (string): The start date of the reminder. + */ +const ReminderThumbnail = ({ reminders }) => { + const getThumbnailImage = (category) => { + if (!category) { + return dataImage1; + } + return localImgLoad(`images/${category}.png`); + }; + return (
{reminders.map((reminder, index) => (
-
- data -
-
-

- {reminder.description?.substring(0, 20)+ ' ...'} -

- - - Added - {reminder.start_date.split(' ')[0]} +
+ data +
+
+

+ {reminder.description?.substring(0, 20) + ' ...'} +

+ + Added + {reminder.start_date.split(' ')[0]} - + +
-
))} -
- ) -} \ No newline at end of file + ); +}; \ No newline at end of file diff --git a/src/components/Partials/MobileSideBar.jsx b/src/components/Partials/MobileSideBar.jsx index 400f1a5..9413226 100755 --- a/src/components/Partials/MobileSideBar.jsx +++ b/src/components/Partials/MobileSideBar.jsx @@ -1,7 +1,6 @@ import React, { useContext } from "react"; import { NavLink } from "react-router-dom"; -import logo from "../../assets/images/myfit-logo-2.png"; //logo-2.svg"; -import logo3 from "../../assets/images/myfit-logo-2.png"; //logo-3.svg"; +import { default as logo, default as logo3 } from "../../assets/images/myfit-logo-2.png"; //logo-2.svg"; import DarkModeContext from "../Contexts/DarkModeContext"; import Icons from "../Helpers/Icons"; @@ -130,25 +129,9 @@ export default function MobileSidebar({ sidebar, action, logoutModalHandler }) { - - {process.env.REACT_APP_RESOURCES_SHOW == true ? -
  • - - - - - - {process.env.REACT_APP_RESOURCES} - - -
  • - : - <> - } -
  • + + {(process.env.REACT_APP_HISTORY_SHOW == true) ? + (
  • - History + {process.env.REACT_APP_HISTORY} -
  • + ) + : ''} diff --git a/src/components/Partials/Sidebar.jsx b/src/components/Partials/Sidebar.jsx index 6c78929..de55705 100755 --- a/src/components/Partials/Sidebar.jsx +++ b/src/components/Partials/Sidebar.jsx @@ -235,7 +235,7 @@ export default function Sidebar({ sidebar, action, logoutModalHandler }) { sidebar ? "active flex-1" : "w-0" }`} > - History + {process.env.REACT_APP_HISTORY} diff --git a/src/views/CalendarPage.jsx b/src/views/CalendarPage.jsx index c09279d..0211214 100755 --- a/src/views/CalendarPage.jsx +++ b/src/views/CalendarPage.jsx @@ -2,9 +2,9 @@ import React from "react"; import Calendar from "../components/Calendar"; export default function CalendarPage() { - return ( - <> - - - ); + return ( + <> + + + ); }