diff --git a/src/components/HomeScreen.tsx b/src/components/HomeScreen.tsx index ad9fb09..95a8a3c 100644 --- a/src/components/HomeScreen.tsx +++ b/src/components/HomeScreen.tsx @@ -60,7 +60,8 @@ export function HomeScreen() { if (!isAuthed) return nav("auth"); sound.init(); sound.play("click"); - await createRoom({ targetScore: 7, stake: 0, ranked: false }); + // Private rooms cost 150 coins per player (stake → winner takes the pot). + await createRoom({ targetScore: 7, stake: 150, ranked: false }); go("room"); }; diff --git a/src/components/online/NotificationToaster.tsx b/src/components/online/NotificationToaster.tsx index 77da728..d2cdb8c 100644 --- a/src/components/online/NotificationToaster.tsx +++ b/src/components/online/NotificationToaster.tsx @@ -2,49 +2,60 @@ import { AnimatePresence, motion } from "framer-motion"; import { useEffect } from "react"; +import { X } from "lucide-react"; import { openNotification, useNotifStore } from "@/lib/notification-store"; +import { useUIStore } from "@/lib/ui-store"; import { useI18n } from "@/lib/i18n"; +/** + * Minimal, non-intrusive toast: a single-line chip pinned to the top corner. + * Tap the title to open it, tap ✕ (or swipe up) to dismiss, auto-hides after a + * few seconds. Never shown during a game so it can't disturb play. + */ export function NotificationToaster() { const toast = useNotifStore((s) => s.lastToast); const dismiss = useNotifStore((s) => s.dismissToast); + const screen = useUIStore((s) => s.screen); const { locale } = useI18n(); useEffect(() => { if (!toast) return; - const id = setTimeout(dismiss, 4000); + const id = setTimeout(dismiss, 3500); return () => clearTimeout(id); }, [toast, dismiss]); + if (screen === "game") return null; + return ( {toast && ( { - if (info.offset.y < -40) dismiss(); + if (info.offset.y < -30) dismiss(); }} - onClick={() => toast && openNotification(toast)} - className="fixed top-3 inset-x-0 z-[60] flex justify-center px-4 pointer-events-none" + className="fixed top-2 z-[60] ltr:right-2 rtl:left-2 safe-top pointer-events-none" > -
- {toast.icon} -
-
+
+ {toast.icon} +
- {(toast.bodyFa || toast.bodyEn) && ( -
- {locale === "fa" ? toast.bodyFa : toast.bodyEn} -
- )} -
+ + +
)} diff --git a/src/components/screens/BuyCoinsScreen.tsx b/src/components/screens/BuyCoinsScreen.tsx index 49f1e46..bea772f 100644 --- a/src/components/screens/BuyCoinsScreen.tsx +++ b/src/components/screens/BuyCoinsScreen.tsx @@ -116,8 +116,6 @@ export function BuyCoinsScreen() { ) } /> -

{t("buy.note")}

- {gained != null && (
+{fmt(gained)} @@ -128,30 +126,39 @@ export function BuyCoinsScreen() {
{msg}
)} -
+
{packs.map((p) => ( diff --git a/src/components/screens/OnlineLobbyScreen.tsx b/src/components/screens/OnlineLobbyScreen.tsx index 9e017fd..45ea940 100644 --- a/src/components/screens/OnlineLobbyScreen.tsx +++ b/src/components/screens/OnlineLobbyScreen.tsx @@ -1,7 +1,7 @@ "use client"; import { motion } from "framer-motion"; -import { Coins, Lock, Trophy, Users } from "lucide-react"; +import { Coins, Lock, Trophy } from "lucide-react"; import { useState } from "react"; import { ScreenHeader, ScreenShell } from "@/components/online/ScreenHeader"; import { CoinsPill } from "@/components/online/CoinsPill"; @@ -32,7 +32,6 @@ function guardActiveMatch(): boolean { export function OnlineLobbyScreen() { const { t, locale } = useI18n(); - const createRoom = useOnlineStore((s) => s.createRoom); const startMatchmaking = useOnlineStore((s) => s.startMatchmaking); const go = useUIStore((s) => s.go); const profile = useSessionStore((s) => s.profile); @@ -43,13 +42,6 @@ export function OnlineLobbyScreen() { const entry = league.entry; const lockedLeague = level < league.minLevel; - // Private rooms with friends are free. - const onCreate = async () => { - if (guardActiveMatch()) return; - await createRoom({ targetScore: 7, stake: 0, ranked: false }); - go("room"); - }; - // Ranked random always costs the entry (you stake it). const onRandom = async () => { if (guardActiveMatch()) return; @@ -123,40 +115,23 @@ export function OnlineLobbyScreen() { )}
-
- - - - - - {t("lobby.random")} - {t("lobby.randomDesc")} - - - {entry} - - - - - - - - - - {t("lobby.createRoom")} - {t("lobby.createDesc")} - - {t("lobby.free")} - -
+ + + + + + {t("lobby.random")} + {t("lobby.randomDesc")} + + + {entry} + + + ); }