generated from nhcarrigan/template
a3daed1683
Sets up the full monorepo with pnpm workspaces. Includes shared types package, Hono API with Discord OAuth/JWT auth, Prisma v6 + MongoDB Atlas, and React + Vite frontend with game loop, five tabs, and Discord-linked save/load.
28 lines
771 B
TypeScript
28 lines
771 B
TypeScript
import { useGame } from "../../context/GameContext.js";
|
|
|
|
export const OfflineModal = (): React.JSX.Element | null => {
|
|
const { offlineGold, dismissOfflineGold } = useGame();
|
|
|
|
if (offlineGold <= 0) return null;
|
|
|
|
return (
|
|
<div className="modal-overlay">
|
|
<div className="modal">
|
|
<h2>Welcome back!</h2>
|
|
<p>
|
|
Your adventurers kept working whilst you were away and earned{" "}
|
|
<strong>🪙 {offlineGold.toFixed(0)} gold</strong>!
|
|
</p>
|
|
<p className="modal-note">Offline progress is calculated up to 8 hours.</p>
|
|
<button
|
|
className="modal-close-button"
|
|
onClick={dismissOfflineGold}
|
|
type="button"
|
|
>
|
|
Collect!
|
|
</button>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|