UX: landscape result screen, chat emojis, unread badges, remove XP text
- PostMatchRewardsModal: short-height (landscape) compaction so the win/forfeit result fits without overflow (smaller emoji/coins/padding, max-h 94dvh, wider). - Chat: emoji/sticker picker (owned reactions) — tap to send; hidden on focus. - Unread messages: online-store now tracks a total `unread` (from listConversations); NavRail Friends icon shows a badge (unread + requests), refreshed every 12s on every screen; Friends «پیامها» tab badged too. (Per-conversation unread badges already existed.) - Remove "XP گران است" / "XP is expensive" from shop.xpHint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+4
-2
@@ -151,6 +151,7 @@ const fa: Dict = {
|
||||
"chat.title": "گفتگو",
|
||||
"chat.placeholder": "پیام بنویسید…",
|
||||
"chat.send": "ارسال",
|
||||
"chat.emoji": "ایموجی",
|
||||
"chat.empty": "گفتگو را شروع کنید",
|
||||
"friends.message": "پیام",
|
||||
|
||||
@@ -315,7 +316,7 @@ const fa: Dict = {
|
||||
"shop.titles": "عناوین",
|
||||
"shop.titlesHint": "عنوان شما زیر نامتان در بازی و لیستها نمایش داده میشود",
|
||||
"shop.xp": "امتیاز تجربه (XP)",
|
||||
"shop.xpHint": "افزایش سریع سطح — XP گران است",
|
||||
"shop.xpHint": "افزایش سریع سطح",
|
||||
"shop.includes": "شامل",
|
||||
"shop.reqLevel": "سطح",
|
||||
"shop.reqRating": "امتیاز",
|
||||
@@ -501,6 +502,7 @@ const en: Dict = {
|
||||
"chat.title": "Chat",
|
||||
"chat.placeholder": "Type a message…",
|
||||
"chat.send": "Send",
|
||||
"chat.emoji": "Emoji",
|
||||
"chat.empty": "Start the conversation",
|
||||
"friends.message": "Message",
|
||||
|
||||
@@ -662,7 +664,7 @@ const en: Dict = {
|
||||
"shop.titles": "Titles",
|
||||
"shop.titlesHint": "Your title shows under your name in games & lists",
|
||||
"shop.xp": "XP packs",
|
||||
"shop.xpHint": "Level up faster — XP is expensive",
|
||||
"shop.xpHint": "Level up faster",
|
||||
"shop.includes": "Includes",
|
||||
"shop.reqLevel": "Level",
|
||||
"shop.reqRating": "Rating",
|
||||
|
||||
@@ -41,9 +41,11 @@ interface OnlineStore {
|
||||
// chat
|
||||
activeChatFriend: Friend | null;
|
||||
chatMessages: ChatMessage[];
|
||||
unread: number; // total unread messages across conversations (for nav badge)
|
||||
openChat: (friend: Friend) => Promise<void>;
|
||||
sendChat: (text: string) => Promise<void>;
|
||||
closeChat: () => void;
|
||||
refreshUnread: () => Promise<void>;
|
||||
}
|
||||
|
||||
let roomUnsub: (() => void) | null = null;
|
||||
@@ -154,11 +156,22 @@ export const useOnlineStore = create<OnlineStore>((set, get) => ({
|
||||
|
||||
activeChatFriend: null,
|
||||
chatMessages: [],
|
||||
unread: 0,
|
||||
|
||||
refreshUnread: async () => {
|
||||
try {
|
||||
const convs = await getService().listConversations();
|
||||
set({ unread: convs.reduce((n, c) => n + (c.unread ?? 0), 0) });
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
},
|
||||
|
||||
openChat: async (friend) => {
|
||||
const svc = getService();
|
||||
set({ activeChatFriend: friend, chatMessages: await svc.getMessages(friend.id) });
|
||||
await svc.markRead(friend.id);
|
||||
get().refreshUnread();
|
||||
if (chatUnsub) chatUnsub();
|
||||
chatUnsub = svc.onChat((friendId, msgs) => {
|
||||
const active = get().activeChatFriend;
|
||||
@@ -182,5 +195,6 @@ export const useOnlineStore = create<OnlineStore>((set, get) => ({
|
||||
chatUnsub = null;
|
||||
}
|
||||
set({ activeChatFriend: null, chatMessages: [] });
|
||||
get().refreshUnread();
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user