Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d7f3e6c
86b1vx0v2:Created Header.tsx with an avatar, dropdown menu (Profile, …
Asfik-1999 Aug 27, 2024
7667e5e
86b1vx0v2:Added Layout.tsx for the overall structure of the application.
Asfik-1999 Aug 27, 2024
6cea914
86b1vx0v2: created header module css
Asfik-1999 Aug 27, 2024
4186b7c
86b1vx0v2: package-lock update
Asfik-1999 Aug 27, 2024
d87a8ee
86b1vx0v2: package json update
Asfik-1999 Aug 27, 2024
4f3a40b
86b1vx0v2: delete Layout and Header File
Asfik-1999 Aug 29, 2024
59f46ce
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Aug 29, 2024
5063490
86b1vx0v2: Integrated `ProfileCard` and `Avatar` components in `RootL…
Asfik-1999 Aug 29, 2024
dc2f06b
86b1vx0v2: Hide the logout button
Asfik-1999 Aug 29, 2024
b8b8bb0
86b1vx0v2: Implemented conditional rendering to hide these components…
Asfik-1999 Aug 29, 2024
eabfa47
86b1vx0v2: Create Avatar Componenet
Asfik-1999 Aug 29, 2024
b248ef9
86b1vx0v2: Craete card component
Asfik-1999 Aug 29, 2024
f7d0bf4
86b1vx0v2: Add logo
Asfik-1999 Aug 29, 2024
c172329
86b1vx0v2: Implement ProfileCard with toggle and logout functionality
Asfik-1999 Aug 29, 2024
ae6ad1c
86b1vx0v2: Update ProfileCard component with improved styling and log…
Asfik-1999 Aug 30, 2024
5df067f
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Aug 30, 2024
f56a359
86b1vx0v2: update package
Asfik-1999 Aug 30, 2024
f1a0c25
86b1vx0v2: Removed the handleLogout function and associated logic fro…
Asfik-1999 Aug 30, 2024
4604ab2
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Aug 31, 2024
c63bae5
86b1vx0v2 : Remove conflicts
Asfik-1999 Aug 31, 2024
0f92b49
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Sep 1, 2024
f569066
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Sep 2, 2024
d80bd87
86b1vx0v2: package update
Asfik-1999 Sep 2, 2024
9feb7d6
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Sep 2, 2024
fefe3e2
86b1vx0v2: converted to server component
Asfik-1999 Sep 2, 2024
9674436
86b1vx0v2: Remove file depentency
Asfik-1999 Sep 2, 2024
eb4cfb0
86b1vx0v2 : Remove conflicts
Asfik-1999 Sep 2, 2024
a5bb525
Merge branch 'development' into 86b1vx0v2 and fix conflict
Asfik-1999 Sep 2, 2024
7f0b682
86b1vx0v2: remove conflicts
Asfik-1999 Sep 2, 2024
2ae304c
update after remove depentency
Asfik-1999 Sep 4, 2024
57e513a
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Sep 8, 2024
6a536cf
Merge branch 'development' into 86b1vx0v2
Asfik-1999 Sep 9, 2024
c3a828e
remove package.json
Asfik-1999 Sep 9, 2024
081a80d
Merge branch '86b1vx0v2' of https://github.com/tracet2t/Digital-Logbo…
Asfik-1999 Sep 9, 2024
12a473c
remove conflicts
Asfik-1999 Sep 9, 2024
01f6928
Remove antd
Asfik-1999 Sep 11, 2024
fd76e9f
Merge branch 'development' of github.com:tracet2t/Digital-Logbook int…
thlurte Sep 11, 2024
c58a27a
Merge branch '86b1vx0v2' of github.com:tracet2t/Digital-Logbook into …
thlurte Sep 11, 2024
ba2f304
Remove conflict
Asfik-1999 Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,026 changes: 393 additions & 1,633 deletions server/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/prisma/seed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function main() {
}
});


// console.log({ mentor1, mentor2, student1, student2, student3, feedback1, feedback2, report1, report2 });
} catch (error) {
console.error('Error seeding data:', error);
Expand Down
Binary file not shown.
Binary file added server/public/t2t logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions server/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import './index.css';
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import ConditionalLayout from "@/components/ConditionalLayout";
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';


const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
Expand All @@ -18,9 +20,11 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>
{children}
<ToastContainer

<body className={`${inter.className} relative`}>
<ConditionalLayout>
{children}
<ToastContainer
position="top-right"
autoClose={5000}
hideProgressBar={false}
Expand All @@ -31,6 +35,9 @@ export default function RootLayout({
draggable
pauseOnHover
/>
</ConditionalLayout>


</body>
</html>
);
Expand Down
36 changes: 36 additions & 0 deletions server/src/components/ConditionalLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// src/components/ConditionalLayout.tsx
import getSession from "@/server_actions/getSession";
import ProfileCard from "@/components/ProfileCard";


const ConditionalLayout: React.FC<{ children: React.ReactNode }> = async ({ children }) => {
const session = await getSession(); // Fetch session directly on the server
const authenticated = session.isAuthenticated();

return (
<>
{authenticated && (
<>
{/* Logo in the top-left corner */}
<div className="absolute top-4 left-4 mb-15" >
<img
src="../t2t logo.png" // Ensure correct file path and name
alt="T2T Logo"
className="w-24 h-auto" // Adjust size as needed
/>
</div>

{/* ProfileCard component in the top-right corner */}
<div className="absolute top-4 right-4">
<ProfileCard />
</div>
</>
)}
<main className="p-4">
{children}
</main>
</>
);
};

export default ConditionalLayout;
58 changes: 58 additions & 0 deletions server/src/components/ProfileCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"use client";

import { useState } from "react";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Card, CardContent, CardHeader, CardTitle, CardFooter } from "@/components/ui/card";

export default function ProfileCard() {
const [isCardVisible, setIsCardVisible] = useState(false);

// Toggle the visibility of the card
const toggleCardVisibility = () => {
setIsCardVisible(!isCardVisible);
};

return (
<div className="relative">
{/* Button to toggle the visibility of the profile card */}
<button onClick={toggleCardVisibility} className="absolute top-4 right-4">
<Avatar>
<AvatarImage src="https://github.com/shadcn.png" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
</button>

{/* Conditional rendering of the profile card */}
{isCardVisible && (
<div className="absolute top-16 right-0 bg-gradient-to-b from-blue-100 to-blue-200 p-3 border border-gray-200 rounded shadow-lg">
<Card className="w-56 rounded-lg overflow-hidden shadow-xl">
{/* Card header with avatar and green background */}
<CardHeader className="relative flex flex-col items-center justify-center bg-green-400 h-28 p-3">
<Avatar className="w-20 h-20 border-4 border-white absolute -bottom-10">
<AvatarImage src="https://github.com/shadcn.png" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
</CardHeader>

{/* Card content displaying the user's name and email */}
<CardContent className="mt-12 text-center p-2">
<CardTitle className="text-md font-semibold">Mohamed Asfik</CardTitle>
<p className="text-xs text-gray-700">[email protected]</p>
</CardContent>

{/* Card footer with the logout button */}
<CardFooter className="flex justify-center p-2">
{/* Remove the logout functionality */}
<button
className="bg-gray-500 text-white py-1 px-3 rounded-md hover:bg-gray-600"

>
Logout
</button>
</CardFooter>
</Card>
</div>
)}
</div>
);
}
5 changes: 2 additions & 3 deletions server/src/components/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
AlertDialogTitle
} from "@/components/ui/alert-dialog";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
Expand Down Expand Up @@ -634,4 +633,4 @@ const TaskCalendar: React.FC<TaskCalendarProps> = ({ selectedUser }) => {
);
};

export default TaskCalendar;
export default TaskCalendar;