@tastic/shell 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -8
- package/dist/index.mjs +13 -8
- package/package.json +1 -1
- package/src/components/segmentTheme.ts +14 -0
- package/src/screens/HomeScreen.tsx +11 -5
- package/src/screens/StatsScreen.tsx +10 -5
- package/src/types.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -1049,6 +1049,10 @@ var import_react16 = require("react");
|
|
|
1049
1049
|
var import_react_native8 = require("react-native");
|
|
1050
1050
|
var import_react_native_paper = require("react-native-paper");
|
|
1051
1051
|
|
|
1052
|
+
// src/components/segmentTheme.ts
|
|
1053
|
+
var SEGMENT_THEME = { roundness: 3.8 };
|
|
1054
|
+
var SEGMENT_RADIUS = 5 * SEGMENT_THEME.roundness;
|
|
1055
|
+
|
|
1052
1056
|
// src/hooks/useFrozenWhileHidden.ts
|
|
1053
1057
|
var import_react15 = require("react");
|
|
1054
1058
|
function useFrozenWhileHidden(value, hidden) {
|
|
@@ -1183,7 +1187,7 @@ function HomeMenu() {
|
|
|
1183
1187
|
const [tabLabel, setTabLabel] = (0, import_react16.useState)(() => tabs?.[0].label ?? null);
|
|
1184
1188
|
const tab = tabs ? tabs.find((t) => t.label === tabLabel) ?? tabs[0] : null;
|
|
1185
1189
|
const tabButtons = (0, import_react16.useMemo)(() => tabs?.map(({ label }) => ({ value: label, label })) ?? [], [tabs]);
|
|
1186
|
-
const tabBar = tab && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.SegmentedButtons, { value: tab.label, onValueChange: setTabLabel, buttons: tabButtons, style: [styles4.tabs, pack.Backdrop && { backgroundColor: colors.surface }] });
|
|
1190
|
+
const tabBar = tab && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.SegmentedButtons, { value: tab.label, onValueChange: setTabLabel, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles4.tabs, pack.Backdrop && { backgroundColor: colors.surface }] });
|
|
1187
1191
|
const columnClamp = useClampOnShrink();
|
|
1188
1192
|
const gridClamp = useClampOnShrink();
|
|
1189
1193
|
const openGame = (0, import_react16.useCallback)((game) => openFirstTime(game.id, () => import_expo_router6.router.push(game.useLoadout ? loadoutHref(game.id) : playHref(game.id))), [openFirstTime]);
|
|
@@ -1257,6 +1261,7 @@ function hasRules(game) {
|
|
|
1257
1261
|
function RulesHost({ enabled, children }) {
|
|
1258
1262
|
return enabled ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Portal.Host, { children }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children });
|
|
1259
1263
|
}
|
|
1264
|
+
var ROW_BLURB_LINES = 3;
|
|
1260
1265
|
function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
|
|
1261
1266
|
const well = (0, import_chrome5.useWellColors)();
|
|
1262
1267
|
const GameIcon = game.icon;
|
|
@@ -1268,7 +1273,7 @@ function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPres
|
|
|
1268
1273
|
game.Preview ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PreviewBox, { game, width: ROW_PREVIEW_WIDTH, revealed: previewRevealed, dark, p1Color, p2Color }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native8.View, { style: [styles4.rowIcon, { backgroundColor: dark ? ICON_DARK_BG : ICON_LIGHT_BG }], children: GameIcon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GameIcon, { size: ROW_ICON_SIZE, p1Color, p2Color, dark }) }),
|
|
1269
1274
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native8.View, { style: styles4.rowText, children: [
|
|
1270
1275
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Text, { variant: "titleLarge", style: [styles4.rowTitle, { color: well.fg }], numberOfLines: 1, children: game.title }),
|
|
1271
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines:
|
|
1276
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: ROW_BLURB_LINES, children: game.blurb })
|
|
1272
1277
|
] })
|
|
1273
1278
|
] }),
|
|
1274
1279
|
onRules && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_feedback_press3.Pressable, { onPress: onRules, style: styles4.rulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Icon, { source: "information-outline", size: 22, color: well.fgMuted }) })
|
|
@@ -1390,9 +1395,9 @@ var styles4 = import_react_native8.StyleSheet.create({
|
|
|
1390
1395
|
scroll: {
|
|
1391
1396
|
flex: 1
|
|
1392
1397
|
},
|
|
1393
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill (the stats screen's tabs).
|
|
1398
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill (the stats screen's tabs).
|
|
1394
1399
|
tabs: {
|
|
1395
|
-
borderRadius:
|
|
1400
|
+
borderRadius: SEGMENT_RADIUS
|
|
1396
1401
|
},
|
|
1397
1402
|
// The same well as a row, turned on its side.
|
|
1398
1403
|
tile: {
|
|
@@ -1471,7 +1476,7 @@ var TABS = [
|
|
|
1471
1476
|
{ value: STATS, label: "Stats", icon: "chart-box-outline" },
|
|
1472
1477
|
{ value: ACHIEVEMENTS, label: "Achievements", icon: "trophy-outline" }
|
|
1473
1478
|
];
|
|
1474
|
-
var LABEL_WIDE_TAB = { flexBasis: "auto", flexGrow: 1, flexShrink: 1 };
|
|
1479
|
+
var LABEL_WIDE_TAB = { flex: 0, flexBasis: "auto", flexGrow: 1, flexShrink: 1 };
|
|
1475
1480
|
var NO_PACK_TABS = [];
|
|
1476
1481
|
var EVERYONE = "__everyone__";
|
|
1477
1482
|
var ALL_GAMES = "__all__";
|
|
@@ -1519,7 +1524,7 @@ function StatsContent({ pickerHost }) {
|
|
|
1519
1524
|
const PackTabContent = packTab?.Content;
|
|
1520
1525
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_chrome7.BaseStatsScreen, { title, onBack: import_core8.safeBack, insets, onReset: reset.onReset, resetLabel: reset.label, resetConfirmTitle: reset.title, resetConfirmBody: reset.body, fg: pack.foreground, bg: pack.Backdrop ? "transparent" : void 0, rotation: 0, children: [
|
|
1521
1526
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_chrome7.PressAwayOverlay, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
|
|
1522
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native_paper2.SegmentedButtons, { value: tab, onValueChange: setTab, buttons: tabButtons, style: [styles5.tabs, surface] }),
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native_paper2.SegmentedButtons, { value: tab, onValueChange: setTab, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles5.tabs, surface] }),
|
|
1523
1528
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native9.View, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
|
|
1524
1529
|
profiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_profile9.OptionPicker, { id: PLAYER_PICKER_ID, host: pickerHost, options: playerOptions, value: profileId ?? EVERYONE, onChange: (value) => setSelectedProfileId(value === EVERYONE ? null : value), color: colors.primary, dark, icon: profileId ? "account" : "account-group", alignOverride: playerAlign, triggerStyle }),
|
|
1525
1530
|
showGamePicker && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_profile9.OptionPicker, { id: GAME_PICKER_ID, host: pickerHost, options: gameOptions, value: gameId, onChange: setGameId, color: colors.primary, dark, icon: "view-grid-outline", alignOverride: gameAlign, triggerStyle })
|
|
@@ -1573,9 +1578,9 @@ var styles5 = import_react_native9.StyleSheet.create({
|
|
|
1573
1578
|
screen: {
|
|
1574
1579
|
flex: 1
|
|
1575
1580
|
},
|
|
1576
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill.
|
|
1581
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill.
|
|
1577
1582
|
tabs: {
|
|
1578
|
-
borderRadius:
|
|
1583
|
+
borderRadius: SEGMENT_RADIUS
|
|
1579
1584
|
}
|
|
1580
1585
|
});
|
|
1581
1586
|
|
package/dist/index.mjs
CHANGED
|
@@ -972,6 +972,10 @@ import { useCallback as useCallback10, useEffect as useEffect6, useMemo as useMe
|
|
|
972
972
|
import { AppState as AppState2, StyleSheet as StyleSheet4, View as View4 } from "react-native";
|
|
973
973
|
import { Icon, Portal, SegmentedButtons, Text } from "react-native-paper";
|
|
974
974
|
|
|
975
|
+
// src/components/segmentTheme.ts
|
|
976
|
+
var SEGMENT_THEME = { roundness: 3.8 };
|
|
977
|
+
var SEGMENT_RADIUS = 5 * SEGMENT_THEME.roundness;
|
|
978
|
+
|
|
975
979
|
// src/hooks/useFrozenWhileHidden.ts
|
|
976
980
|
import { useState as useState5 } from "react";
|
|
977
981
|
function useFrozenWhileHidden(value, hidden) {
|
|
@@ -1106,7 +1110,7 @@ function HomeMenu() {
|
|
|
1106
1110
|
const [tabLabel, setTabLabel] = useState6(() => tabs?.[0].label ?? null);
|
|
1107
1111
|
const tab = tabs ? tabs.find((t) => t.label === tabLabel) ?? tabs[0] : null;
|
|
1108
1112
|
const tabButtons = useMemo6(() => tabs?.map(({ label }) => ({ value: label, label })) ?? [], [tabs]);
|
|
1109
|
-
const tabBar = tab && /* @__PURE__ */ jsx14(SegmentedButtons, { value: tab.label, onValueChange: setTabLabel, buttons: tabButtons, style: [styles4.tabs, pack.Backdrop && { backgroundColor: colors.surface }] });
|
|
1113
|
+
const tabBar = tab && /* @__PURE__ */ jsx14(SegmentedButtons, { value: tab.label, onValueChange: setTabLabel, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles4.tabs, pack.Backdrop && { backgroundColor: colors.surface }] });
|
|
1110
1114
|
const columnClamp = useClampOnShrink();
|
|
1111
1115
|
const gridClamp = useClampOnShrink();
|
|
1112
1116
|
const openGame = useCallback10((game) => openFirstTime(game.id, () => router3.push(game.useLoadout ? loadoutHref(game.id) : playHref(game.id))), [openFirstTime]);
|
|
@@ -1180,6 +1184,7 @@ function hasRules(game) {
|
|
|
1180
1184
|
function RulesHost({ enabled, children }) {
|
|
1181
1185
|
return enabled ? /* @__PURE__ */ jsx14(Portal.Host, { children }) : /* @__PURE__ */ jsx14(Fragment4, { children });
|
|
1182
1186
|
}
|
|
1187
|
+
var ROW_BLURB_LINES = 3;
|
|
1183
1188
|
function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
|
|
1184
1189
|
const well = useWellColors();
|
|
1185
1190
|
const GameIcon = game.icon;
|
|
@@ -1191,7 +1196,7 @@ function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPres
|
|
|
1191
1196
|
game.Preview ? /* @__PURE__ */ jsx14(PreviewBox, { game, width: ROW_PREVIEW_WIDTH, revealed: previewRevealed, dark, p1Color, p2Color }) : /* @__PURE__ */ jsx14(View4, { style: [styles4.rowIcon, { backgroundColor: dark ? ICON_DARK_BG : ICON_LIGHT_BG }], children: GameIcon && /* @__PURE__ */ jsx14(GameIcon, { size: ROW_ICON_SIZE, p1Color, p2Color, dark }) }),
|
|
1192
1197
|
/* @__PURE__ */ jsxs5(View4, { style: styles4.rowText, children: [
|
|
1193
1198
|
/* @__PURE__ */ jsx14(Text, { variant: "titleLarge", style: [styles4.rowTitle, { color: well.fg }], numberOfLines: 1, children: game.title }),
|
|
1194
|
-
/* @__PURE__ */ jsx14(Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines:
|
|
1199
|
+
/* @__PURE__ */ jsx14(Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: ROW_BLURB_LINES, children: game.blurb })
|
|
1195
1200
|
] })
|
|
1196
1201
|
] }),
|
|
1197
1202
|
onRules && /* @__PURE__ */ jsx14(Pressable, { onPress: onRules, style: styles4.rulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ jsx14(Icon, { source: "information-outline", size: 22, color: well.fgMuted }) })
|
|
@@ -1313,9 +1318,9 @@ var styles4 = StyleSheet4.create({
|
|
|
1313
1318
|
scroll: {
|
|
1314
1319
|
flex: 1
|
|
1315
1320
|
},
|
|
1316
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill (the stats screen's tabs).
|
|
1321
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill (the stats screen's tabs).
|
|
1317
1322
|
tabs: {
|
|
1318
|
-
borderRadius:
|
|
1323
|
+
borderRadius: SEGMENT_RADIUS
|
|
1319
1324
|
},
|
|
1320
1325
|
// The same well as a row, turned on its side.
|
|
1321
1326
|
tile: {
|
|
@@ -1394,7 +1399,7 @@ var TABS = [
|
|
|
1394
1399
|
{ value: STATS, label: "Stats", icon: "chart-box-outline" },
|
|
1395
1400
|
{ value: ACHIEVEMENTS, label: "Achievements", icon: "trophy-outline" }
|
|
1396
1401
|
];
|
|
1397
|
-
var LABEL_WIDE_TAB = { flexBasis: "auto", flexGrow: 1, flexShrink: 1 };
|
|
1402
|
+
var LABEL_WIDE_TAB = { flex: 0, flexBasis: "auto", flexGrow: 1, flexShrink: 1 };
|
|
1398
1403
|
var NO_PACK_TABS = [];
|
|
1399
1404
|
var EVERYONE = "__everyone__";
|
|
1400
1405
|
var ALL_GAMES = "__all__";
|
|
@@ -1442,7 +1447,7 @@ function StatsContent({ pickerHost }) {
|
|
|
1442
1447
|
const PackTabContent = packTab?.Content;
|
|
1443
1448
|
return /* @__PURE__ */ jsxs6(BaseStatsScreen, { title, onBack: safeBack, insets, onReset: reset.onReset, resetLabel: reset.label, resetConfirmTitle: reset.title, resetConfirmBody: reset.body, fg: pack.foreground, bg: pack.Backdrop ? "transparent" : void 0, rotation: 0, children: [
|
|
1444
1449
|
/* @__PURE__ */ jsx16(PressAwayOverlay3, { active: pickerHost.openId !== null, onPress: pickerHost.close, style: styles5.pressAway }),
|
|
1445
|
-
/* @__PURE__ */ jsx16(SegmentedButtons2, { value: tab, onValueChange: setTab, buttons: tabButtons, style: [styles5.tabs, surface] }),
|
|
1450
|
+
/* @__PURE__ */ jsx16(SegmentedButtons2, { value: tab, onValueChange: setTab, buttons: tabButtons, theme: SEGMENT_THEME, style: [styles5.tabs, surface] }),
|
|
1446
1451
|
/* @__PURE__ */ jsxs6(View5, { style: [styles5.filters, pickerHost.openId !== null && styles5.filtersOpen], onStartShouldSetResponder: () => pickerHost.openId !== null, children: [
|
|
1447
1452
|
profiles.length > 0 && /* @__PURE__ */ jsx16(OptionPicker2, { id: PLAYER_PICKER_ID, host: pickerHost, options: playerOptions, value: profileId ?? EVERYONE, onChange: (value) => setSelectedProfileId(value === EVERYONE ? null : value), color: colors.primary, dark, icon: profileId ? "account" : "account-group", alignOverride: playerAlign, triggerStyle }),
|
|
1448
1453
|
showGamePicker && /* @__PURE__ */ jsx16(OptionPicker2, { id: GAME_PICKER_ID, host: pickerHost, options: gameOptions, value: gameId, onChange: setGameId, color: colors.primary, dark, icon: "view-grid-outline", alignOverride: gameAlign, triggerStyle })
|
|
@@ -1496,9 +1501,9 @@ var styles5 = StyleSheet5.create({
|
|
|
1496
1501
|
screen: {
|
|
1497
1502
|
flex: 1
|
|
1498
1503
|
},
|
|
1499
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill.
|
|
1504
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill.
|
|
1500
1505
|
tabs: {
|
|
1501
|
-
borderRadius:
|
|
1506
|
+
borderRadius: SEGMENT_RADIUS
|
|
1502
1507
|
}
|
|
1503
1508
|
});
|
|
1504
1509
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tastic/shell",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "The app around a pack of React Native games, two-seat or for one player: Home, the loadout, the stats screen, Profiles and Settings, the pack's Redux store and its root providers, driven by one PackDefinition",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paper's SegmentedButtons, drawn clean on iOS (Home's tabs, the stats screen's tabs). Paper rounds a switch's ends
|
|
3
|
+
* at 5 x the theme's roundness (20pt) and lets the label set a segment's height, which on iOS comes out a third of a
|
|
4
|
+
* point over a whole number (40.33pt). React Native draws the border of a segment with uneven corners (an end segment)
|
|
5
|
+
* as a small image stretched to fit, and with a 20pt corner that image needs 41pt: at a fractional height short of
|
|
6
|
+
* that, the last segment's left border is smeared across it, a thin line at mid-height ("Two Player" on Home,
|
|
7
|
+
* "Achievements" on the stats screen, in CardTastic's App Store screenshots, 2026-11-11). A 19pt corner needs 39pt,
|
|
8
|
+
* so it fits whatever the label's height, and the ends still look fully round. CardTastic found and fixed the same in
|
|
9
|
+
* its own switches (2026-11-08); the web never shows it.
|
|
10
|
+
*/
|
|
11
|
+
export const SEGMENT_THEME = { roundness: 3.8 }
|
|
12
|
+
|
|
13
|
+
/** The ends' corner radius that `SEGMENT_THEME` gives (Paper's V3 segments round at 5 x roundness), for a surface drawn behind a switch. */
|
|
14
|
+
export const SEGMENT_RADIUS = 5 * SEGMENT_THEME.roundness
|
|
@@ -8,6 +8,7 @@ import { AppState, type AppStateStatus, type LayoutChangeEvent, type NativeScrol
|
|
|
8
8
|
import { Icon, Portal, SegmentedButtons, Text } from 'react-native-paper'
|
|
9
9
|
|
|
10
10
|
import { useGameGuide } from '../components/GuideHost'
|
|
11
|
+
import { SEGMENT_RADIUS, SEGMENT_THEME } from '../components/segmentTheme'
|
|
11
12
|
import { SettingsDialog } from '../components/SettingsDialog'
|
|
12
13
|
import { useFrozenWhileHidden } from '../hooks/useFrozenWhileHidden'
|
|
13
14
|
import { useLastActiveGame } from '../hooks/useLastActiveGame'
|
|
@@ -118,7 +119,7 @@ function HomeMenu() {
|
|
|
118
119
|
const [tabLabel, setTabLabel] = useState(() => tabs?.[0].label ?? null)
|
|
119
120
|
const tab = tabs ? (tabs.find((t) => t.label === tabLabel) ?? tabs[0]) : null
|
|
120
121
|
const tabButtons = useMemo(() => tabs?.map(({ label }) => ({ value: label, label })) ?? [], [tabs])
|
|
121
|
-
const tabBar = tab && <SegmentedButtons value={tab.label} onValueChange={setTabLabel} buttons={tabButtons} style={[styles.tabs, pack.Backdrop && { backgroundColor: colors.surface }]} />
|
|
122
|
+
const tabBar = tab && <SegmentedButtons value={tab.label} onValueChange={setTabLabel} buttons={tabButtons} theme={SEGMENT_THEME} style={[styles.tabs, pack.Backdrop && { backgroundColor: colors.surface }]} />
|
|
122
123
|
const columnClamp = useClampOnShrink()
|
|
123
124
|
const gridClamp = useClampOnShrink()
|
|
124
125
|
|
|
@@ -276,8 +277,11 @@ interface GameRowProps {
|
|
|
276
277
|
}
|
|
277
278
|
|
|
278
279
|
// One game on its own well: its icon at app-icon size (the art was drawn as an app icon), or its
|
|
279
|
-
// preview where it has one, its name and
|
|
280
|
+
// preview where it has one, its name and short blurb (up to ROW_BLURB_LINES lines), and a rules button at the end that shows its
|
|
280
281
|
// How to Play cards without opening the game.
|
|
282
|
+
// How many lines a row's blurb may wrap to before it's cut off.
|
|
283
|
+
export const ROW_BLURB_LINES = 3
|
|
284
|
+
|
|
281
285
|
function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }: GameRowProps) {
|
|
282
286
|
const well = useWellColors()
|
|
283
287
|
const GameIcon = game.icon
|
|
@@ -291,7 +295,9 @@ function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPres
|
|
|
291
295
|
<Text variant='titleLarge' style={[styles.rowTitle, { color: well.fg }]} numberOfLines={1}>
|
|
292
296
|
{game.title}
|
|
293
297
|
</Text>
|
|
294
|
-
|
|
298
|
+
{/* Three lines, as a tile allows: a narrow phone (an iPhone SE, a 411dp Android phone) wraps a
|
|
299
|
+
55-character blurb onto a third line in the monospace, and two lines cut it off with an ellipsis */}
|
|
300
|
+
<Text variant='bodyMedium' style={{ color: well.fgMuted }} numberOfLines={ROW_BLURB_LINES}>
|
|
295
301
|
{game.blurb}
|
|
296
302
|
</Text>
|
|
297
303
|
</View>
|
|
@@ -465,9 +471,9 @@ const styles = StyleSheet.create({
|
|
|
465
471
|
scroll: {
|
|
466
472
|
flex: 1
|
|
467
473
|
},
|
|
468
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill (the stats screen's tabs).
|
|
474
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill (the stats screen's tabs).
|
|
469
475
|
tabs: {
|
|
470
|
-
borderRadius:
|
|
476
|
+
borderRadius: SEGMENT_RADIUS
|
|
471
477
|
},
|
|
472
478
|
// The same well as a row, turned on its side.
|
|
473
479
|
tile: {
|
|
@@ -7,6 +7,7 @@ import { SegmentedButtons, Text } from 'react-native-paper'
|
|
|
7
7
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
8
8
|
import { useDispatch } from 'react-redux'
|
|
9
9
|
|
|
10
|
+
import { SEGMENT_RADIUS, SEGMENT_THEME } from '../components/segmentTheme'
|
|
10
11
|
import { useProfiles } from '../hooks/useProfiles'
|
|
11
12
|
import { safeBack } from '../navigation'
|
|
12
13
|
import { usePack } from '../PackContext'
|
|
@@ -23,8 +24,12 @@ const TABS = [
|
|
|
23
24
|
]
|
|
24
25
|
// With a pack's own tabs, three or more don't fit a phone as equal segments with icons (Paper pads each
|
|
25
26
|
// label 16pt a side, and "Achievements" alone is ~109pt in Solitaire's font), so each segment is as wide
|
|
26
|
-
// as its label and the icons go: Solitaire's three take 309pt of a 375pt phone's 335pt row.
|
|
27
|
-
|
|
27
|
+
// as its label and the icons go: Solitaire's three take 309pt of a 375pt phone's 335pt row. `flex: 0`
|
|
28
|
+
// takes back the `flex: 1` Paper gives every segment: on iOS and Android, Yoga treats a `flexBasis` of
|
|
29
|
+
// 'auto' as unset and a positive `flex` then makes the basis 0, so all three came out equal and cut
|
|
30
|
+
// "Achievements" short on every phone (CardTastic's App Store screenshots, 2026-11-11). The web's CSS lets
|
|
31
|
+
// the longhands win, which is the only place this had been checked.
|
|
32
|
+
const LABEL_WIDE_TAB = { flex: 0, flexBasis: 'auto', flexGrow: 1, flexShrink: 1 } as const
|
|
28
33
|
const NO_PACK_TABS: readonly PackStatsTab[] = []
|
|
29
34
|
|
|
30
35
|
// The pickers' values for Everyone and All Games (neither is ever a profile or game id).
|
|
@@ -131,7 +136,7 @@ function StatsContent({ pickerHost }: { pickerHost: PopoverHost }) {
|
|
|
131
136
|
filters (pressAway's zIndex sits below filtersOpen's), so a tap anywhere on the page but a
|
|
132
137
|
menu closes it. Off the page (the header, the margins) StatsPressAway closes it. */}
|
|
133
138
|
<PressAwayOverlay active={pickerHost.openId !== null} onPress={pickerHost.close} style={styles.pressAway} />
|
|
134
|
-
<SegmentedButtons value={tab} onValueChange={setTab} buttons={tabButtons} style={[styles.tabs, surface]} />
|
|
139
|
+
<SegmentedButtons value={tab} onValueChange={setTab} buttons={tabButtons} theme={SEGMENT_THEME} style={[styles.tabs, surface]} />
|
|
135
140
|
|
|
136
141
|
{/* Takes a press on its own blank parts (the gap, an open menu's padding) while a menu is open, so
|
|
137
142
|
it never reaches StatsPressAway. */}
|
|
@@ -207,8 +212,8 @@ const styles = StyleSheet.create({
|
|
|
207
212
|
screen: {
|
|
208
213
|
flex: 1
|
|
209
214
|
},
|
|
210
|
-
// SegmentedButtons' own rounding, so a surface behind it is the same pill.
|
|
215
|
+
// SegmentedButtons' own rounding (SEGMENT_THEME's), so a surface behind it is the same pill.
|
|
211
216
|
tabs: {
|
|
212
|
-
borderRadius:
|
|
217
|
+
borderRadius: SEGMENT_RADIUS
|
|
213
218
|
}
|
|
214
219
|
})
|
package/src/types.ts
CHANGED
|
@@ -137,7 +137,8 @@ export interface GameRulesProps {
|
|
|
137
137
|
export interface GameDefinition {
|
|
138
138
|
id: string
|
|
139
139
|
title: string
|
|
140
|
-
//
|
|
140
|
+
// A sentence or two under the game's name on Home: a row shows up to three lines (ROW_BLURB_LINES)
|
|
141
|
+
// on the narrowest phones, a tile three.
|
|
141
142
|
blurb: string
|
|
142
143
|
// Left out only by a game with a Preview, which Home draws in its place.
|
|
143
144
|
icon?: ComponentType<GameIconProps>
|