diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d5bf4aa..a7c4c44 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,6 +6,8 @@ + + - { + "keyToString": { + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "master", + "kotlin-language-version-configured": "true", + "last_opened_file_path": "C:/Users/Juanes/OneDrive/Escritorio/Testing-font", + "settings.editor.selected.configurable": "org.jetbrains.plugins.github.ui.GithubSettingsConfigurable" } -}]]> +} @@ -139,7 +141,7 @@ - diff --git a/src/pages/Calendar/Calendar.css b/src/pages/Calendar/Calendar.css index 1d58aee..e184e6c 100644 --- a/src/pages/Calendar/Calendar.css +++ b/src/pages/Calendar/Calendar.css @@ -10,14 +10,12 @@ border-radius: 8px; } - .react-calendar__navigation button { background-color: transparent; color: #333; font-size: 1rem; } - .react-calendar__month-view__days { margin-top: 0.5rem; } @@ -26,26 +24,33 @@ background-color: #A4826D !important; } - +.highlight { + background-color: #E1E6F0 !important; + border-radius: 50%; +} .react-calendar__tile--active { background-color: #007bff; - color: #fff; + color: #fff; } - .react-calendar__tile--active:enabled:focus, .react-calendar__tile--active:enabled:hover, .react-calendar__tile--active:enabled:active { - background-color: #86654b; + background-color: #86654b; } - .react-calendar__tile--now { background-color: #A4826D; - color: #333; + color: #333; } +.highlight-today { + background-color: #FFE4B5 !important; + border-radius: 50%; +} + + diff --git a/src/pages/Calendar/Calendar.js b/src/pages/Calendar/Calendar.js index a2112c8..6498884 100644 --- a/src/pages/Calendar/Calendar.js +++ b/src/pages/Calendar/Calendar.js @@ -1,38 +1,64 @@ -import React, { useState } from 'react'; -import { Link } from 'react-router-dom'; +import React, { useState, useEffect } from 'react'; +import { Link } from 'react-router-dom'; import NavBar from '../../components/Navbar/NavBar'; import Calendar from 'react-calendar'; -import 'react-calendar/dist/Calendar.css'; +import 'react-calendar/dist/Calendar.css'; import './Calendar.css'; import OutfitOfDay from '../../components/OutfitOfDay/OutfitOfDay'; +import apiClient from '../../services/apiClient'; const CalendarPage = () => { const [date, setDate] = useState(new Date()); + const [outfitDates, setOutfitDates] = useState([]); const onChange = (date) => { setDate(date); }; + useEffect(() => { + const fetchOutfitDates = async () => { + try { + const response = await apiClient.get('/outfit/dates'); // Cambia la ruta segĂșn tu API + setOutfitDates(response.data); + } catch (error) { + console.error('Error fetching outfit dates:', error); + } + }; + + fetchOutfitDates(); + }, []); + + const tileClassName = ({ date, view }) => { + if (view === 'month') { + const dateString = date.toISOString().split('T')[0]; + if (outfitDates.includes(dateString)) { + return 'highlight'; + } + } + return null; + }; + return (
- -
+ +

Calendar

-
+
-
+
- +
-
+
@@ -41,3 +67,4 @@ const CalendarPage = () => { } export default CalendarPage; +