diff --git a/frontend/src/app/(dashboard)/messages/page.tsx b/frontend/src/app/(dashboard)/messages/page.tsx index 0a8bb0e..6ec2d2c 100644 --- a/frontend/src/app/(dashboard)/messages/page.tsx +++ b/frontend/src/app/(dashboard)/messages/page.tsx @@ -2,7 +2,7 @@ import { formatDistanceToNow } from "date-fns"; import { fr } from "date-fns/locale"; -import { Search, Send, UserPlus, X } from "lucide-react"; +import { ArrowLeft, Search, Send, UserPlus, X } from "lucide-react"; import Link from "next/link"; import { useRouter, useSearchParams } from "next/navigation"; import * as React from "react"; @@ -238,7 +238,11 @@ export default function MessagesPage() { return (
{/* Sidebar - Liste des conversations */} -
+

Messages

@@ -378,14 +382,26 @@ export default function MessagesPage() {
{/* Zone de chat */} -
+
{activeConv ? ( <> {/* Header */} -
+
+ diff --git a/frontend/src/components/notification-handler.tsx b/frontend/src/components/notification-handler.tsx index a6440f2..2ca58c0 100644 --- a/frontend/src/components/notification-handler.tsx +++ b/frontend/src/components/notification-handler.tsx @@ -30,10 +30,9 @@ export function NotificationHandler() { toast.custom( (t) => ( -
{ toast.dismiss(t); if (data.type === "message") { @@ -42,16 +41,6 @@ export function NotificationHandler() { router.push(`/meme/${data.contentId}`); } }} - onKeyDown={(e) => { - if (e.key === "Enter" || e.key === " ") { - toast.dismiss(t); - if (data.type === "message") { - router.push("/messages"); - } else if (data.contentId) { - router.push(`/meme/${data.contentId}`); - } - } - }} >
{data.type === "comment" && ( @@ -71,15 +60,15 @@ export function NotificationHandler() {
-
+ ), { duration: 5000, @@ -91,20 +80,23 @@ export function NotificationHandler() { socket.on("notification", handleNotification); // Aussi pour les nouveaux messages (si on veut un toast global) - socket.on("new_message", (data: { message: any }) => { - if (window.location.pathname !== "/messages") { - toast( - `Nouveau message de @${data.message.sender?.username || "un membre"}`, - { - description: data.message.text.substring(0, 50), - action: { - label: "Voir", - onClick: () => router.push("/messages"), + socket.on( + "new_message", + (data: { message: { text: string; sender?: { username: string } } }) => { + if (window.location.pathname !== "/messages") { + toast( + `Nouveau message de @${data.message.sender?.username || "un membre"}`, + { + description: data.message.text.substring(0, 50), + action: { + label: "Voir", + onClick: () => router.push("/messages"), + }, }, - }, - ); - } - }); + ); + } + }, + ); return () => { socket.off("notification"); diff --git a/frontend/src/components/share-dialog.tsx b/frontend/src/components/share-dialog.tsx index 37a24b3..5340e63 100644 --- a/frontend/src/components/share-dialog.tsx +++ b/frontend/src/components/share-dialog.tsx @@ -28,9 +28,10 @@ interface ShareDialogProps { export function ShareDialog({ contentId, contentTitle, + contentUrl: _unused, // Support legacy prop open, onOpenChange, -}: Omit) { +}: ShareDialogProps) { const [searchQuery, setSearchQuery] = React.useState(""); const [results, setResults] = React.useState([]); const [isLoading, setIsLoading] = React.useState(false); diff --git a/frontend/src/components/two-factor-setup.tsx b/frontend/src/components/two-factor-setup.tsx index 0ed3353..98de0ae 100644 --- a/frontend/src/components/two-factor-setup.tsx +++ b/frontend/src/components/two-factor-setup.tsx @@ -29,6 +29,7 @@ export function TwoFactorSetup() { const [secret, setSecret] = useState(null); const [otpValue, setOtpValue] = useState(""); const [isLoading, setIsLoading] = useState(false); + const [isRevealed, setIsRevealed] = useState(false); const handleSetup = async () => { setIsLoading(true); @@ -152,24 +153,59 @@ export function TwoFactorSetup() { {qrCode && ( -
- QR Code 2FA +
+
+ QR Code 2FA +
+ {!isRevealed && ( +
+ +
+ )}
)}

Ou entrez ce code manuellement :

- - {secret} - +
+ + {secret} + + {!isRevealed && ( +
+ +
+ )} +