This commit is contained in:
alma 2025-05-04 22:50:23 +02:00
parent 838a06f215
commit e6211f0edf
5 changed files with 43 additions and 7 deletions

23
app/livres/page.tsx Normal file
View File

@ -0,0 +1,23 @@
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { redirect } from "next/navigation";
import { ResponsiveIframe } from "@/app/components/responsive-iframe";
export default async function LivresPage() {
const session = await getServerSession(authOptions);
if (!session) {
redirect("/signin");
}
return (
<main className="w-full h-screen bg-black">
<div className="w-full h-full px-4 pt-12 pb-4">
<ResponsiveIframe
src={process.env.NEXT_PUBLIC_IFRAME_LIVRE_URL || ''}
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
/>
</div>
</main>
);
}

View File

@ -213,7 +213,7 @@ export function AnnouncementForm({ userRole }: AnnouncementFormProps) {
<FormItem> <FormItem>
<FormLabel className="text-gray-700">Target Audience</FormLabel> <FormLabel className="text-gray-700">Target Audience</FormLabel>
<FormControl> <FormControl>
<div className="p-3 border border-gray-200 rounded-md bg-gray-50"> <div className="p-3 border border-gray-200 rounded-md bg-white">
<p className="text-sm text-gray-500 mb-2">Select which roles can see this announcement:</p> <p className="text-sm text-gray-500 mb-2">Select which roles can see this announcement:</p>
<div className="flex flex-wrap gap-2"> <div className="flex flex-wrap gap-2">
{availableRoles.map(role => ( {availableRoles.map(role => (
@ -222,8 +222,8 @@ export function AnnouncementForm({ userRole }: AnnouncementFormProps) {
variant={selectedRoles.includes(role.id) ? "default" : "outline"} variant={selectedRoles.includes(role.id) ? "default" : "outline"}
className={`cursor-pointer px-3 py-1 ${ className={`cursor-pointer px-3 py-1 ${
selectedRoles.includes(role.id) selectedRoles.includes(role.id)
? "bg-blue-600 hover:bg-blue-700" ? "bg-blue-600 hover:bg-blue-700 text-white"
: "hover:bg-gray-100" : "bg-white hover:bg-gray-100 text-gray-700 border-gray-300"
}`} }`}
onClick={() => handleRoleToggle(role.id)} onClick={() => handleRoleToggle(role.id)}
> >

View File

@ -123,7 +123,11 @@ export function AnnouncementsList({ userRole }: AnnouncementsListProps) {
: role.charAt(0).toUpperCase() + role.slice(1); : role.charAt(0).toUpperCase() + role.slice(1);
return ( return (
<Badge key={role} variant="outline" className="mr-1"> <Badge
key={role}
variant="outline"
className="mr-1 bg-white text-gray-700 border-gray-300"
>
{roleName} {roleName}
</Badge> </Badge>
); );
@ -182,6 +186,7 @@ export function AnnouncementsList({ userRole }: AnnouncementsListProps) {
variant="outline" variant="outline"
size="sm" size="sm"
onClick={() => handleViewAnnouncement(announcement)} onClick={() => handleViewAnnouncement(announcement)}
className="bg-white text-gray-700 border-gray-300"
> >
<Eye className="h-4 w-4" /> <Eye className="h-4 w-4" />
<span className="sr-only">View</span> <span className="sr-only">View</span>
@ -190,6 +195,7 @@ export function AnnouncementsList({ userRole }: AnnouncementsListProps) {
variant="outline" variant="outline"
size="sm" size="sm"
onClick={() => handleDeleteClick(announcement)} onClick={() => handleDeleteClick(announcement)}
className="bg-white text-gray-700 border-gray-300"
> >
<Trash2 className="h-4 w-4" /> <Trash2 className="h-4 w-4" />
<span className="sr-only">Delete</span> <span className="sr-only">Delete</span>

View File

@ -35,16 +35,16 @@ export function AnnouncementsPage({ userRole = [] }: AnnouncementsPageProps) {
<Tabs defaultValue="list"> <Tabs defaultValue="list">
<div className="flex justify-between items-center mb-8"> <div className="flex justify-between items-center mb-8">
<TabsList className="bg-black/20 border-0"> <TabsList className="bg-gray-200 border-0">
<TabsTrigger <TabsTrigger
value="list" value="list"
className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-gray-400" className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-gray-700"
> >
All Announcements All Announcements
</TabsTrigger> </TabsTrigger>
<TabsTrigger <TabsTrigger
value="create" value="create"
className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-gray-400" className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-gray-700"
> >
Create Announcement Create Announcement
</TabsTrigger> </TabsTrigger>

View File

@ -21,6 +21,7 @@ import {
ChevronLeft, ChevronLeft,
ChevronRight, ChevronRight,
BookOpen, BookOpen,
Book,
} from "lucide-react"; } from "lucide-react";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { ScrollArea } from "@/components/ui/scroll-area"; import { ScrollArea } from "@/components/ui/scroll-area";
@ -158,6 +159,12 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
href: "/agilite", href: "/agilite",
iframe: process.env.NEXT_PUBLIC_IFRAME_AGILITY_URL, iframe: process.env.NEXT_PUBLIC_IFRAME_AGILITY_URL,
}, },
{
title: "Livres",
icon: Book,
href: "/livres",
iframe: process.env.NEXT_PUBLIC_IFRAME_LIVRE_URL,
},
]; ];
// Role-specific menu items // Role-specific menu items