tweaks
This commit is contained in:
@@ -32,7 +32,7 @@ export default function Notes({ gameData: { dmID, cards, settings }, show }: Not
|
|||||||
cards[Object.keys(cardMap).find((key) => cardMap[key] === index) || 0],
|
cards[Object.keys(cardMap).find((key) => cardMap[key] === index) || 0],
|
||||||
)
|
)
|
||||||
.filter((truthy) => truthy),
|
.filter((truthy) => truthy),
|
||||||
[settings],
|
[cards, isDM, settings],
|
||||||
);
|
);
|
||||||
|
|
||||||
const showNotes = show && open && (isDM || settings.notes);
|
const showNotes = show && open && (isDM || settings.notes);
|
||||||
@@ -49,7 +49,7 @@ export default function Notes({ gameData: { dmID, cards, settings }, show }: Not
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<Scrim
|
<Scrim
|
||||||
onClick={() => setOpen((prev) => !prev)}
|
clickAction={() => setOpen((prev) => !prev)}
|
||||||
className={`transition-all duration-250 ${showNotes ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'}`}
|
className={`transition-all duration-250 ${showNotes ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'}`}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
type ScrimProps = {
|
type ScrimProps = {
|
||||||
children?: React.ReactNode;
|
children: React.ReactNode;
|
||||||
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
clickAction: (event: React.MouseEvent<HTMLDivElement>) => void;
|
||||||
show?: boolean;
|
show?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Scrim({ children, onClick, show = true, className = '' }: ScrimProps) {
|
export default function Scrim({ children, clickAction, show = true, className = '' }: ScrimProps) {
|
||||||
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
|
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
|
||||||
if (event.target === event.currentTarget) {
|
if (event.target === event.currentTarget) {
|
||||||
onClick && onClick(event);
|
clickAction(event);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (!show) return null;
|
if (!show) return null;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default function Settings({ gameData, changeAction }: SettingsProps) {
|
|||||||
return (
|
return (
|
||||||
<div className={`fixed top-4 right-4 z-25 ${cinzel.className}`}>
|
<div className={`fixed top-4 right-4 z-25 ${cinzel.className}`}>
|
||||||
<Scrim
|
<Scrim
|
||||||
onClick={() => setOpen((prev) => !prev)}
|
clickAction={() => setOpen((prev) => !prev)}
|
||||||
className={`transition-all duration-250 ${open ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'}`}
|
className={`transition-all duration-250 ${open ? 'pointer-events-auto opacity-100' : 'pointer-events-none opacity-0'}`}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"dev": "nodemon",
|
"dev": "nodemon",
|
||||||
"build": "next build && tsc --project tsconfig.server.json",
|
"build": "next build && tsc --project tsconfig.server.json",
|
||||||
"start": "cross-env NODE_ENV=production TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/server.js",
|
"start": "cross-env NODE_ENV=production TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/server.js",
|
||||||
"deploy": "docker buildx build --platform linux/amd64 -t nasty.mcmorgans:5000/tarokka --push ."
|
"deploy": "docker buildx build --platform linux/amd64 -t 192.168.0.2:5000/tarokka --push ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user