diff --git a/client/src/components/DateWidget.tsx b/client/src/components/DateWidget.tsx new file mode 100644 index 0000000..2d44f04 --- /dev/null +++ b/client/src/components/DateWidget.tsx @@ -0,0 +1,34 @@ +import { Card, CardContent } from "@/components/ui/card"; +import { Calendar } from "lucide-react"; + +const formatDate = (date: Date): string => { + return date.toLocaleDateString('fr-FR', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + }); +}; + + + +export default function DateWidget() { + const now = new Date(); + + return ( + + +
+
+ +
+
+ + {formatDate(now)} + +
+
+
+
+ ); +} \ No newline at end of file diff --git a/client/src/components/Layout.tsx b/client/src/components/Layout.tsx index 1d60d87..bf3b9ec 100644 --- a/client/src/components/Layout.tsx +++ b/client/src/components/Layout.tsx @@ -7,6 +7,7 @@ import { useAuthUnified } from "@/hooks/useAuthUnified"; import { useIsMobile } from "@/hooks/use-mobile"; import Sidebar from "./Sidebar"; import WeatherWidget from "./WeatherWidget"; +import DateWidget from "./DateWidget"; import type { Group } from "@shared/schema"; interface StoreContextType { @@ -92,8 +93,11 @@ export default function Layout({ children }: LayoutProps) { )} - {/* Weather widget */} - + {/* Weather and Date widgets */} +
+ + +
{/* Store selector for admin - responsive */} diff --git a/client/src/components/WeatherWidget.tsx b/client/src/components/WeatherWidget.tsx index 73a2b6d..0920590 100644 --- a/client/src/components/WeatherWidget.tsx +++ b/client/src/components/WeatherWidget.tsx @@ -21,14 +21,7 @@ interface WeatherResponse { location: string; } -const formatDate = (date: Date): string => { - return date.toLocaleDateString('fr-FR', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric' - }); -}; + const WeatherIcon = ({ condition, size = 20 }: { condition: string; size?: number }) => { const iconClass = `h-${Math.floor(size/4)} w-${Math.floor(size/4)}`; @@ -128,9 +121,6 @@ export default function WeatherWidget() { {weather.currentYear?.condition || 'Inconnu'} - - {formatDate(new Date())} -