Fixed a few small things

This commit is contained in:
Tim Howitz 2025-05-22 17:59:48 +01:00
parent cb6dd05071
commit b40d0aedb4
6 changed files with 21 additions and 9 deletions

View File

@ -1,11 +1,11 @@
"use client";
import Image from "next/image";
const OurMission = () => {
function OurMission() {
return (
<div
className="relative bg-fixed bg-cover bg-center text-white "
style={{ backgroundImage: "url('destruction.jpg')", height: 845, overflow: "hidden" }}
className="relative h-full bg-fixed bg-cover bg-center text-white "
style={{ backgroundImage: "url('destruction.jpg')", overflow: "hidden" }}
>
{/* Overlay for Readability */}
<div className="absolute inset-0 bg-black bg-opacity-50"></div>
@ -55,5 +55,5 @@ const OurMission = () => {
</div>
</div>
);
};
}
export default OurMission;

View File

@ -214,7 +214,7 @@ export default function Shop() {
if (currentPage > 1) setCurrentPage((prev) => prev - 1);
};
function ArtefactCard({ artefact }: { artefact: Artefact }) {
function ArtefactCard({ artefact }: { artefact: ExtendedArtefact }) {
return (
<div
className="flex flex-col bg-white shadow-md rounded-md overflow-hidden cursor-pointer hover:scale-105 transition-transform"
@ -233,7 +233,7 @@ export default function Shop() {
</div>
);
}
function Modal({ artefact }: { artefact: Artefact }) {
function Modal({ artefact }: { artefact: ExtendedArtefact }) {
if (!artefact) return null;
const handleOverlayClick = (e: React.MouseEvent) => {
if (e.target === e.currentTarget) setSelectedArtefact(null);

View File

@ -1,5 +1,5 @@
import { Action } from "easy-peasy";
// import type { User } from "@prisma/client";
// import type { User } from "@prismaclient";
import { User } from "@appTypes/Prisma";
type Currency = "GBP" | "USD" | "EUR";

5
src/utils/maths.ts Normal file
View File

@ -0,0 +1,5 @@
function getRandomNumber(min: number, max: number): number {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
export { getRandomNumber };

View File

@ -0,0 +1,7 @@
function stringToBool(val: string | undefined, defaultValue: boolean = false): boolean {
if (!val) return defaultValue;
const normalized = val.trim().toLowerCase();
return normalized === "true" || normalized === "yes";
}
export { stringToBool };

View File

@ -1,9 +1,9 @@
import { PrismaClient } from "@prisma/client";
import { PrismaClient } from "@prismaclient";
declare global {
var prisma: PrismaClient | undefined;
}
const prisma = process.env.NODE_ENV === "production" ? new PrismaClient() : global.prisma ?? (global.prisma = new PrismaClient());
const prisma = new PrismaClient();
export { prisma };