mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
imporved notif
This commit is contained in:
@@ -39,11 +39,12 @@ export function Notification({ socket }) {
|
|||||||
success: "bg-green-500",
|
success: "bg-green-500",
|
||||||
warning: "bg-yellow-500"
|
warning: "bg-yellow-500"
|
||||||
}
|
}
|
||||||
const classNames = 'fixed w-11/12 p-5 z-30 mx-auto inset-x-0 flex justify-center rounded-xl transition-all shadow-xl ' + (visible ? "top-5 " : "-translate-y-full ");
|
const classNames = 'fixed relative w-11/12 p-5 z-30 mx-auto inset-x-0 flex justify-center rounded-xl transition-all shadow-xl ' + (visible ? "top-5 " : "-translate-y-full ");
|
||||||
return (
|
return (
|
||||||
Object.keys(bgColorMap).map((key) =>
|
Object.keys(bgColorMap).map((key) =>
|
||||||
notification?.type == key &&
|
notification?.type == key &&
|
||||||
<div key={key} className={classNames + bgColorMap[key]} onClick={() => setVisible(false)}>
|
<div key={key} className={classNames + bgColorMap[key]} onClick={() => setVisible(false)}>
|
||||||
|
<p className="absolute top-2 right-2 p-2 rounded-l text-3xl bg-white">x</p>
|
||||||
<p className='text-center text-xl'>{notification?.text}</p>
|
<p className='text-center text-xl'>{notification?.text}</p>
|
||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import { useSocket } from "@/context/socketContext";
|
import { useSocket } from "@/context/socketContext";
|
||||||
import { useTeamConnexion } from "@/context/teamConnexionContext";
|
import { useTeamConnexion } from "@/context/teamConnexionContext";
|
||||||
import { useTeamContext } from "@/context/teamContext";
|
import { useTeamContext } from "@/context/teamContext";
|
||||||
import { useEffect } from "react";
|
|
||||||
|
|
||||||
export default function useGame() {
|
export default function useGame() {
|
||||||
const { teamSocket } = useSocket();
|
const { teamSocket } = useSocket();
|
||||||
|
|||||||
Reference in New Issue
Block a user