Skip to content

About

React Native Transactions screen over a hiring mock API: RTK Query infinite scroll, pull-to-refresh, day grouping

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Transactions screen

A one-screen React Native app built on top of a hiring mock API: a list of card and crypto transactions grouped by day, with pull-to-refresh and infinite scroll. The data layer is RTK Query over an Axios BaseQueryFn; the UI uses React Native Paper, with Storybook and Reactotron wired up for development.

The screen

src/screens/Transactions/TransactionsScreen.tsx renders a SectionList with a sticky header per day, newest first. A row shows the merchant (a shortened wallet address for crypto transfers), the time, the amount with its sign, and the status as text — Pending, Settled, Declined, Reversed — never as colour alone. Row and day-header heights are fixed so getItemLayout can hand exact metrics to the virtualizer; that is what keeps a fast fling free of blank cells over hundreds of rows.

The screen covers loading, empty, error with retry, a footer error when the next page fails, and a banner when a refresh fails while cached data is still on screen.

Data flow

screen
  -> useGetTransactionsInfiniteQuery
  -> services/caseAPI/case.rtkQuery.ts
  -> Axios BaseQueryFn
  -> https://hiring-pi-snowy.vercel.app

The contract lives in src/services/caseAPI/types.ts and was derived from live responses. Pagination is an RTK Query infiniteQuery: 50 rows per page, and getNextPageParam stops as soon as the API reports next: null.

src/constants/api.ts is the single place where the base URL is set. It points at the remote API; npm run mock-api starts the bundled HTTP mock instead, and the comments there cover the loopback addresses each emulator needs.

Run

Start Metro:

npm start

Run one platform:

npm run ios
npm run android

Testing network failures

Dev builds expose buttons in Reactotron that inject API failures, so error and empty states can be checked without touching the network. Open Reactotron before launching the app:

npm run reactotron

TESTING.md walks through it (in Russian), with two worked examples: pull-to-refresh and next-page loading.

Verify

npm run check
npm run ios:build
npm run android:build

Repository notes

A complete wallet dashboard lives in Storybook (src/stories/) as a component reference; it is not part of app navigation, and the app screen does not depend on it. AGENTS.md holds the working rules for AI agents in this repository, and the /case-* skills in .claude/skills/ package the workflow used to build the screen (step order in LIVE_CASE_WORKFLOW.md).

About

React Native Transactions screen over a hiring mock API: RTK Query infinite scroll, pull-to-refresh, day grouping

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages