StatsHub Docs

Widgets and reminders

Home-screen widgets for a countdown, a live score and a hit rate, plus match reminders — the app outside the app.

src/widgets · (main)/reminders.tsx · the expo-widgets config in app.json

Three widgets

WidgetWhat it showsConfigurable
CountdownTime to kick-offCountdown, or kick-off time
LiveScoreThe scoreScore and scorers, or score only
HitRateA player's hit ratePercentage, or recent record

Each is configurable from the widget itself — long-press, edit, done. The options are declared in app.json under the expo-widgets plugin, so the choices a user sees and the values the code reads are one definition.

Why they matter more than they look

A widget is the app's only surface for someone who has not opened it. A countdown to a match they care about is a reason to open it; a stale score is a reason not to.

src/widgets/widget-runtime.test.ts and widget-image.ts are the parts that run outside React entirely, which is why they are tested as plain modules.

Reminders

match-reminders.ts — a notification before a fixture. duplicate-push.ts sits beside it and is tested, because the failure mode of a reminder system is sending the same one twice and the failure mode of fixing that is sending none.

Notifications go through expo-notifications; permission is asked when a reminder is first set, not on launch, so the prompt arrives with a reason attached.

On this page