MCPcopy Create free account
hub / github.com/chart-kit/react-native-chart-kit-example / getPageSelection

Function getPageSelection

App.tsx:213–236  ·  view source on GitHub ↗
({
  pageId,
  storyId,
  viewId,
}: {
  pageId?: string | null;
  storyId?: string | null;
  viewId?: string | null;
})

Source from the content-addressed store, hash-verified

211};
212
213const getPageSelection = ({
214 pageId,
215 storyId,
216 viewId,
217}: {
218 pageId?: string | null;
219 storyId?: string | null;
220 viewId?: string | null;
221}): PageSelection => {
222 const storySelection = getPageSelectionForStory(storyId);
223
224 if (storySelection) {
225 return storySelection;
226 }
227
228 const mode =
229 allShowcaseModes.find((currentMode) => currentMode.id === viewId) ??
230 defaultMode;
231 const page =
232 mode.pages.find((currentPage) => currentPage.id === pageId) ??
233 mode.pages[0];
234
235 return { mode, page };
236};
237
238const getInitialPageSelection = () => {
239 const params = getInitialSearchParams();

Callers 2

getInitialPageSelectionFunction · 0.85
AppFunction · 0.85

Calls 1

getPageSelectionForStoryFunction · 0.85

Tested by

no test coverage detected