diff --git a/src/components/online/NavRail.tsx b/src/components/online/NavRail.tsx index 792fa2f..5671143 100644 --- a/src/components/online/NavRail.tsx +++ b/src/components/online/NavRail.tsx @@ -39,7 +39,7 @@ export function NavRail({ bottom = false }: { bottom?: boolean }) { : cn( // portrait: bottom bar; landscape: side rail "border-t border-gold/10 pb-[max(0.375rem,env(safe-area-inset-bottom))]", - "landscape:order-first landscape:h-full landscape:w-[78px] landscape:flex-col landscape:justify-start", + "landscape:order-first landscape:h-full landscape:w-[78px] landscape:flex-col landscape:justify-center", "landscape:gap-1.5 landscape:py-3 landscape:pb-3 landscape:border-t-0", "ltr:landscape:border-r rtl:landscape:border-l" ) diff --git a/src/components/online/ScreenHeader.tsx b/src/components/online/ScreenHeader.tsx index 87f00d3..ecf3680 100644 --- a/src/components/online/ScreenHeader.tsx +++ b/src/components/online/ScreenHeader.tsx @@ -10,12 +10,12 @@ export function ScreenHeader({ title, back = "home", right, - showXp = true, + showXp = false, }: { title: string; back?: Screen; right?: React.ReactNode; - /** Show the persistent level + XP chip beneath the header (default on). */ + /** Show the persistent level + XP chip beneath the header (default off). */ showXp?: boolean; }) { const navBack = useUIStore((s) => s.back); diff --git a/src/components/screens/ShopScreen.tsx b/src/components/screens/ShopScreen.tsx index e81c6d6..671ca3a 100644 --- a/src/components/screens/ShopScreen.tsx +++ b/src/components/screens/ShopScreen.tsx @@ -78,6 +78,7 @@ export function ShopScreen() { const [items, setItems] = useState([]); const [msg, setMsg] = useState(""); const [detail, setDetail] = useState(null); + const [cat, setCat] = useState("avatar"); useEffect(() => { getService().getShopItems().then(setItems); @@ -187,19 +188,40 @@ export function ShopScreen() { )} - {sections.map((sec) => { - const list = items.filter((i) => i.kind === sec.kind); - if (!list.length) return null; - return ( -
-
- {list.map((item) => ( - setDetail(item)} /> - ))} -
-
- ); - })} + {/* category tabs */} +
+ {sections.map((sec) => ( + + ))} +
+ + {sections + .filter((sec) => sec.kind === cat) + .map((sec) => { + const list = items.filter((i) => i.kind === sec.kind); + return ( +
+ {list.length === 0 ? ( +

{t("shop.emptyCat")}

+ ) : ( +
+ {list.map((item) => ( + setDetail(item)} /> + ))} +
+ )} +
+ ); + })} {detail && ( diff --git a/src/lib/i18n.tsx b/src/lib/i18n.tsx index b1eb95d..79427fe 100644 --- a/src/lib/i18n.tsx +++ b/src/lib/i18n.tsx @@ -320,6 +320,7 @@ const fa: Dict = { "shop.reqLevel": "سطح", "shop.reqRating": "امتیاز", "shop.reqAchv": "دستاورد:", + "shop.emptyCat": "آیتمی در این دسته نیست", "reward.newTitle": "عنوان جدید", "reactions.title": "شکلک", @@ -666,6 +667,7 @@ const en: Dict = { "shop.reqLevel": "Level", "shop.reqRating": "Rating", "shop.reqAchv": "Achievement:", + "shop.emptyCat": "No items in this category", "reward.newTitle": "New title", "reactions.title": "Emoji",