This commit is contained in:
2025-02-03 15:00:31 -05:00
parent 2a22744b06
commit a2f6aef11a
2 changed files with 14 additions and 15 deletions

View File

@@ -1,15 +1,14 @@
import constants from "@src/lib/constants"; import constants from "@src/lib/constants";
export default function Footer() { export default function Footer() {
const year = new Date().getFullYear();
return ( return (
( <footer className="bg-gray-950 text-white py-4">
<footer className="bg-gray-950 text-white py-4"> <div className="container mx-auto px-6 text-center">
<div className="container mx-auto px-6 text-center"> <p>&copy; {year} {constants.APP_NAME}. All rights reserved.</p>
<p>&copy; {new Date().getFullYear()} {constants.APP_NAME}. All rights reserved.</p> <p>Built by Forward Group </p>
<p>Built by Forward Group </p> </div>
</div> </footer>
</footer>
)
) )
} }

View File

@@ -93,20 +93,20 @@ export default async function Footer() {
const newDate = new Date(); const newDate = new Date();
const year = newDate.getFullYear(); const year = newDate.getFullYear();
const { session, user } = await validateRequest(); const { session, user } = await validateRequest();
let message = user?.id ?? ''; const userId = user?.id ?? '';
let isAdminFlag:boolean = false; let hasAdminFlag:boolean = false;
console.log("console log:"+ message); console.log("console log:"+ userId);
console.log(user?.email); console.log(user?.email);
if(session != null) { if(session != null) {
message = (await isAdmin(message)) ? user.id : ''; hasAdminFlag = (await isAdmin(userId)) ?? false;
isAdminFlag = (await isAdmin(message)) ?? false; console.log("admin?:" + hasAdminFlag);
} else{ } else{
console.log("session is empty"); console.log("session is empty");
} }
return ( return (
<footer className="bg-zinc-900"> <footer className="bg-zinc-900">
<div className="bg-white">{message}should be something here</div> <div className="bg-white">{userId}should be something here</div>
<div className="mx-auto max-w-7xl px-6 pb-8 pt-20 sm:pt-24 lg:px-8 lg:pt-32"> <div className="mx-auto max-w-7xl px-6 pb-8 pt-20 sm:pt-24 lg:px-8 lg:pt-32">
<div className="xl:grid xl:grid-cols-3 xl:gap-8"> <div className="xl:grid xl:grid-cols-3 xl:gap-8">
<div className="grid grid-cols-2 gap-8 xl:col-span-2"> <div className="grid grid-cols-2 gap-8 xl:col-span-2">
@@ -136,7 +136,7 @@ export default async function Footer() {
))} ))}
</ul> </ul>
</div> </div>
{(isAdminFlag) ? {(hasAdminFlag) ?
<div className="mt-10 md:mt-0"> <div className="mt-10 md:mt-0">
<h3 className="text-sm/6 font-semibold text-white">Administration</h3> <h3 className="text-sm/6 font-semibold text-white">Administration</h3>
<ul role="list" className="mt-6 space-y-4"> <ul role="list" className="mt-6 space-y-4">