From b5ca86805019f3b17031097ec2d6456897768eff Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 6 Feb 2024 14:24:49 -0800 Subject: [PATCH 1/3] move folders etc, need to solve app import issue --- app.json | 8 ++++---- index.js | 2 +- App.tsx => src/App.tsx | 0 {assets => src/assets}/adaptive-icon.png | Bin {assets => src/assets}/favicon.png | Bin {assets => src/assets}/icon.png | Bin {assets => src/assets}/splash.png | Bin {auth => src/auth}/firebase-auth.tsx | 0 {auth => src/auth}/index.ts | 0 {component => src/component}/buttons/sign-out.tsx | 0 .../component}/charts/bar-graph/bar-graph.tsx | 0 {component => src/component}/charts/bar.tsx | 0 .../component}/charts/chart-label/chart-label.tsx | 0 {component => src/component}/charts/chart-styles.ts | 0 {component => src/component}/charts/chart-view.tsx | 0 .../component}/charts/custom-bar-utils.ts | 0 {component => src/component}/charts/custom-bars.tsx | 0 {component => src/component}/charts/custom-grid.tsx | 0 {component => src/component}/charts/graph-config.ts | 0 {component => src/component}/charts/graph-types.ts | 0 {component => src/component}/charts/graph-utils.tsx | 0 .../component}/charts/line-graph/line-graph.tsx | 0 .../component}/charts/use-graph-data.ts | 0 {component => src/component}/display-shot.tsx | 0 {component => src/component}/shot.tsx | 0 {component => src/component}/video/camera.tsx | 0 .../component}/video/capture-button.tsx | 0 {component => src/component}/video/constants.ts | 0 .../component}/video/is-foreground.tsx | 0 .../component}/with-query-handling.tsx | 0 {graphql => src/graphql}/client.tsx | 0 {graphql => src/graphql}/filter.ts | 0 {graphql => src/graphql}/query.ts | 0 {navigation => src/navigation}/app-navigator.tsx | 0 {navigation => src/navigation}/tab-navigator.tsx | 0 {screens => src/screens}/login.tsx | 0 {screens => src/screens}/session.tsx | 2 +- {screens => src/screens}/video-stack/record.tsx | 0 {screens => src/screens}/video-stack/styles.ts | 0 styles.ts => src/styles.ts | 0 test/component/bar-graph.test.tsx | 2 +- test/component/chart-label.test.tsx | 2 +- test/component/chart-view.test.tsx | 2 +- test/component/custom-bars.test.tsx | 4 ++-- test/component/line-graph.test.tsx | 2 +- test/component/use-graph-data.test.tsx | 4 ++-- test/component/with-query-handling.test.tsx | 2 +- test/graphql/filter.test.ts | 2 +- 48 files changed, 16 insertions(+), 16 deletions(-) rename App.tsx => src/App.tsx (100%) rename {assets => src/assets}/adaptive-icon.png (100%) rename {assets => src/assets}/favicon.png (100%) rename {assets => src/assets}/icon.png (100%) rename {assets => src/assets}/splash.png (100%) rename {auth => src/auth}/firebase-auth.tsx (100%) rename {auth => src/auth}/index.ts (100%) rename {component => src/component}/buttons/sign-out.tsx (100%) rename {component => src/component}/charts/bar-graph/bar-graph.tsx (100%) rename {component => src/component}/charts/bar.tsx (100%) rename {component => src/component}/charts/chart-label/chart-label.tsx (100%) rename {component => src/component}/charts/chart-styles.ts (100%) rename {component => src/component}/charts/chart-view.tsx (100%) rename {component => src/component}/charts/custom-bar-utils.ts (100%) rename {component => src/component}/charts/custom-bars.tsx (100%) rename {component => src/component}/charts/custom-grid.tsx (100%) rename {component => src/component}/charts/graph-config.ts (100%) rename {component => src/component}/charts/graph-types.ts (100%) rename {component => src/component}/charts/graph-utils.tsx (100%) rename {component => src/component}/charts/line-graph/line-graph.tsx (100%) rename {component => src/component}/charts/use-graph-data.ts (100%) rename {component => src/component}/display-shot.tsx (100%) rename {component => src/component}/shot.tsx (100%) rename {component => src/component}/video/camera.tsx (100%) rename {component => src/component}/video/capture-button.tsx (100%) rename {component => src/component}/video/constants.ts (100%) rename {component => src/component}/video/is-foreground.tsx (100%) rename {component => src/component}/with-query-handling.tsx (100%) rename {graphql => src/graphql}/client.tsx (100%) rename {graphql => src/graphql}/filter.ts (100%) rename {graphql => src/graphql}/query.ts (100%) rename {navigation => src/navigation}/app-navigator.tsx (100%) rename {navigation => src/navigation}/tab-navigator.tsx (100%) rename {screens => src/screens}/login.tsx (100%) rename {screens => src/screens}/session.tsx (85%) rename {screens => src/screens}/video-stack/record.tsx (100%) rename {screens => src/screens}/video-stack/styles.ts (100%) rename styles.ts => src/styles.ts (100%) diff --git a/app.json b/app.json index 8029e3a..9e0404e 100644 --- a/app.json +++ b/app.json @@ -4,10 +4,10 @@ "slug": "railbird-rn", "version": "1.0.0", "orientation": "portrait", - "icon": "./assets/icon.png", + "icon": "./src/assets/icon.png", "userInterfaceStyle": "light", "splash": { - "image": "./assets/splash.png", + "image": "./src/assets/splash.png", "resizeMode": "contain", "backgroundColor": "#ffffff" }, @@ -31,14 +31,14 @@ }, "android": { "adaptiveIcon": { - "foregroundImage": "./assets/adaptive-icon.png", + "foregroundImage": "./src/assets/adaptive-icon.png", "backgroundColor": "#ffffff" }, "package": "android.railbird.app", "googleServicesFile": "./google-services.json" }, "web": { - "favicon": "./assets/favicon.png" + "favicon": "./src/assets/favicon.png" } } } diff --git a/index.js b/index.js index 828b356..fc82eb1 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ import { registerRootComponent } from "expo"; -import App from "./App"; +import App from "./src/App"; // registerRootComponent calls AppRegistry.registerComponent('main', () => App); // It also ensures that whether you load the app in Expo Go or in a native build, diff --git a/App.tsx b/src/App.tsx similarity index 100% rename from App.tsx rename to src/App.tsx diff --git a/assets/adaptive-icon.png b/src/assets/adaptive-icon.png similarity index 100% rename from assets/adaptive-icon.png rename to src/assets/adaptive-icon.png diff --git a/assets/favicon.png b/src/assets/favicon.png similarity index 100% rename from assets/favicon.png rename to src/assets/favicon.png diff --git a/assets/icon.png b/src/assets/icon.png similarity index 100% rename from assets/icon.png rename to src/assets/icon.png diff --git a/assets/splash.png b/src/assets/splash.png similarity index 100% rename from assets/splash.png rename to src/assets/splash.png diff --git a/auth/firebase-auth.tsx b/src/auth/firebase-auth.tsx similarity index 100% rename from auth/firebase-auth.tsx rename to src/auth/firebase-auth.tsx diff --git a/auth/index.ts b/src/auth/index.ts similarity index 100% rename from auth/index.ts rename to src/auth/index.ts diff --git a/component/buttons/sign-out.tsx b/src/component/buttons/sign-out.tsx similarity index 100% rename from component/buttons/sign-out.tsx rename to src/component/buttons/sign-out.tsx diff --git a/component/charts/bar-graph/bar-graph.tsx b/src/component/charts/bar-graph/bar-graph.tsx similarity index 100% rename from component/charts/bar-graph/bar-graph.tsx rename to src/component/charts/bar-graph/bar-graph.tsx diff --git a/component/charts/bar.tsx b/src/component/charts/bar.tsx similarity index 100% rename from component/charts/bar.tsx rename to src/component/charts/bar.tsx diff --git a/component/charts/chart-label/chart-label.tsx b/src/component/charts/chart-label/chart-label.tsx similarity index 100% rename from component/charts/chart-label/chart-label.tsx rename to src/component/charts/chart-label/chart-label.tsx diff --git a/component/charts/chart-styles.ts b/src/component/charts/chart-styles.ts similarity index 100% rename from component/charts/chart-styles.ts rename to src/component/charts/chart-styles.ts diff --git a/component/charts/chart-view.tsx b/src/component/charts/chart-view.tsx similarity index 100% rename from component/charts/chart-view.tsx rename to src/component/charts/chart-view.tsx diff --git a/component/charts/custom-bar-utils.ts b/src/component/charts/custom-bar-utils.ts similarity index 100% rename from component/charts/custom-bar-utils.ts rename to src/component/charts/custom-bar-utils.ts diff --git a/component/charts/custom-bars.tsx b/src/component/charts/custom-bars.tsx similarity index 100% rename from component/charts/custom-bars.tsx rename to src/component/charts/custom-bars.tsx diff --git a/component/charts/custom-grid.tsx b/src/component/charts/custom-grid.tsx similarity index 100% rename from component/charts/custom-grid.tsx rename to src/component/charts/custom-grid.tsx diff --git a/component/charts/graph-config.ts b/src/component/charts/graph-config.ts similarity index 100% rename from component/charts/graph-config.ts rename to src/component/charts/graph-config.ts diff --git a/component/charts/graph-types.ts b/src/component/charts/graph-types.ts similarity index 100% rename from component/charts/graph-types.ts rename to src/component/charts/graph-types.ts diff --git a/component/charts/graph-utils.tsx b/src/component/charts/graph-utils.tsx similarity index 100% rename from component/charts/graph-utils.tsx rename to src/component/charts/graph-utils.tsx diff --git a/component/charts/line-graph/line-graph.tsx b/src/component/charts/line-graph/line-graph.tsx similarity index 100% rename from component/charts/line-graph/line-graph.tsx rename to src/component/charts/line-graph/line-graph.tsx diff --git a/component/charts/use-graph-data.ts b/src/component/charts/use-graph-data.ts similarity index 100% rename from component/charts/use-graph-data.ts rename to src/component/charts/use-graph-data.ts diff --git a/component/display-shot.tsx b/src/component/display-shot.tsx similarity index 100% rename from component/display-shot.tsx rename to src/component/display-shot.tsx diff --git a/component/shot.tsx b/src/component/shot.tsx similarity index 100% rename from component/shot.tsx rename to src/component/shot.tsx diff --git a/component/video/camera.tsx b/src/component/video/camera.tsx similarity index 100% rename from component/video/camera.tsx rename to src/component/video/camera.tsx diff --git a/component/video/capture-button.tsx b/src/component/video/capture-button.tsx similarity index 100% rename from component/video/capture-button.tsx rename to src/component/video/capture-button.tsx diff --git a/component/video/constants.ts b/src/component/video/constants.ts similarity index 100% rename from component/video/constants.ts rename to src/component/video/constants.ts diff --git a/component/video/is-foreground.tsx b/src/component/video/is-foreground.tsx similarity index 100% rename from component/video/is-foreground.tsx rename to src/component/video/is-foreground.tsx diff --git a/component/with-query-handling.tsx b/src/component/with-query-handling.tsx similarity index 100% rename from component/with-query-handling.tsx rename to src/component/with-query-handling.tsx diff --git a/graphql/client.tsx b/src/graphql/client.tsx similarity index 100% rename from graphql/client.tsx rename to src/graphql/client.tsx diff --git a/graphql/filter.ts b/src/graphql/filter.ts similarity index 100% rename from graphql/filter.ts rename to src/graphql/filter.ts diff --git a/graphql/query.ts b/src/graphql/query.ts similarity index 100% rename from graphql/query.ts rename to src/graphql/query.ts diff --git a/navigation/app-navigator.tsx b/src/navigation/app-navigator.tsx similarity index 100% rename from navigation/app-navigator.tsx rename to src/navigation/app-navigator.tsx diff --git a/navigation/tab-navigator.tsx b/src/navigation/tab-navigator.tsx similarity index 100% rename from navigation/tab-navigator.tsx rename to src/navigation/tab-navigator.tsx diff --git a/screens/login.tsx b/src/screens/login.tsx similarity index 100% rename from screens/login.tsx rename to src/screens/login.tsx diff --git a/screens/session.tsx b/src/screens/session.tsx similarity index 85% rename from screens/session.tsx rename to src/screens/session.tsx index d6c1af7..3bb0bee 100644 --- a/screens/session.tsx +++ b/src/screens/session.tsx @@ -1,7 +1,7 @@ import React from "react"; import { StyleSheet, View } from "react-native"; import BarGraph from "../component/charts/bar-graph/bar-graph"; -import { graph_data_two_measures } from "../mock/charts/mock-data"; +import { graph_data_two_measures } from "../../mock/charts/mock-data"; // Session Mock - can be used for session summary screen using a query handler component // BarGraph component using mocked data currently diff --git a/screens/video-stack/record.tsx b/src/screens/video-stack/record.tsx similarity index 100% rename from screens/video-stack/record.tsx rename to src/screens/video-stack/record.tsx diff --git a/screens/video-stack/styles.ts b/src/screens/video-stack/styles.ts similarity index 100% rename from screens/video-stack/styles.ts rename to src/screens/video-stack/styles.ts diff --git a/styles.ts b/src/styles.ts similarity index 100% rename from styles.ts rename to src/styles.ts diff --git a/test/component/bar-graph.test.tsx b/test/component/bar-graph.test.tsx index d266f79..071f5f2 100644 --- a/test/component/bar-graph.test.tsx +++ b/test/component/bar-graph.test.tsx @@ -1,6 +1,6 @@ import { render } from "@testing-library/react-native"; import React from "react"; -import BarGraph from "../../component/charts/bar-graph/bar-graph"; +import BarGraph from "../../src/component/charts/bar-graph/bar-graph"; import { graph_data_two_measures } from "../../mock/charts/mock-data"; describe("BarGraph Component Tests", () => { diff --git a/test/component/chart-label.test.tsx b/test/component/chart-label.test.tsx index ada7057..ef2371d 100644 --- a/test/component/chart-label.test.tsx +++ b/test/component/chart-label.test.tsx @@ -2,7 +2,7 @@ import "@testing-library/jest-native/extend-expect"; import { render } from "@testing-library/react-native"; import React from "react"; -import ChartLabel from "../../component/charts/chart-label/chart-label"; +import ChartLabel from "../../src/component/charts/chart-label/chart-label"; describe("ChartLabel Component Tests", () => { const mockData = { diff --git a/test/component/chart-view.test.tsx b/test/component/chart-view.test.tsx index a68615c..7dff049 100644 --- a/test/component/chart-view.test.tsx +++ b/test/component/chart-view.test.tsx @@ -3,7 +3,7 @@ import { render } from "@testing-library/react-native"; import React from "react"; import { Text } from "react-native"; -import ChartView from "../../component/charts/chart-view"; +import ChartView from "../../src/component/charts/chart-view"; describe("ChartView Component Tests", () => { it("applies the passed style prop correctly", () => { diff --git a/test/component/custom-bars.test.tsx b/test/component/custom-bars.test.tsx index 33c7db1..b1d017e 100644 --- a/test/component/custom-bars.test.tsx +++ b/test/component/custom-bars.test.tsx @@ -6,8 +6,8 @@ import React from "react"; import { calculateBarOrigin, drawBarPath, -} from "../../component/charts/custom-bar-utils"; -import { CustomBars } from "../../component/charts/custom-bars"; +} from "../../src/component/charts/custom-bar-utils"; +import { CustomBars } from "../../src/component/charts/custom-bars"; const mockYScaleFunction = scale.scaleLinear(); const mockXScaleFunction = scale.scaleBand(); diff --git a/test/component/line-graph.test.tsx b/test/component/line-graph.test.tsx index 420cea4..3fab5d9 100644 --- a/test/component/line-graph.test.tsx +++ b/test/component/line-graph.test.tsx @@ -1,6 +1,6 @@ import { render } from "@testing-library/react-native"; import React from "react"; -import LineGraph from "../../component/charts/line-graph/line-graph"; +import LineGraph from "../../src/component/charts/line-graph/line-graph"; import { line_chart_two_y_data } from "../../mock/charts/mock-data"; describe("LineGraph Component Tests", () => { diff --git a/test/component/use-graph-data.test.tsx b/test/component/use-graph-data.test.tsx index 6226280..30b4628 100644 --- a/test/component/use-graph-data.test.tsx +++ b/test/component/use-graph-data.test.tsx @@ -1,6 +1,6 @@ import { renderHook } from "@testing-library/react-native"; -import { GraphData, GraphProps } from "../../component/charts/graph-types"; -import { useGraphData } from "../../component/charts/use-graph-data"; +import { GraphData, GraphProps } from "../../src/component/charts/graph-types"; +import { useGraphData } from "../../src/component/charts/use-graph-data"; describe("useGraphData", () => { it("should return correctly processed data from convertToGraphData", () => { diff --git a/test/component/with-query-handling.test.tsx b/test/component/with-query-handling.test.tsx index 768cb06..2e1ee36 100644 --- a/test/component/with-query-handling.test.tsx +++ b/test/component/with-query-handling.test.tsx @@ -3,7 +3,7 @@ import "@testing-library/jest-native/extend-expect"; import { cleanup, render, waitFor } from "@testing-library/react-native"; import React from "react"; import { Text } from "react-native"; -import withQueryHandling from "../../component/with-query-handling"; +import withQueryHandling from "../../src/component/with-query-handling"; jest.mock("@apollo/client", () => ({ ...jest.requireActual("@apollo/client"), diff --git a/test/graphql/filter.test.ts b/test/graphql/filter.test.ts index ca79b99..bf88e78 100644 --- a/test/graphql/filter.test.ts +++ b/test/graphql/filter.test.ts @@ -1,4 +1,4 @@ -import { createAndFilter, createRangeFilter } from "../../graphql/filter"; +import { createAndFilter, createRangeFilter } from "../../src/graphql/filter"; describe("create filterInput", () => { it("should create a filter input with the correct structure", () => { From af28d5c65b75e814d1bc1fc3da3e6a0158b9db5d Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 6 Feb 2024 15:08:19 -0800 Subject: [PATCH 2/3] mvoe mock, fix imports --- src/App.tsx => App.tsx | 4 ++-- index.js | 2 +- src/screens/session.tsx | 2 +- test/component/bar-graph.test.tsx | 2 +- test/component/line-graph.test.tsx | 2 +- {mock => test/mock}/charts/mock-data.ts | 0 6 files changed, 6 insertions(+), 6 deletions(-) rename src/App.tsx => App.tsx (89%) rename {mock => test/mock}/charts/mock-data.ts (100%) diff --git a/src/App.tsx b/App.tsx similarity index 89% rename from src/App.tsx rename to App.tsx index 6d8beec..5d69b5f 100644 --- a/src/App.tsx +++ b/App.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from "react"; -import { ClientProvider, useAuthHeader } from "./graphql/client"; -import AppNavigator from "./navigation/app-navigator"; +import { ClientProvider, useAuthHeader } from "./src/graphql/client"; +import AppNavigator from "./src/navigation/app-navigator"; import { DEV_USER_ID } from "@env"; import AsyncStorage from "@react-native-async-storage/async-storage"; diff --git a/index.js b/index.js index fc82eb1..828b356 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ import { registerRootComponent } from "expo"; -import App from "./src/App"; +import App from "./App"; // registerRootComponent calls AppRegistry.registerComponent('main', () => App); // It also ensures that whether you load the app in Expo Go or in a native build, diff --git a/src/screens/session.tsx b/src/screens/session.tsx index 3bb0bee..432a4a1 100644 --- a/src/screens/session.tsx +++ b/src/screens/session.tsx @@ -1,7 +1,7 @@ import React from "react"; import { StyleSheet, View } from "react-native"; import BarGraph from "../component/charts/bar-graph/bar-graph"; -import { graph_data_two_measures } from "../../mock/charts/mock-data"; +import { graph_data_two_measures } from "../../test/mock/charts/mock-data"; // Session Mock - can be used for session summary screen using a query handler component // BarGraph component using mocked data currently diff --git a/test/component/bar-graph.test.tsx b/test/component/bar-graph.test.tsx index 071f5f2..5391154 100644 --- a/test/component/bar-graph.test.tsx +++ b/test/component/bar-graph.test.tsx @@ -1,7 +1,7 @@ import { render } from "@testing-library/react-native"; import React from "react"; import BarGraph from "../../src/component/charts/bar-graph/bar-graph"; -import { graph_data_two_measures } from "../../mock/charts/mock-data"; +import { graph_data_two_measures } from "../mock/charts/mock-data"; describe("BarGraph Component Tests", () => { it("renders correctly with data", () => { diff --git a/test/component/line-graph.test.tsx b/test/component/line-graph.test.tsx index 3fab5d9..5c1e745 100644 --- a/test/component/line-graph.test.tsx +++ b/test/component/line-graph.test.tsx @@ -1,7 +1,7 @@ import { render } from "@testing-library/react-native"; import React from "react"; import LineGraph from "../../src/component/charts/line-graph/line-graph"; -import { line_chart_two_y_data } from "../../mock/charts/mock-data"; +import { line_chart_two_y_data } from "../mock/charts/mock-data"; describe("LineGraph Component Tests", () => { it("renders correctly with data", () => { diff --git a/mock/charts/mock-data.ts b/test/mock/charts/mock-data.ts similarity index 100% rename from mock/charts/mock-data.ts rename to test/mock/charts/mock-data.ts From da68d87a5f0a9aea978d1da9d41e16f2ff4cba87 Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 6 Feb 2024 15:12:54 -0800 Subject: [PATCH 3/3] import sort --- src/screens/session.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/session.tsx b/src/screens/session.tsx index 432a4a1..e44b554 100644 --- a/src/screens/session.tsx +++ b/src/screens/session.tsx @@ -1,7 +1,7 @@ import React from "react"; import { StyleSheet, View } from "react-native"; -import BarGraph from "../component/charts/bar-graph/bar-graph"; import { graph_data_two_measures } from "../../test/mock/charts/mock-data"; +import BarGraph from "../component/charts/bar-graph/bar-graph"; // Session Mock - can be used for session summary screen using a query handler component // BarGraph component using mocked data currently