diff --git a/mobile/app/(tabs)/index.tsx b/mobile/app/(tabs)/index.tsx index e29e42d612d09f3081537068a83881c219c108a8..27b158256cbcc5f93062b28aa2128bffae273515 100644 --- a/mobile/app/(tabs)/index.tsx +++ b/mobile/app/(tabs)/index.tsx @@ -1,5 +1,5 @@ -import { DataContextProvider } from '../../src/common/contexts/data_context'; -import { StateSelectionPage } from '../../src/screens/state_selection/state_selection_page'; +import { StateSelectionPage } from "../../src/place/screens/state_selection_page"; + export default function Main () { return ( diff --git a/mobile/app/(tabs)/travel_history.tsx b/mobile/app/(tabs)/travel_history.tsx index 3b9c3e213f5acb8301ae9134caf8b24f56885dd5..6d70fe79d2b0e1e350bf9a599a074bd63803c99b 100644 --- a/mobile/app/(tabs)/travel_history.tsx +++ b/mobile/app/(tabs)/travel_history.tsx @@ -1,5 +1,4 @@ -import { View } from "react-native"; -import { TravelHistoryPage } from "../../src/screens/travel_history/travel_history_page"; +import { TravelHistoryPage } from "../../src/travel/screens/travel_history_page"; export default function TravelHistoryScreen() { return ( diff --git a/mobile/app/profile/edit.tsx b/mobile/app/profile/edit.tsx index bc3f55f0a3511544351b63c271acc630009e881a..7cfa383634e3b044f1ac734ae32c8837357caefb 100644 --- a/mobile/app/profile/edit.tsx +++ b/mobile/app/profile/edit.tsx @@ -1,4 +1,4 @@ -import { EditProfilePage } from "../../src/screens/edit_profile/edit_profile_page"; +import { EditProfilePage } from "../../src/profile/screens/edit_profile_page"; export default function EditProfileScreen() { return ( diff --git a/mobile/app/profile/interests.tsx b/mobile/app/profile/interests.tsx index 3e947d44225d8c6735dc2c24584f1a51e62b43e4..bcbf6f8821392feab2e081469913404f7919de28 100644 --- a/mobile/app/profile/interests.tsx +++ b/mobile/app/profile/interests.tsx @@ -1,4 +1,3 @@ -import { View } from "react-native"; import { ChangeInterestsScreen } from "../../src/profile/screens/change_interests_screen"; export default function Interests() { diff --git a/mobile/app/profile/set_up.tsx b/mobile/app/profile/set_up.tsx index 25d4ff29765af5582b584c17ac07fd308670d299..adfef27fe366b42652439b3d439cb581ebc7f85f 100644 --- a/mobile/app/profile/set_up.tsx +++ b/mobile/app/profile/set_up.tsx @@ -1,4 +1,3 @@ -import { View } from "react-native"; import { FirstTimeComfigScreen } from "../../src/profile/screens/first_time_config_screen"; export default function SetUp() { diff --git a/mobile/app/scan.tsx b/mobile/app/scan.tsx index 16a0619e430afbc119bb5e75cdd782ad28e60524..05eb641d2e655db75f19a32be571b36cbfdcbb2a 100644 --- a/mobile/app/scan.tsx +++ b/mobile/app/scan.tsx @@ -1,4 +1,4 @@ -import ScanPage from "../src/screens/scan/scan_page"; +import ScanPage from "../src/common/screens/scan_page"; export default function ScanScreen() { return ( diff --git a/mobile/app/sign_up.tsx b/mobile/app/sign_up.tsx index 23250b1a65eee188d3493d1e43b6b957a548678f..1bb309f1ad14003a983411fb3ce97e5606c72624 100644 --- a/mobile/app/sign_up.tsx +++ b/mobile/app/sign_up.tsx @@ -1,9 +1,4 @@ -import { View, StyleSheet, Image, Text, Button } from "react-native"; -import { LIGHT_THEME } from "../src/common/constants/theme"; -import { SignUpForm } from "../src/auth/components/sign_up_form"; -import { router } from "expo-router"; import { SignUpPage } from "../src/auth/pages/sign_up_page"; -const loginImage = require("../assets/login-image.jpg"); const SignUp = () => { return ( diff --git a/mobile/app/state/[stateId]/index.tsx b/mobile/app/state/[stateId]/index.tsx index 61456b9916f58f1fce4fbcd52791935c4db3204d..abd59017beeab747efc62d8ab0b90157234abb2e 100644 --- a/mobile/app/state/[stateId]/index.tsx +++ b/mobile/app/state/[stateId]/index.tsx @@ -1,5 +1,5 @@ import { useLocalSearchParams } from "expo-router"; -import { TownSelectionPage } from "../../../src/screens/town_selection/town_selection_page"; +import { TownSelectionPage } from "../../../src/place/screens/town_selection_page"; export default function Index() { const { stateId } = useLocalSearchParams<{stateId: string}>(); diff --git a/mobile/app/state/[stateId]/town/[townId]/activity/[activityId]/travel.tsx b/mobile/app/state/[stateId]/town/[townId]/activity/[activityId]/travel.tsx index 3d1967cac93c574c340740e8231a7876de8952b0..73a529b36b7ad57b1ebaed7076d98968f66b8788 100644 --- a/mobile/app/state/[stateId]/town/[townId]/activity/[activityId]/travel.tsx +++ b/mobile/app/state/[stateId]/town/[townId]/activity/[activityId]/travel.tsx @@ -1,5 +1,4 @@ import { useLocalSearchParams } from "expo-router"; -import { View, Text } from "react-native"; import { ActivityPointScreen } from "../../../../../../../src/activity/screens/activity_point"; diff --git a/mobile/app/state/[stateId]/town/[townId]/activity/_layout.tsx b/mobile/app/state/[stateId]/town/[townId]/activity/_layout.tsx index 7fb512f0b4b854be443550e198d38dcde1b409b0..cdf22644d62088408159c3e7b873e11b472e4e9e 100644 --- a/mobile/app/state/[stateId]/town/[townId]/activity/_layout.tsx +++ b/mobile/app/state/[stateId]/town/[townId]/activity/_layout.tsx @@ -1,5 +1,4 @@ import { Stack } from "expo-router"; -import { LIGHT_THEME } from "../../../../../../src/common/constants/theme"; export default function ActivitySelectionScreen() { return ( diff --git a/mobile/app/state/[stateId]/town/[townId]/index.tsx b/mobile/app/state/[stateId]/town/[townId]/index.tsx index 49bcbfa41c29b783374a48e137a9a4ffbf429801..c1d31d40c8e82d98abe1fe93782892d92e40aee1 100644 --- a/mobile/app/state/[stateId]/town/[townId]/index.tsx +++ b/mobile/app/state/[stateId]/town/[townId]/index.tsx @@ -1,6 +1,5 @@ import { useLocalSearchParams } from "expo-router"; -import { TownSelectionPage } from "../../../../../src/screens/town_selection/town_selection_page"; -import { TownActivitiesPage } from "../../../../../src/screens/town_activities/town_activities_page"; +import { TownActivitiesPage } from "../../../../../src/place/screens/town_activities_page"; export default function TownSelectionScreen() { const { stateId, townId } = useLocalSearchParams<{stateId: string, townId: string}>(); diff --git a/mobile/app/travel_history/_layout.tsx b/mobile/app/travel_history/_layout.tsx index b04fb96751decc4d2db764c412d5de75027c09eb..7d638cb274c17dbc4ca1f0a228914035c0675654 100644 --- a/mobile/app/travel_history/_layout.tsx +++ b/mobile/app/travel_history/_layout.tsx @@ -1,7 +1,7 @@ import { Stack } from "expo-router"; import { LIGHT_THEME } from "../../src/common/constants/theme"; import { Button } from "react-native"; -import { ShareButton } from "../../src/travel_history/components/share_button"; +import { ShareButton } from "../../src/travel/components/share_button"; export default function Layout() { return ( diff --git a/mobile/app/travel_history/details/[id].tsx b/mobile/app/travel_history/details/[id].tsx index 282857b37a4803b59239ae69fcd4a828b8731af0..920de5c5acb9995c556362de13b7f3ddcfe092e1 100644 --- a/mobile/app/travel_history/details/[id].tsx +++ b/mobile/app/travel_history/details/[id].tsx @@ -1,6 +1,6 @@ import { useLocalSearchParams } from "expo-router"; import { View, Text } from "react-native"; -import { TravelDetailsPage } from "../../../src/screens/travel_details/travel_details_page"; +import { TravelDetailsPage } from "../../../src/travel/screens/travel_details_page"; export default function Details() { const { id } = useLocalSearchParams<{ id: string }>(); diff --git a/mobile/package-lock.json b/mobile/package-lock.json index 0145b231234c29d0f5f771069b70279cbf49d14a..18b7b912aa1af882252358e4002c2fb28514a6f9 100644 --- a/mobile/package-lock.json +++ b/mobile/package-lock.json @@ -32,6 +32,7 @@ "i18next": "^23.11.5", "nativewind": "^2.0.11", "react": "18.2.0", + "react-dom": "18.2.0", "react-hook-form": "^7.51.2", "react-i18next": "^14.1.2", "react-native": "0.73.6", @@ -43,7 +44,8 @@ "react-native-reanimated": "~3.6.2", "react-native-safe-area-context": "4.8.2", "react-native-screens": "~3.29.0", - "react-native-svg": "14.1.0" + "react-native-svg": "14.1.0", + "react-native-web": "~0.19.6" }, "devDependencies": { "@babel/core": "^7.20.0", @@ -8000,6 +8002,14 @@ "node": ">=4" } }, + "node_modules/css-in-js-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-3.1.0.tgz", + "integrity": "sha512-fJAcud6B3rRu+KHYk+Bwf+WFL2MDCJJ1XG9x137tJQ0xYxor7XziQtuGFbWNdqrvF4Tk26O3H73nfVqXt/fW1A==", + "dependencies": { + "hyphenate-style-name": "^1.0.3" + } + }, "node_modules/css-mediaquery": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz", @@ -9113,6 +9123,11 @@ "node": ">=8.6.0" } }, + "node_modules/fast-loops": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-loops/-/fast-loops-1.1.4.tgz", + "integrity": "sha512-8dbd3XWoKCTms18ize6JmQF1SFnnfj5s0B7rRry22EofgMu7B6LKHVh+XfFqFGsqnbH54xgeO83PzpKI+ODhlg==" + }, "node_modules/fast-xml-parser": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.6.tgz", @@ -9794,6 +9809,11 @@ "node": ">=10.17.0" } }, + "node_modules/hyphenate-style-name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.1.0.tgz", + "integrity": "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==" + }, "node_modules/i18n-js": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/i18n-js/-/i18n-js-4.4.3.tgz", @@ -9927,6 +9947,15 @@ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, + "node_modules/inline-style-prefixer": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/inline-style-prefixer/-/inline-style-prefixer-6.0.4.tgz", + "integrity": "sha512-FwXmZC2zbeeS7NzGjJ6pAiqRhXR0ugUShSNb6GApMl6da0/XGc4MOJsoWAywia52EEWbXNSy0pzkwz/+Y+swSg==", + "dependencies": { + "css-in-js-utils": "^3.1.0", + "fast-loops": "^1.1.3" + } + }, "node_modules/internal-ip": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", @@ -13473,6 +13502,26 @@ } } }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/react-dom/node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/react-fast-compare": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", @@ -13735,6 +13784,35 @@ "react-native": "*" } }, + "node_modules/react-native-web": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.19.12.tgz", + "integrity": "sha512-o2T0oztoVDQjztt4YksO9S1XRjoH/AqcSvifgWLrPJgGVbMWsfhILgl6lfUdEamVZzZSVV/2gqDVMAk/qq7mZw==", + "dependencies": { + "@babel/runtime": "^7.18.6", + "@react-native/normalize-colors": "^0.74.1", + "fbjs": "^3.0.4", + "inline-style-prefixer": "^6.0.1", + "memoize-one": "^6.0.0", + "nullthrows": "^1.1.1", + "postcss-value-parser": "^4.2.0", + "styleq": "^0.1.3" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/react-native-web/node_modules/@react-native/normalize-colors": { + "version": "0.74.87", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.74.87.tgz", + "integrity": "sha512-Xh7Nyk/MPefkb0Itl5Z+3oOobeG9lfLb7ZOY2DKpFnoCE1TzBmib9vMNdFaLdSxLIP+Ec6icgKtdzYg8QUPYzA==" + }, + "node_modules/react-native-web/node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, "node_modules/react-native/node_modules/@react-native/codegen": { "version": "0.73.3", "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.73.3.tgz", @@ -14809,6 +14887,11 @@ "resolved": "https://registry.npmjs.org/structured-headers/-/structured-headers-0.4.1.tgz", "integrity": "sha512-0MP/Cxx5SzeeZ10p/bZI0S6MpgD+yxAhi1BOQ34jgnMXsCq3j1t6tQnZu+KdlL7dvJTLT3g9xN8tl10TqgFMcg==" }, + "node_modules/styleq": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/styleq/-/styleq-0.1.3.tgz", + "integrity": "sha512-3ZUifmCDCQanjeej1f6kyl/BeP/Vae5EYkQ9iJfUm/QwZvlgnZzyflqAsAWYURdtea8Vkvswu2GrC57h3qffcA==" + }, "node_modules/sucrase": { "version": "3.34.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", diff --git a/mobile/package.json b/mobile/package.json index 1afc8f7383e522475aa86d41c87f72abdcfc8d93..6b81b65e86c7ae897116815202755c063ca5992d 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -44,7 +44,9 @@ "react-native-svg": "14.1.0", "@react-native-picker/picker": "2.6.1", "@react-native-async-storage/async-storage": "1.21.0", - "expo-linear-gradient": "~12.7.2" + "expo-linear-gradient": "~12.7.2", + "react-native-web": "~0.19.6", + "react-dom": "18.2.0" }, "devDependencies": { "@babel/core": "^7.20.0", diff --git a/mobile/src/activity/domain/entities/activity_info_entity.ts b/mobile/src/activity/domain/entities/activity_info_entity.ts index 84457d39c4142df1a772312adf981c0c0c0be822..93fef1d4f61fce29f945bb4b590cf0f571008f6e 100644 --- a/mobile/src/activity/domain/entities/activity_info_entity.ts +++ b/mobile/src/activity/domain/entities/activity_info_entity.ts @@ -1,4 +1,4 @@ -import { PlaceInfoEntity } from "../../../domain/entities/place_info_entity"; +import { PlaceInfoEntity } from "../../../place/domain/entities/place_info_entity"; export interface ActivityInfoEntity extends PlaceInfoEntity { diff --git a/mobile/src/hooks/useGetActivities.ts b/mobile/src/activity/hooks/useGetActivities.ts similarity index 77% rename from mobile/src/hooks/useGetActivities.ts rename to mobile/src/activity/hooks/useGetActivities.ts index f6e39305d9adcf295cf38b62083b208dcd7b2648..d7492936bab62ff1e2a9ece7d2c1f43c0a587a95 100644 --- a/mobile/src/hooks/useGetActivities.ts +++ b/mobile/src/activity/hooks/useGetActivities.ts @@ -1,6 +1,7 @@ -import { useDataContext } from "../common/contexts/data_context"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useGet } from "../../common/hooks/useGet"; import { ActivityInfoEntity } from "../domain/entities/activity_info_entity"; -import { useGet } from "./useGet" + export const useGetActivities = (townId: number) => { const { statesRepository } = useDataContext(); diff --git a/mobile/src/hooks/useGetActivityInfo.ts b/mobile/src/activity/hooks/useGetActivityInfo.ts similarity index 78% rename from mobile/src/hooks/useGetActivityInfo.ts rename to mobile/src/activity/hooks/useGetActivityInfo.ts index 2120efa7d1f21bba45db43f26c21c3a8d6b0cb9d..9265b2601d01391ce7acde61971a52dbbdf01a70 100644 --- a/mobile/src/hooks/useGetActivityInfo.ts +++ b/mobile/src/activity/hooks/useGetActivityInfo.ts @@ -1,6 +1,7 @@ -import { useDataContext } from "../common/contexts/data_context"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useGet } from "../../common/hooks/useGet"; import { ActivityInfoEntity } from "../domain/entities/activity_info_entity"; -import { useGet } from "./useGet"; + export const useGetActivityInfo = (activityId: number) => { const { statesRepository } = useDataContext(); diff --git a/mobile/src/hooks/useGetActivityPoint.ts b/mobile/src/activity/hooks/useGetActivityPoint.ts similarity index 72% rename from mobile/src/hooks/useGetActivityPoint.ts rename to mobile/src/activity/hooks/useGetActivityPoint.ts index 91816d2d16858171a6e4293c1f94c58c7be605dc..7667f364889a68a44b92dffd13490e6b43282c86 100644 --- a/mobile/src/hooks/useGetActivityPoint.ts +++ b/mobile/src/activity/hooks/useGetActivityPoint.ts @@ -1,6 +1,6 @@ -import { useDataContext } from "../common/contexts/data_context" -import { ActivityPlaceEntity } from "../activity/domain/entities/activity_place_entity"; -import { useGet } from "./useGet"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useGet } from "../../common/hooks/useGet"; +import { ActivityPlaceEntity } from "../domain/entities/activity_place_entity"; interface UseGetActivityPointProps { stateId: number; diff --git a/mobile/src/infrastructure/datasource/dev/activity_datasource.ts b/mobile/src/activity/infrastructure/datasources/dev/activity_datasource.ts similarity index 85% rename from mobile/src/infrastructure/datasource/dev/activity_datasource.ts rename to mobile/src/activity/infrastructure/datasources/dev/activity_datasource.ts index e6731af7879fed76d9cdd4c6a3f1d6d69aae3822..77d9c9c2a5d2bfe44e4a5b7df3c3ad9f181feb04 100644 --- a/mobile/src/infrastructure/datasource/dev/activity_datasource.ts +++ b/mobile/src/activity/infrastructure/datasources/dev/activity_datasource.ts @@ -1,5 +1,5 @@ -import { ActivityDataSource } from "../../../activity/domain/datasources/activity_datasource"; -import { ActivityPlaceEntity } from "../../../activity/domain/entities/activity_place_entity"; +import { ActivityDataSource } from "../../../domain/datasources/activity_datasource"; +import { ActivityPlaceEntity } from "../../../domain/entities/activity_place_entity"; export class ActivityDatasourceDev implements ActivityDataSource { async rankActivity(activityId: number, rank: number): Promise { diff --git a/mobile/src/infrastructure/datasource/prod/activity_datasource.ts b/mobile/src/activity/infrastructure/datasources/prod/activity_datasource.ts similarity index 67% rename from mobile/src/infrastructure/datasource/prod/activity_datasource.ts rename to mobile/src/activity/infrastructure/datasources/prod/activity_datasource.ts index 45bf6d02345f8a24e2ef03d2bb893d503c0112da..4bfae0ff7171b8f463b3c1b27f13cb0bacec956a 100644 --- a/mobile/src/infrastructure/datasource/prod/activity_datasource.ts +++ b/mobile/src/activity/infrastructure/datasources/prod/activity_datasource.ts @@ -1,10 +1,10 @@ import axios from "axios"; -import { ActivityPlaceEntity } from "../../../activity/domain/entities/activity_place_entity"; -import { API_URL } from "../../../common/constants/api"; -import { ActivityPlaceModel } from "../../models/prod/activity_place_model"; +import { ActivityDataSource } from "../../../domain/datasources/activity_datasource"; +import { Languages } from "../../../../lang/translations"; +import { ActivityPlaceModel } from "../../models/activity_place_model"; import { activityPlaceModelToEntity } from "../../utils/activity_utils"; -import { Languages } from "../../../lang/translations"; -import { ActivityDataSource } from "../../../activity/domain/datasources/activity_datasource"; +import { API_URL } from "../../../../common/constants/api"; +import { ActivityPlaceEntity } from "../../../domain/entities/activity_place_entity"; export class ActivityDatasourceProd implements ActivityDataSource { constructor(private lang: string = Languages.SPANISH) {} diff --git a/mobile/src/infrastructure/models/prod/activity_model.ts b/mobile/src/activity/infrastructure/models/activity_model.ts similarity index 100% rename from mobile/src/infrastructure/models/prod/activity_model.ts rename to mobile/src/activity/infrastructure/models/activity_model.ts diff --git a/mobile/src/infrastructure/models/prod/activity_place_model.ts b/mobile/src/activity/infrastructure/models/activity_place_model.ts similarity index 100% rename from mobile/src/infrastructure/models/prod/activity_place_model.ts rename to mobile/src/activity/infrastructure/models/activity_place_model.ts diff --git a/mobile/src/infrastructure/models/prod/tag_model.ts b/mobile/src/activity/infrastructure/models/tag_model.ts similarity index 100% rename from mobile/src/infrastructure/models/prod/tag_model.ts rename to mobile/src/activity/infrastructure/models/tag_model.ts diff --git a/mobile/src/infrastructure/repositories/activity_repository.ts b/mobile/src/activity/infrastructure/repositories/activity_repository.ts similarity index 66% rename from mobile/src/infrastructure/repositories/activity_repository.ts rename to mobile/src/activity/infrastructure/repositories/activity_repository.ts index eb51e198bf7ee7cc0bff076d7040d78b133e44b9..ae90b7e99375c0a299be42c32f2288e312e33ca9 100644 --- a/mobile/src/infrastructure/repositories/activity_repository.ts +++ b/mobile/src/activity/infrastructure/repositories/activity_repository.ts @@ -1,6 +1,6 @@ -import { ActivityDataSource } from "../../activity/domain/datasources/activity_datasource"; -import { ActivityPlaceEntity } from "../../activity/domain/entities/activity_place_entity"; -import { ActivityRepository } from "../../activity/domain/repositories/activity_repository"; +import { ActivityDataSource } from "../../domain/datasources/activity_datasource"; +import { ActivityPlaceEntity } from "../../domain/entities/activity_place_entity"; +import { ActivityRepository } from "../../domain/repositories/activity_repository"; export class ActivityRepositoryDev implements ActivityRepository { constructor( diff --git a/mobile/src/infrastructure/utils/activity_utils.ts b/mobile/src/activity/infrastructure/utils/activity_utils.ts similarity index 74% rename from mobile/src/infrastructure/utils/activity_utils.ts rename to mobile/src/activity/infrastructure/utils/activity_utils.ts index 04ec0601259702dc2472bdd576fbdd1aedd90be4..b16a10929a13385ce933be30a8bb4d8933667916 100644 --- a/mobile/src/infrastructure/utils/activity_utils.ts +++ b/mobile/src/activity/infrastructure/utils/activity_utils.ts @@ -1,5 +1,5 @@ -import { ActivityPlaceEntity } from "../../activity/domain/entities/activity_place_entity"; -import { ActivityPlaceModel } from "../models/prod/activity_place_model"; +import { ActivityPlaceEntity } from "../../domain/entities/activity_place_entity"; +import { ActivityPlaceModel } from "../models/activity_place_model"; export const activityPlaceModelToEntity = (activity: ActivityPlaceModel): ActivityPlaceEntity => { return { diff --git a/mobile/src/activity/screens/activity_description_page.tsx b/mobile/src/activity/screens/activity_description_page.tsx index 14046fc0d34d76e21e513ca25d561ce1656f385a..44c4953de261f945bbf7f5e121c234a4a75eb667 100644 --- a/mobile/src/activity/screens/activity_description_page.tsx +++ b/mobile/src/activity/screens/activity_description_page.tsx @@ -10,16 +10,16 @@ import { } from "react-native"; import { FullPageLoader } from "../../common/components/full_page_loader"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; -import { useGetActivityInfo } from "../../hooks/useGetActivityInfo"; import { router } from "expo-router"; import { Ionicons } from "@expo/vector-icons"; import { useCallback, useEffect, useRef, useState } from "react"; import { ActivityBottomSheet } from "../../activity/components/activity_bottom_sheet"; import * as ScreenOrientation from "expo-screen-orientation"; import { LIGHT_THEME } from "../../common/constants/theme"; -import { useScreenOrientation } from "../../hooks/useScreenOrientation"; -import { useRotationEnabled } from "../../hooks/useRotationEnabled"; +import { useScreenOrientation } from "../../common/hooks/useScreenOrientation"; +import { useRotationEnabled } from "../../common/hooks/useRotationEnabled"; import { FloatingBackButton } from "../../common/components/floating_back_button"; +import { useGetActivityInfo } from "../hooks/useGetActivityInfo"; interface ActivityDescriptionPageProps { activityId: number; } diff --git a/mobile/src/activity/screens/activity_not_found_page.tsx b/mobile/src/activity/screens/activity_not_found_page.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mobile/src/activity/screens/activity_point.tsx b/mobile/src/activity/screens/activity_point.tsx index b8bd8eaafea2aaa05bf0291580302f8dd4075e7f..2def317f7e71f944de0172db4ab0bb54a431832a 100644 --- a/mobile/src/activity/screens/activity_point.tsx +++ b/mobile/src/activity/screens/activity_point.tsx @@ -1,7 +1,6 @@ import { Image, Text, View, StyleSheet, BackHandler } from "react-native"; import { FullPageLoader } from "../../common/components/full_page_loader"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; -import { useGetActivityPoint } from "../../hooks/useGetActivityPoint"; import { ScrollView } from "react-native-gesture-handler"; import { AudioPlayer } from "../../common/components/audio_player"; import { TouchableOpacity } from "@gorhom/bottom-sheet"; @@ -12,6 +11,7 @@ import { memo, useEffect, useState } from "react"; import { StarRatingForm } from "../../common/components/rating_page/star_rating_form"; import { FullPageRating } from "../../common/components/rating_page/full_page_rating"; import { useRankActivity } from "../hooks/useRankActivity"; +import { useGetActivityPoint } from "../hooks/useGetActivityPoint"; interface ActivityPointScreenProps { stateId: number; diff --git a/mobile/src/utils/activity_route.ts b/mobile/src/activity/utils/activity_route.ts similarity index 100% rename from mobile/src/utils/activity_route.ts rename to mobile/src/activity/utils/activity_route.ts diff --git a/mobile/src/auth/components/password_form.tsx b/mobile/src/auth/components/password_form.tsx index 49c16b4e0939902e9f16030a2ea235eac844aee2..674595f0e060ea0887224c0dd3a750680eae8190 100644 --- a/mobile/src/auth/components/password_form.tsx +++ b/mobile/src/auth/components/password_form.tsx @@ -13,12 +13,29 @@ export const PasswordForm = ({ control }: PasswordFormProps) => { ( + render={({ field: { onChange, onBlur, value }, formState: {errors} }) => ( onChange(value), + }} + /> + )} + /> + ( + onChange(value), }} diff --git a/mobile/src/auth/domain/datasources/auth_datasource.ts b/mobile/src/auth/domain/datasources/auth_datasource.ts index 589ebc642717c0a4dbaf318dc5741f5fa237e171..fb64d7487afe43464643601a2646fc40132b0166 100644 --- a/mobile/src/auth/domain/datasources/auth_datasource.ts +++ b/mobile/src/auth/domain/datasources/auth_datasource.ts @@ -1,10 +1,11 @@ import { LoginInfoEntity } from "../entities/login_info_entity"; import { RegisterInfoEntity } from "../entities/register_info"; +import { ResetPasswordInfoEntity } from "../entities/reset_password_entity"; import { UserInfoEntity } from "../entities/user_info_entity"; export interface AuthDataSource { login: (email: string, password: string) => Promise; register: (user: RegisterInfoEntity) => Promise; getResetCode: (email: string) => Promise; - resetPassword: (code: string) => Promise; + resetPassword: (resetInfo: ResetPasswordInfoEntity) => Promise; } \ No newline at end of file diff --git a/mobile/src/auth/domain/entities/reset_password_entity.ts b/mobile/src/auth/domain/entities/reset_password_entity.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e8e09018050ce4a02c257a620cd830b1b174780 --- /dev/null +++ b/mobile/src/auth/domain/entities/reset_password_entity.ts @@ -0,0 +1,5 @@ +export interface ResetPasswordInfoEntity { + email: string; + newPassword: string; + code: string; +} \ No newline at end of file diff --git a/mobile/src/auth/domain/repositories/auth_repository.ts b/mobile/src/auth/domain/repositories/auth_repository.ts index e65719dd31ba66023201afb4fa8ff4e2af6354fd..9f4750f8277933e6578556cbadf2c3982af30b23 100644 --- a/mobile/src/auth/domain/repositories/auth_repository.ts +++ b/mobile/src/auth/domain/repositories/auth_repository.ts @@ -1,10 +1,10 @@ import { LoginInfoEntity } from "../entities/login_info_entity"; import { RegisterInfoEntity } from "../entities/register_info"; -import { UserInfoEntity } from '../entities/user_info_entity'; +import { ResetPasswordInfoEntity } from "../entities/reset_password_entity"; export interface AuthRepository { login: (email: string, password: string) => Promise; register: (user: RegisterInfoEntity) => Promise; getResetCode: (email: string) => Promise; - resetPassword: (code: string) => Promise; + resetPassword: (resetInfo: ResetPasswordInfoEntity) => Promise; } \ No newline at end of file diff --git a/mobile/src/auth/errors/reset_password_error.ts b/mobile/src/auth/errors/reset_password_error.ts new file mode 100644 index 0000000000000000000000000000000000000000..71d52b68c61e313347a3373fa656b8f7173291e1 --- /dev/null +++ b/mobile/src/auth/errors/reset_password_error.ts @@ -0,0 +1,12 @@ +export enum ChangePaswordError { + PASSWORD_MISMATCH, + UNDEFINED +} + +export class ResetPasswordError extends Error { + public readonly type: ChangePaswordError; + constructor(type: ChangePaswordError, message?: string,) { + super(message); + this.type = type; + } +} \ No newline at end of file diff --git a/mobile/src/auth/hooks/useResetPassword.ts b/mobile/src/auth/hooks/useResetPassword.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b168e718ae5d805958890b4280c6924fe1f2788 --- /dev/null +++ b/mobile/src/auth/hooks/useResetPassword.ts @@ -0,0 +1,77 @@ +import { useForm } from "react-hook-form"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useState } from "react"; +import { ApiRequestStatus } from "../../common/constants/api_request_states"; +import { router } from "expo-router"; +import { ChangePaswordError, ResetPasswordError } from "../errors/reset_password_error"; + +export interface ResetPasswordFormValues { + email: string; + newPassword: string; + newPasswordConfirmation: string; + code: string; +} + +export const useResetPassword = () => { + const { authRepository } = useDataContext(); + const { control, handleSubmit, getValues, setError, setValue } = useForm({ + defaultValues: { + email: "", + newPassword: "", + newPasswordConfirmation: "", + code: "", + } + }); + const [status, setStatus] = useState(ApiRequestStatus.IDLE); + + const setLoading = async () => { + setStatus(ApiRequestStatus.LOADING); + }; + + const getResetCode = async () => { + await setLoading(); + if (!getValues().email) { + console.log(getValues()) + setError("email", { type: "manual", message: "Email is required" }); + throw new Error("Email is required"); + } + await authRepository!.getResetCode(getValues().email); + setStatus(ApiRequestStatus.SUCCESS); + }; + + const validSubmit = async (data: ResetPasswordFormValues) => { + try { + await setLoading(); + if (data.newPassword !== data.newPasswordConfirmation) { + setError("newPasswordConfirmation", { type: "manual", message: "Passwords do not match" }); + return; + } + await authRepository!.resetPassword({ + newPassword: data.newPassword, + code: data.code, + email: data.email + }) + router.replace("/login"); + } catch (error) { + if (error instanceof ResetPasswordError && error.type == ChangePaswordError.UNDEFINED) { + throw new Error(); + } + } + }; + + const errorSubmit = async () => { + throw new Error(); + }; + + const onSubmit = async () => { + await handleSubmit(validSubmit, errorSubmit)(); + }; + + return { + control, + getResetCode, + setValue, + onSubmit, + status + }; +} diff --git a/mobile/src/auth/hooks/useResetPasswordControl.tsx b/mobile/src/auth/hooks/useResetPasswordControl.tsx new file mode 100644 index 0000000000000000000000000000000000000000..6b96a53242479611e5ba099a62243fc1f2a7895d --- /dev/null +++ b/mobile/src/auth/hooks/useResetPasswordControl.tsx @@ -0,0 +1,83 @@ +import { useEffect, useState } from "react"; +import { ResetPasswordForm } from "../components/reset_password_form"; +import { CodeForm } from "../components/code_form"; +import { PasswordForm } from "../components/password_form"; +import { useResetPassword } from "./useResetPassword"; + +interface ResetPasswordSlide { + slide: JSX.Element; + callback: () => Promise; + onError?: () => void; +} + +export const useResetPasswordControl = () => { + const { + control, + getResetCode, + setValue, + onSubmit, + status: requestStatus, + } = useResetPassword(); + const slides: ResetPasswordSlide[] = [ + { + slide: , + callback: async () => { + await getResetCode(); + }, + }, + { + slide: , + callback: async () => { + console.log("Reset Password 1"); + }, + }, + { + slide: , + callback: async () => { + onSubmit(); + }, + }, + ]; + const [step, setStep] = useState(0); + const [slide, setSlide] = useState(slides[step]); + const [isLast, setIsLast] = useState(step === slides.length - 1); + const [isFirst, setIsFirst] = useState(step === 0); + + const onNext = async () => { + try { + await slide.callback(); + setStep(step + 1); + } catch (error) { + console.log(error); + slide.onError && slide.onError(); + } + }; + + const onPrevious = () => { + setStep(step - 1); + }; + + const onFinish = () => { + try { + slide.callback(); + } catch (e) { + slide.onError && slide.onError(); + } + }; + + useEffect(() => { + setSlide(slides[step]); + setIsFirst(step === 0); + setIsLast(step === slides.length - 1); + }, [step]); + + return { + onNext, + onFinish, + slide: slide.slide, + isFirst, + isLast, + onPrevious, + requestStatus, + }; +}; diff --git a/mobile/src/auth/infrastructure/dev/datasources/auth_datasource.ts b/mobile/src/auth/infrastructure/dev/datasources/auth_datasource.ts index d06b3e59d4adbc4a7bd2055c91460691b0edd9da..3a9bbf9269e21639295220c52ca80336a2f4c424 100644 --- a/mobile/src/auth/infrastructure/dev/datasources/auth_datasource.ts +++ b/mobile/src/auth/infrastructure/dev/datasources/auth_datasource.ts @@ -1,13 +1,14 @@ -import { delay } from '../../../../utils/dev/delay_time'; +import { delay } from '../../../../common/utils/delay_time'; import { AuthDataSource } from '../../../domain/datasources/auth_datasource'; import { LoginInfoEntity } from '../../../domain/entities/login_info_entity'; import { RegisterInfoEntity } from '../../../domain/entities/register_info'; +import { ResetPasswordInfoEntity } from '../../../domain/entities/reset_password_entity'; import { UserInfoEntity } from '../../../domain/entities/user_info_entity'; export class AuthDataSourceDev implements AuthDataSource { getResetCode (email: string): Promise{ throw new Error("Method not implemented."); } - resetPassword (code: string): Promise { + resetPassword (resetInfo: ResetPasswordInfoEntity): Promise { throw new Error("Method not implemented."); } async login(email: string, password: string): Promise{ diff --git a/mobile/src/auth/infrastructure/prod/datasources/auth_datasource.ts b/mobile/src/auth/infrastructure/prod/datasources/auth_datasource.ts index 9cd0ed4ee6f9b73e5fdbdd132ddd3cbc41c282d0..48937de3348686da5c6ae4aabfa2cf94d7a639d3 100644 --- a/mobile/src/auth/infrastructure/prod/datasources/auth_datasource.ts +++ b/mobile/src/auth/infrastructure/prod/datasources/auth_datasource.ts @@ -7,13 +7,30 @@ import { API_URL } from "../../../../common/constants/api"; import { LoginUserModel } from "../models/login_user_model"; import { UserInfoEntity } from "../../../domain/entities/user_info_entity"; import { RegisterResponseModel } from "../models/register_user_model"; +import { ResetPasswordInfoEntity } from "../../../domain/entities/reset_password_entity"; export class AuthDatasourceProd implements AuthDataSource { - getResetCode (email: string): Promise { - throw new Error("Method not implemented."); + async getResetCode (email: string): Promise { + const {status} = await axios.post(`${API_URL}/user/get-reset-code`, { + email + }); + + if (status !== 201) { + throw new Error("Error fetching new reset code"); + } } - resetPassword (code: string): Promise { - throw new Error("Method not implemented."); + async resetPassword (resetInfo: ResetPasswordInfoEntity): Promise { + const resetInfoModel = { + email: resetInfo.email, + resetCode: resetInfo.code, + newPassword: resetInfo.newPassword + } + + const {status} = await axios.post(`${API_URL}/user/reset-password`, resetInfoModel); + + if (status !== 201) { + throw new Error("Error reset Password"); + } } login: (email: string, password: string) => Promise = async (email, password) => { const loginInfo: LoginUserModel = { diff --git a/mobile/src/auth/infrastructure/prod/repositories/auth_repository.ts b/mobile/src/auth/infrastructure/prod/repositories/auth_repository.ts index 215907532a9ba5e05daf0add65e56aa25a0b311a..33d46bbacb1b1de0dc882758cd282fd954a57af4 100644 --- a/mobile/src/auth/infrastructure/prod/repositories/auth_repository.ts +++ b/mobile/src/auth/infrastructure/prod/repositories/auth_repository.ts @@ -1,5 +1,6 @@ import { AuthDataSource } from '../../../domain/datasources/auth_datasource'; import { RegisterInfoEntity } from '../../../domain/entities/register_info'; +import { ResetPasswordInfoEntity } from '../../../domain/entities/reset_password_entity'; import { UserInfoEntity } from '../../../domain/entities/user_info_entity'; import { AuthRepository } from '../../../domain/repositories/auth_repository'; export class AuthRepositoryImpl implements AuthRepository { @@ -8,8 +9,8 @@ export class AuthRepositoryImpl implements AuthRepository { getResetCode (email: string) { return this.authDataSource.getResetCode(email); } - resetPassword (code: string) { - return this.authDataSource.resetPassword(code); + resetPassword (resetInfo: ResetPasswordInfoEntity) { + return this.authDataSource.resetPassword(resetInfo); } async login(email: string, password: string) { return await this.authDataSource.login(email, password); diff --git a/mobile/src/auth/pages/reset_password_page.tsx b/mobile/src/auth/pages/reset_password_page.tsx index 26b69503ef0acc3aa450524e06e65b3dbbe98731..051542674d41f70f7007b7199b3ed97a166cfa30 100644 --- a/mobile/src/auth/pages/reset_password_page.tsx +++ b/mobile/src/auth/pages/reset_password_page.tsx @@ -1,132 +1,22 @@ -import { useEffect, useState, useCallback } from "react"; import { SlideControl } from "../../common/components/slide_control"; -import { ResetPasswordForm } from "../components/reset_password_form"; import { View, StyleSheet } from "react-native"; -import { CodeForm } from "../components/code_form"; -import { useDataContext } from "../../common/contexts/data_context"; -import { useForm } from "react-hook-form"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; -import { PasswordForm } from "../components/password_form"; - -interface ResetPasswordSlide { - slide: JSX.Element; - callback: () => Promise; - onError?: () => void; -} - -export interface ResetPasswordFormValues { - email: string; - newPassword: string; - code: string; -} - -export const useResetPassword = () => { - const { authRepository } = useDataContext(); - const { control, handleSubmit, getValues, setError, setValue } = useForm({ - defaultValues: { - email: "", - newPassword: "", - code: "", - } - }); - const [status, setStatus] = useState(ApiRequestStatus.IDLE); - - const setLoading = async () => { - setStatus(ApiRequestStatus.LOADING); - }; - - const getResetCode = async () => { - await setLoading(); - if (getValues().email) { - setError("email", { type: "manual", message: "Email is required" }); - throw new Error("Email is required"); - } - await authRepository!.getResetCode(getValues().email); - setStatus(ApiRequestStatus.SUCCESS); - }; - - const validSubmit = async (data: ResetPasswordFormValues) => { - console.log("Valid Submit", data); - }; - - const errorSubmit = async () => { - - }; - - const onSubmit = async () => { - await setLoading(); - await handleSubmit(validSubmit, errorSubmit)(); - }; - - return { - control, - getResetCode, - setValue, - onSubmit - }; -} - -const useResetPasswordControl = () => { - const { control, getResetCode, setValue, onSubmit } = useResetPassword(); - const slides: ResetPasswordSlide[] = [ - { - slide: , - callback: async () => { - //await getResetCode(); - } - }, - { - slide: , - callback: async () => { - console.log("Reset Password 1"); - } - }, - { - slide: , - callback: async () => { - onSubmit(); - } - } - ]; - const [step, setStep] = useState(0); - const [slide, setSlide] = useState(slides[step]); - const [isLast, setIsLast] = useState(step === slides.length - 1); - const [isFirst, setIsFirst] = useState(step === 0); - - const onNext = async () => { - try { - await slide.callback(); - setStep(step + 1); - } catch (error) { - console.log(error); - slide.onError && slide.onError(); - } - }; - - const onPrevious = () => { - setStep(step - 1); - }; - - const onFinish = () => { - try { - slide.callback(); - } catch (e) { - slide.onError && slide.onError(); - } - }; - - useEffect(() => { - setSlide(slides[step]); - setIsFirst(step === 0); - setIsLast(step === slides.length - 1); - }, [step]); - - return { onNext, onFinish, slide: slide.slide, isFirst, isLast, onPrevious }; -}; +import { FullPageLoader } from "../../common/components/full_page_loader"; +import { useResetPasswordControl } from "../hooks/useResetPasswordControl"; export const ResetPasswordPage = () => { - const { onNext, onFinish, slide, isFirst, isLast, onPrevious } = - useResetPasswordControl(); + const { + onNext, + onFinish, + slide, + isFirst, + isLast, + onPrevious, + requestStatus, + } = useResetPasswordControl(); + if (requestStatus === ApiRequestStatus.LOADING) { + return ; + } return ( {slide} diff --git a/mobile/src/common/components/animated_background.tsx b/mobile/src/common/components/animated_background.tsx index b06ea8e6c9cdc769ce8196df42407581e12a382b..7363b799f03099a27f6cdaf3bf2c547523f5e8b3 100644 --- a/mobile/src/common/components/animated_background.tsx +++ b/mobile/src/common/components/animated_background.tsx @@ -1,8 +1,4 @@ import { Animated, Image, View } from "react-native"; -import { PlaceInfoEntity } from "../../domain/entities/place_info_entity"; -import { useAnimatedSelectedIndex } from "../../hooks/useAnimatedSelectedIndex"; -import { LinearGradient } from "expo-linear-gradient"; -import { LIGHT_THEME } from "../constants/theme"; interface AnimatedBackgroundProps { imageUri?: string; diff --git a/mobile/src/common/components/audio_player.tsx b/mobile/src/common/components/audio_player.tsx index fd3e59dd9f2eb93eb17f52abae7089a307d42ece..e827c33f73903dbe7df5a59ddb8c7b37be119de3 100644 --- a/mobile/src/common/components/audio_player.tsx +++ b/mobile/src/common/components/audio_player.tsx @@ -1,7 +1,7 @@ import { TouchableOpacity, View, StyleSheet, Text } from "react-native"; import { FontAwesome, Feather } from "@expo/vector-icons"; import Slider from "@react-native-community/slider"; -import { millisecondsToHourFormat } from "../../utils/time"; +import { millisecondsToHourFormat } from "../utils/time"; import { LIGHT_THEME } from "../constants/theme"; import { useAudio } from "../contexts/audio_context"; import { useEffect } from "react"; diff --git a/mobile/src/common/components/caroussel/caroussel.tsx b/mobile/src/common/components/caroussel/caroussel.tsx index edcdd508f0b83550dca90193f696a6e7f4be2761..a5d04b3349901c0648c533d83123513eca0fb63d 100644 --- a/mobile/src/common/components/caroussel/caroussel.tsx +++ b/mobile/src/common/components/caroussel/caroussel.tsx @@ -7,9 +7,8 @@ import { NativeSyntheticEvent, NativeScrollEvent, } from "react-native"; -import { PlaceInfoEntity } from "../../../domain/entities/place_info_entity"; +import { PlaceInfoEntity } from "../../../place/domain/entities/place_info_entity"; import { useRef } from "react"; -import { StateDataSource } from "../../../domain/datasources/state_datasource"; import { CarousselTile } from "./caroussel_tile"; import { router } from "expo-router"; import { BLANK_ITEM_WIDTH, ITEM_WIDTH } from "../../constants/caroussel"; diff --git a/mobile/src/common/components/caroussel/caroussel_tile.tsx b/mobile/src/common/components/caroussel/caroussel_tile.tsx index e4caa023f7801776d0f44e65649a6bbcef75380a..97222a722c5d9f0dbb114148667e38a43557f702 100644 --- a/mobile/src/common/components/caroussel/caroussel_tile.tsx +++ b/mobile/src/common/components/caroussel/caroussel_tile.tsx @@ -7,7 +7,7 @@ import { Text, TouchableOpacity, } from "react-native"; -import { PlaceInfoEntity } from "../../../domain/entities/place_info_entity"; +import { PlaceInfoEntity } from "../../../place/domain/entities/place_info_entity"; import { Link } from "expo-router"; import { ITEM_HEIGHT, ITEM_WIDTH } from "../../constants/caroussel"; diff --git a/mobile/src/common/constants/api.ts b/mobile/src/common/constants/api.ts index 1ea7e0eeb3f45f5c45bdde95f38d281f54eb235a..c4d4fe8de65867d6440c49e432cba14106ae2b99 100644 --- a/mobile/src/common/constants/api.ts +++ b/mobile/src/common/constants/api.ts @@ -1 +1 @@ -export const API_URL = 'http://172.18.48.1:3005'; \ No newline at end of file +export const API_URL = 'http://192.168.0.14:3005'; \ No newline at end of file diff --git a/mobile/src/common/contexts/data_context.tsx b/mobile/src/common/contexts/data_context.tsx index c64a8a9c0607e5c585bf4f7adaef896b73f8b91b..e82b1959cb5af23bcaa7b9f7fae2726d154835d4 100644 --- a/mobile/src/common/contexts/data_context.tsx +++ b/mobile/src/common/contexts/data_context.tsx @@ -1,28 +1,28 @@ import { createContext, PropsWithChildren, useContext } from "react"; -import { StateRepository } from "../../domain/repositories/state_repository"; -import { StateRepositoryImpl } from "../../infrastructure/repositories/state_repository"; -import { StateDataSourceDev } from "../../infrastructure/datasource/dev/state_datasource"; +import { StateRepositoryImpl } from "../../place/infrastructure/repositories/state_repository"; +import { StateDataSourceDev } from "../../place/infrastructure/datasources/dev/state_datasource"; import { AuthRepository } from "../../auth/domain/repositories/auth_repository"; import { AuthDataSourceDev } from '../../auth/infrastructure/dev/datasources/auth_datasource'; import { AuthRepositoryImpl } from "../../auth/infrastructure/prod/repositories/auth_repository"; -import { AuthDatasourceProd } from '../../auth/infrastructure/prod/datasources/auth_datasource'; -import { ActivityDatasourceDev } from "../../infrastructure/datasource/dev/activity_datasource"; -import { ActivityRepositoryDev } from '../../infrastructure/repositories/activity_repository'; -import { TravelDatasourceDev } from "../../infrastructure/datasource/dev/travel_datasource"; -import { TravelRepositoryImpl } from "../../infrastructure/repositories/travel_repository"; -import { TravelRepository } from "../../domain/repositories/travel_repository"; -import { RouteRepository } from "../../domain/repositories/route_repository"; -import { RouteDataSourceDev } from "../../infrastructure/datasource/dev/route_datasource"; -import { RouteRepositoryImpl } from "../../infrastructure/repositories/route_repository"; -import { StateDataSourceProd } from "../../infrastructure/datasource/prod/state_datasource"; +import { RouteRepository } from "../../route/domain/repositories/route_repository"; +import { RouteDataSourceDev } from "../../route/infrastructure/datasources/dev/route_datasource"; +import { RouteRepositoryImpl } from "../../route/infrastructure/repositories/route_repository"; +import { StateDataSourceProd } from "../../place/infrastructure/datasources/prod/state_datasource"; import { ProfileRepository } from "../../profile/domain/repositories/profile_repository"; import { ProfileDataSourceDev } from "../../profile/infrastructure/datasources/dev/profile_datasource"; import { ProfileRepositoryImpl } from "../../profile/infrastructure/repositories/profile_repository"; -import { ActivityDatasourceProd } from "../../infrastructure/datasource/prod/activity_datasource"; import { useTranslation } from "react-i18next"; import { ProfileDataSourceProd } from "../../profile/infrastructure/datasources/prod/profile_datasource"; import { ActivityRepository } from "../../activity/domain/repositories/activity_repository"; -import { RouteDatasourceProd } from "../../infrastructure/datasource/prod/route_datasource"; +import { RouteDatasourceProd } from "../../route/infrastructure/datasources/prod/route_datasource"; +import { ActivityRepositoryDev } from "../../activity/infrastructure/repositories/activity_repository"; +import { ActivityDatasourceProd } from "../../activity/infrastructure/datasources/prod/activity_datasource"; +import { ActivityDatasourceDev } from "../../activity/infrastructure/datasources/dev/activity_datasource"; +import { StateRepository } from "../../place/domain/repositories/state_repository"; +import { TravelRepository } from "../../travel/domain/repositories/travel_repository"; +import { TravelRepositoryImpl } from "../../travel/infrastructure/repositories/travel_repository"; +import { AuthDatasourceProd } from "../../auth/infrastructure/prod/datasources/auth_datasource"; +import { TravelDatasourceDev } from "../../travel/infrastructure/datasources/dev/travel_datasource"; type DataContextType = { statesRepository: StateRepository | null; diff --git a/mobile/src/hooks/useAnimatedSelectedIndex.ts b/mobile/src/common/hooks/useAnimatedSelectedIndex.ts similarity index 100% rename from mobile/src/hooks/useAnimatedSelectedIndex.ts rename to mobile/src/common/hooks/useAnimatedSelectedIndex.ts diff --git a/mobile/src/hooks/useAudio.ts b/mobile/src/common/hooks/useAudio.ts similarity index 100% rename from mobile/src/hooks/useAudio.ts rename to mobile/src/common/hooks/useAudio.ts diff --git a/mobile/src/hooks/useGet.ts b/mobile/src/common/hooks/useGet.ts similarity index 92% rename from mobile/src/hooks/useGet.ts rename to mobile/src/common/hooks/useGet.ts index dead195efaddc5b4127ac83d41598a316c44265f..eb72d1c0542932c826ee9c39711ef57e49338a81 100644 --- a/mobile/src/hooks/useGet.ts +++ b/mobile/src/common/hooks/useGet.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { ApiRequestStatus } from "../common/constants/api_request_states"; import { set } from "react-hook-form"; +import { ApiRequestStatus } from "../constants/api_request_states"; export const useGet = (callback: () => Promise) => { const [data, setData] = useState(null); diff --git a/mobile/src/hooks/useQRScanner.ts b/mobile/src/common/hooks/useQRScanner.ts similarity index 100% rename from mobile/src/hooks/useQRScanner.ts rename to mobile/src/common/hooks/useQRScanner.ts diff --git a/mobile/src/hooks/useRotationEnabled.ts b/mobile/src/common/hooks/useRotationEnabled.ts similarity index 100% rename from mobile/src/hooks/useRotationEnabled.ts rename to mobile/src/common/hooks/useRotationEnabled.ts diff --git a/mobile/src/hooks/useScreenOrientation.ts b/mobile/src/common/hooks/useScreenOrientation.ts similarity index 100% rename from mobile/src/hooks/useScreenOrientation.ts rename to mobile/src/common/hooks/useScreenOrientation.ts diff --git a/mobile/src/screens/error_page/error_page.tsx b/mobile/src/common/screens/error_page.tsx similarity index 100% rename from mobile/src/screens/error_page/error_page.tsx rename to mobile/src/common/screens/error_page.tsx diff --git a/mobile/src/screens/scan/scan_page.tsx b/mobile/src/common/screens/scan_page.tsx similarity index 94% rename from mobile/src/screens/scan/scan_page.tsx rename to mobile/src/common/screens/scan_page.tsx index 0570d5223dc9e8fc3b449b2d86a2bcf3d039fe85..25c2c62739a34154cbaf8a7ef225a3fd10dd15b6 100644 --- a/mobile/src/screens/scan/scan_page.tsx +++ b/mobile/src/common/screens/scan_page.tsx @@ -1,9 +1,9 @@ import { View, Text, Button, StyleSheet, Animated } from "react-native"; -import { useQRScanner } from "../../hooks/useQRScanner"; +import { useQRScanner } from "../../common/hooks/useQRScanner"; import { CameraView } from "expo-camera/next"; import { BarCodeScanningResult } from "expo-camera"; import { useEffect, useRef } from "react"; -import { activityPointRouteValidator } from "../../utils/activity_route"; +import { activityPointRouteValidator } from "../../activity/utils/activity_route"; export default function ScanPage() { const { hasPermission, getPermission, scanning, onQRScanned, qrData } = diff --git a/mobile/src/screens/page_styles.tsx b/mobile/src/common/styles/page_styles.tsx similarity index 81% rename from mobile/src/screens/page_styles.tsx rename to mobile/src/common/styles/page_styles.tsx index 90ee7303d3a1182b211689525d8ace31ee41e308..6603f928b486138464e559587d734b9b24053607 100644 --- a/mobile/src/screens/page_styles.tsx +++ b/mobile/src/common/styles/page_styles.tsx @@ -1,5 +1,5 @@ import { StyleSheet } from "react-native" -import { LIGHT_THEME } from "../common/constants/theme"; +import { LIGHT_THEME } from "../constants/theme"; export const pageStyles = StyleSheet.create({ page_container: { diff --git a/mobile/src/utils/dev/delay_time.ts b/mobile/src/common/utils/delay_time.ts similarity index 100% rename from mobile/src/utils/dev/delay_time.ts rename to mobile/src/common/utils/delay_time.ts diff --git a/mobile/src/utils/time.ts b/mobile/src/common/utils/time.ts similarity index 100% rename from mobile/src/utils/time.ts rename to mobile/src/common/utils/time.ts diff --git a/mobile/src/domain/datasources/state_datasource.ts b/mobile/src/place/domain/datasources/state_datasource.ts similarity index 80% rename from mobile/src/domain/datasources/state_datasource.ts rename to mobile/src/place/domain/datasources/state_datasource.ts index 460a011056fd314a179eca60cadd029e82bc9639..99f1c97341e871e37913c8d561eb305452ed2102 100644 --- a/mobile/src/domain/datasources/state_datasource.ts +++ b/mobile/src/place/domain/datasources/state_datasource.ts @@ -1,4 +1,5 @@ -import { ActivityInfoEntity } from "../../activity/domain/entities/activity_info_entity"; + +import { ActivityInfoEntity } from "../../../activity/domain/entities/activity_info_entity"; import { StateEntity } from "../entities/state_entity"; import { TownEntity } from "../entities/town_entity"; diff --git a/mobile/src/domain/entities/place_info_entity.ts b/mobile/src/place/domain/entities/place_info_entity.ts similarity index 100% rename from mobile/src/domain/entities/place_info_entity.ts rename to mobile/src/place/domain/entities/place_info_entity.ts diff --git a/mobile/src/domain/entities/state_entity.ts b/mobile/src/place/domain/entities/state_entity.ts similarity index 99% rename from mobile/src/domain/entities/state_entity.ts rename to mobile/src/place/domain/entities/state_entity.ts index 50921456fb016293068bf3eaae2c0d7d7005682e..3a3032089408c57d12c14b46b4357e97863cc6a3 100644 --- a/mobile/src/domain/entities/state_entity.ts +++ b/mobile/src/place/domain/entities/state_entity.ts @@ -1,3 +1,4 @@ import { PlaceInfoEntity } from "./place_info_entity"; + export interface StateEntity extends PlaceInfoEntity{} \ No newline at end of file diff --git a/mobile/src/domain/entities/town_entity.ts b/mobile/src/place/domain/entities/town_entity.ts similarity index 100% rename from mobile/src/domain/entities/town_entity.ts rename to mobile/src/place/domain/entities/town_entity.ts diff --git a/mobile/src/domain/repositories/state_repository.ts b/mobile/src/place/domain/repositories/state_repository.ts similarity index 80% rename from mobile/src/domain/repositories/state_repository.ts rename to mobile/src/place/domain/repositories/state_repository.ts index 9c1450899f05e6cc62c777a4765f702de205f6e8..f6e9b14f41a7d311c188a0b3f8d81766a2cffcff 100644 --- a/mobile/src/domain/repositories/state_repository.ts +++ b/mobile/src/place/domain/repositories/state_repository.ts @@ -1,4 +1,4 @@ -import { ActivityInfoEntity } from "../entities/activity_info_entity"; +import { ActivityInfoEntity } from "../../../activity/domain/entities/activity_info_entity"; import { StateEntity } from "../entities/state_entity"; import { TownEntity } from "../entities/town_entity"; diff --git a/mobile/src/hooks/useGetStates.ts b/mobile/src/place/hooks/useGetStates.ts similarity index 75% rename from mobile/src/hooks/useGetStates.ts rename to mobile/src/place/hooks/useGetStates.ts index 6d8e9d9cdeea4830309ffebcdabd81c79568832a..bd84104a0dd83a42fd45f158b4e6a1b9e79ab3d4 100644 --- a/mobile/src/hooks/useGetStates.ts +++ b/mobile/src/place/hooks/useGetStates.ts @@ -1,6 +1,6 @@ -import { useDataContext } from "../common/contexts/data_context"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useGet } from "../../common/hooks/useGet"; import { StateEntity } from '../domain/entities/state_entity'; -import { useGet } from "./useGet" export const useGetStates = () => { const { statesRepository } = useDataContext(); diff --git a/mobile/src/hooks/useGetTowns.ts b/mobile/src/place/hooks/useGetTowns.ts similarity index 78% rename from mobile/src/hooks/useGetTowns.ts rename to mobile/src/place/hooks/useGetTowns.ts index ae7c22edabd30d667beb5a68ddde046beb36cf6a..d6b296d08851cd57698c830f97646037c7fc4301 100644 --- a/mobile/src/hooks/useGetTowns.ts +++ b/mobile/src/place/hooks/useGetTowns.ts @@ -1,7 +1,7 @@ -import { useDataContext } from "../common/contexts/data_context"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useGet } from "../../common/hooks/useGet"; import { StateEntity } from '../domain/entities/state_entity'; import { TownEntity } from "../domain/entities/town_entity"; -import { useGet } from "./useGet" export const useGetTowns = (stateId: number) => { const { statesRepository } = useDataContext(); diff --git a/mobile/src/infrastructure/datasource/dev/state_datasource.ts b/mobile/src/place/infrastructure/datasources/dev/state_datasource.ts similarity index 97% rename from mobile/src/infrastructure/datasource/dev/state_datasource.ts rename to mobile/src/place/infrastructure/datasources/dev/state_datasource.ts index 0fb31de13e4dc689d1b2d32e1279efb2dafd74d5..31c0f59004047589b4828de4c9e57248702320a0 100644 --- a/mobile/src/infrastructure/datasource/dev/state_datasource.ts +++ b/mobile/src/place/infrastructure/datasources/dev/state_datasource.ts @@ -1,5 +1,5 @@ +import { ActivityInfoEntity } from '../../../../activity/domain/entities/activity_info_entity'; import { StateDataSource } from '../../../domain/datasources/state_datasource'; -import { ActivityInfoEntity } from '../../../domain/entities/activity_info_entity'; import { StateEntity } from '../../../domain/entities/state_entity'; import { TownEntity } from '../../../domain/entities/town_entity'; diff --git a/mobile/src/infrastructure/datasource/prod/state_datasource.ts b/mobile/src/place/infrastructure/datasources/prod/state_datasource.ts similarity index 85% rename from mobile/src/infrastructure/datasource/prod/state_datasource.ts rename to mobile/src/place/infrastructure/datasources/prod/state_datasource.ts index 6f7380f4da59216321fc64fe92b9b23a2c08ad7a..aa0c8a4279b720b79e2e1d52cdda6f6425721bd9 100644 --- a/mobile/src/infrastructure/datasource/prod/state_datasource.ts +++ b/mobile/src/place/infrastructure/datasources/prod/state_datasource.ts @@ -2,14 +2,14 @@ import axios from "axios"; import { StateDataSource } from "../../../domain/datasources/state_datasource"; import { StateEntity } from "../../../domain/entities/state_entity"; import { TownEntity } from "../../../domain/entities/town_entity"; -import { API_URL } from "../../../common/constants/api"; -import { StateModel } from "../../models/prod/states_model"; +import { API_URL } from "../../../../common/constants/api"; +import { StateModel } from "../../models/states_model"; import { stateModelToEntity } from "../../utils/states_utils"; -import { TownModel } from "../../models/prod/town_model"; +import { TownModel } from "../../models/town_model"; import { townModelToEntity } from "../../utils/town_utils"; -import { ActivityModel } from "../../models/prod/activity_model"; import { placeModelToEntity } from "../../utils/place_utils"; -import { ActivityInfoEntity } from "../../../activity/domain/entities/activity_info_entity"; +import { ActivityInfoEntity } from "../../../../activity/domain/entities/activity_info_entity"; +import { ActivityModel } from "../../../../activity/infrastructure/models/activity_model"; export class StateDataSourceProd implements StateDataSource { private lang: string; diff --git a/mobile/src/infrastructure/models/prod/states_model.ts b/mobile/src/place/infrastructure/models/states_model.ts similarity index 100% rename from mobile/src/infrastructure/models/prod/states_model.ts rename to mobile/src/place/infrastructure/models/states_model.ts diff --git a/mobile/src/infrastructure/models/prod/town_model.ts b/mobile/src/place/infrastructure/models/town_model.ts similarity index 100% rename from mobile/src/infrastructure/models/prod/town_model.ts rename to mobile/src/place/infrastructure/models/town_model.ts diff --git a/mobile/src/infrastructure/repositories/state_repository.ts b/mobile/src/place/infrastructure/repositories/state_repository.ts similarity index 90% rename from mobile/src/infrastructure/repositories/state_repository.ts rename to mobile/src/place/infrastructure/repositories/state_repository.ts index 87ab8568b44b27e1338202d3a0977292e2cdf484..a58adcbfd7d72a8f9e42d695a9d7d8f1122653c9 100644 --- a/mobile/src/infrastructure/repositories/state_repository.ts +++ b/mobile/src/place/infrastructure/repositories/state_repository.ts @@ -1,5 +1,5 @@ +import { ActivityInfoEntity } from "../../../activity/domain/entities/activity_info_entity"; import { StateDataSource } from "../../domain/datasources/state_datasource"; -import { ActivityInfoEntity } from "../../domain/entities/activity_info_entity"; import { StateEntity } from "../../domain/entities/state_entity"; import { TownEntity } from "../../domain/entities/town_entity"; import { StateRepository } from "../../domain/repositories/state_repository"; diff --git a/mobile/src/infrastructure/utils/place_utils.ts b/mobile/src/place/infrastructure/utils/place_utils.ts similarity index 70% rename from mobile/src/infrastructure/utils/place_utils.ts rename to mobile/src/place/infrastructure/utils/place_utils.ts index d0937a3bccec62471452498556d67203651a16b9..51c7c336af31ccb2748877349abc6ed4e029d775 100644 --- a/mobile/src/infrastructure/utils/place_utils.ts +++ b/mobile/src/place/infrastructure/utils/place_utils.ts @@ -1,5 +1,5 @@ -import { ActivityInfoEntity } from "../../domain/entities/activity_info_entity"; -import { ActivityModel } from "../models/prod/activity_model"; +import { ActivityInfoEntity } from "../../../activity/domain/entities/activity_info_entity" +import { ActivityModel } from "../../../activity/infrastructure/models/activity_model" export const placeModelToEntity = (placeModel: ActivityModel): ActivityInfoEntity => { return { diff --git a/mobile/src/infrastructure/utils/states_utils.ts b/mobile/src/place/infrastructure/utils/states_utils.ts similarity index 70% rename from mobile/src/infrastructure/utils/states_utils.ts rename to mobile/src/place/infrastructure/utils/states_utils.ts index 2f9022a955ff1b990b23bbfd10e1e7a25d599471..9a7e82a75d570882ef05dc307766b6deedfaa30b 100644 --- a/mobile/src/infrastructure/utils/states_utils.ts +++ b/mobile/src/place/infrastructure/utils/states_utils.ts @@ -1,6 +1,6 @@ -import { API_URL } from "../../common/constants/api"; +import { API_URL } from "../../../common/constants/api"; import { StateEntity } from "../../domain/entities/state_entity"; -import { StateModel } from "../models/prod/states_model"; +import { StateModel } from "../models/states_model"; export const stateModelToEntity = (stateModel: StateModel): StateEntity => { return { diff --git a/mobile/src/infrastructure/utils/town_utils.ts b/mobile/src/place/infrastructure/utils/town_utils.ts similarity index 75% rename from mobile/src/infrastructure/utils/town_utils.ts rename to mobile/src/place/infrastructure/utils/town_utils.ts index a531744fc0936e1bd4551d4d09144463c8a72eff..aef32d8643cf01ee19643b1851c6c11d65fa4d92 100644 --- a/mobile/src/infrastructure/utils/town_utils.ts +++ b/mobile/src/place/infrastructure/utils/town_utils.ts @@ -1,6 +1,6 @@ -import { API_URL } from "../../common/constants/api"; +import { API_URL } from "../../../common/constants/api"; import { TownEntity } from "../../domain/entities/town_entity"; -import { TownModel } from "../models/prod/town_model"; +import { TownModel } from "../models/town_model"; export const townModelToEntity = (townModel: TownModel): TownEntity => { return { diff --git a/mobile/src/screens/state_selection/state_selection_page.tsx b/mobile/src/place/screens/state_selection_page.tsx similarity index 89% rename from mobile/src/screens/state_selection/state_selection_page.tsx rename to mobile/src/place/screens/state_selection_page.tsx index c46901e1061c92921716b1fd476c65cde50f3bb2..f7fffa71790d6019929849fb9c02047b3d7e9f56 100644 --- a/mobile/src/screens/state_selection/state_selection_page.tsx +++ b/mobile/src/place/screens/state_selection_page.tsx @@ -1,19 +1,19 @@ import { View, ActivityIndicator, Text } from "react-native"; -import { pageStyles } from "../page_styles"; -import { useGetStates } from "../../hooks/useGetStates"; +import { useGetStates } from "../hooks/useGetStates"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; import { Caroussel } from "../../common/components/caroussel/caroussel"; import { router } from "expo-router"; -import { useAnimatedSelectedIndex } from "../../hooks/useAnimatedSelectedIndex"; +import { useAnimatedSelectedIndex } from "../../common/hooks/useAnimatedSelectedIndex"; import { AnimatedBackground } from "../../common/components/animated_background"; -import { ErrorPage } from "../error_page/error_page"; +import { ErrorPage } from "../../common/screens/error_page"; import { LinearGradient } from "expo-linear-gradient"; import { LIGHT_THEME } from "../../common/constants/theme"; import { useDataContext } from "../../common/contexts/data_context"; import { useAuth } from "../../auth/contexts/auth_context"; import { CARROUSEL_HEIGHT, CARROUSEL_WIDTH } from "../../common/constants/caroussel"; +import { pageStyles } from "../../common/styles/page_styles"; export const StateSelectionPage = () => { const { data, requestStatus, refresh } = useGetStates(); diff --git a/mobile/src/screens/town_activities/town_activities_page.tsx b/mobile/src/place/screens/town_activities_page.tsx similarity index 96% rename from mobile/src/screens/town_activities/town_activities_page.tsx rename to mobile/src/place/screens/town_activities_page.tsx index f21fe1672dd730c8865b26a1d39c13a94f1d1b6b..dfce705fcd43add0fb09b0029b5ebf9f0e7b3a1f 100644 --- a/mobile/src/screens/town_activities/town_activities_page.tsx +++ b/mobile/src/place/screens/town_activities_page.tsx @@ -9,12 +9,12 @@ import { } from "react-native"; import { FullPageLoader } from "../../common/components/full_page_loader"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; -import { useGetActivities } from "../../hooks/useGetActivities"; import { ActivityTile } from "../../activity/components/activity_tile"; import { LIGHT_THEME } from "../../common/constants/theme"; import { router } from "expo-router"; import { FloatingEndActionButton } from "../../common/components/floating_end_action_button"; import { useState } from "react"; +import { useGetActivities } from "../../activity/hooks/useGetActivities"; interface TownActivitiesPageProps { townId: number; diff --git a/mobile/src/screens/town_selection/town_selection_page.tsx b/mobile/src/place/screens/town_selection_page.tsx similarity index 87% rename from mobile/src/screens/town_selection/town_selection_page.tsx rename to mobile/src/place/screens/town_selection_page.tsx index 09cc498de7a3ee484655cbdd0ccf0acd3f72ea07..ed479c9ab3052121a603fe2f824fc8dd37519aa8 100644 --- a/mobile/src/screens/town_selection/town_selection_page.tsx +++ b/mobile/src/place/screens/town_selection_page.tsx @@ -1,15 +1,15 @@ import { View, Text, ActivityIndicator, StyleSheet } from "react-native"; -import { pageStyles } from "../page_styles"; -import { useGetStates } from "../../hooks/useGetStates"; +import { useGetStates } from "../hooks/useGetStates"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; import { Caroussel } from "../../common/components/caroussel/caroussel"; -import { useGetTowns } from "../../hooks/useGetTowns"; +import { useGetTowns } from "../hooks/useGetTowns"; import { router } from "expo-router"; import { useCallback, useState } from "react"; -import { useAnimatedSelectedIndex } from "../../hooks/useAnimatedSelectedIndex"; +import { useAnimatedSelectedIndex } from "../../common/hooks/useAnimatedSelectedIndex"; import { AnimatedBackground } from "../../common/components/animated_background"; import BottomSheet, { BottomSheetView } from "@gorhom/bottom-sheet"; -import { ErrorPage } from "../error_page/error_page"; +import { ErrorPage } from "../../common/screens/error_page"; +import { pageStyles } from "../../common/styles/page_styles"; interface TownSelectionPageProps { stateId: number; diff --git a/mobile/src/profile/components/change_password_form.tsx b/mobile/src/profile/components/change_password_form.tsx index 2057ee0ea4709e73b09f56c5da6b67f752306f3c..31f6bf705a74674615d676f9f0baf8cb91f3d795 100644 --- a/mobile/src/profile/components/change_password_form.tsx +++ b/mobile/src/profile/components/change_password_form.tsx @@ -1,6 +1,5 @@ import { Control, Controller } from "react-hook-form"; import { View } from "react-native"; -import { EditProfileFormValues } from "../../hooks/useEditProfile"; import { CustomTextInput } from "../../common/components/form/text_input"; interface ChangePasswordFormProps { diff --git a/mobile/src/profile/components/multiple_option_pickeer.tsx b/mobile/src/profile/components/multiple_option_pickeer.tsx index 3383f8ff4635c500376980fa13a6c51386bd0da3..3cb124269985895c1e3b0496d9c146625a347928 100644 --- a/mobile/src/profile/components/multiple_option_pickeer.tsx +++ b/mobile/src/profile/components/multiple_option_pickeer.tsx @@ -1,4 +1,3 @@ -import { useState } from "react"; import { ScrollView, Text, TouchableOpacity, StyleSheet, View } from "react-native"; import { LIGHT_THEME } from "../../common/constants/theme"; import { IOption } from "../../common/domain/entities/option"; diff --git a/mobile/src/profile/hooks/useChangeInterests.ts b/mobile/src/profile/hooks/useChangeInterests.ts index cb1449f7cfa192347ecdc2bce63d5cc8c3f54ebf..e5ca584139a1466969349b6f704c56c5b7d39009 100644 --- a/mobile/src/profile/hooks/useChangeInterests.ts +++ b/mobile/src/profile/hooks/useChangeInterests.ts @@ -1,7 +1,5 @@ import { useEffect, useState } from "react"; -import { useGetInterests } from "./useGetInterests"; import { IOption } from "../../common/domain/entities/option"; -import { ApiRequestStatus } from "../../common/constants/api_request_states"; import { useDataContext } from "../../common/contexts/data_context"; diff --git a/mobile/src/hooks/useEditProfile.ts b/mobile/src/profile/hooks/useEditProfile.ts similarity index 96% rename from mobile/src/hooks/useEditProfile.ts rename to mobile/src/profile/hooks/useEditProfile.ts index 0efe1bbc570d51197dbe5e1d59abc4bc00a88816..b67a2bc5c47d49470f2e349a6390bf67bf64687a 100644 --- a/mobile/src/hooks/useEditProfile.ts +++ b/mobile/src/profile/hooks/useEditProfile.ts @@ -1,5 +1,5 @@ import { useState } from "react"; -import { set, useForm } from "react-hook-form"; +import { useForm } from "react-hook-form"; import * as ImagePicker from "expo-image-picker"; export type EditProfileFormValues = { diff --git a/mobile/src/profile/hooks/useGetInterests.ts b/mobile/src/profile/hooks/useGetInterests.ts index 4c1a885dfc84597988fad08347a5e3b186174bfe..b91a036aece07a49b7d7c0c37016fca5bfb4ab9e 100644 --- a/mobile/src/profile/hooks/useGetInterests.ts +++ b/mobile/src/profile/hooks/useGetInterests.ts @@ -1,5 +1,5 @@ import { useDataContext } from "../../common/contexts/data_context" -import { useGet } from "../../hooks/useGet"; +import { useGet } from "../../common/hooks/useGet"; export const useGetInterests = () => { const { profileRepository } = useDataContext(); diff --git a/mobile/src/profile/hooks/useGetUserInterests.ts b/mobile/src/profile/hooks/useGetUserInterests.ts index a14556c1acff6f3b1635389032299ca16a089afb..413038235ae3109d04b54663beb633af095d3c7d 100644 --- a/mobile/src/profile/hooks/useGetUserInterests.ts +++ b/mobile/src/profile/hooks/useGetUserInterests.ts @@ -1,6 +1,6 @@ import { useDataContext } from "../../common/contexts/data_context" import { IOption } from "../../common/domain/entities/option" -import { useGet } from "../../hooks/useGet" +import { useGet } from "../../common/hooks/useGet" export const useGetUserInterests = () => { const { profileRepository } = useDataContext() diff --git a/mobile/src/profile/hooks/useSetUpProfile.ts b/mobile/src/profile/hooks/useSetUpProfile.ts index bc04cd8a3c9f83941598d5807696d0194770c103..1e806dab4e72c5c4ba07faf024aa3765e335527a 100644 --- a/mobile/src/profile/hooks/useSetUpProfile.ts +++ b/mobile/src/profile/hooks/useSetUpProfile.ts @@ -1,9 +1,6 @@ -import { set, useForm } from "react-hook-form"; import { useGetInterests } from "./useGetInterests"; -import { IOption } from "../../common/domain/entities/option"; import { useEffect, useState } from "react"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; -import { useDataContext } from "../../common/contexts/data_context"; import { useSetUp } from "../../common/contexts/set_up_context"; import { router } from "expo-router"; import { useChangeInterests } from "./useChangeInterests"; diff --git a/mobile/src/screens/edit_profile/edit_profile_page.tsx b/mobile/src/profile/screens/edit_profile_page.tsx similarity index 97% rename from mobile/src/screens/edit_profile/edit_profile_page.tsx rename to mobile/src/profile/screens/edit_profile_page.tsx index 701b0e0d97c3d79a3cf2c7e7653b3f16a32e5a81..c4598b5697320372d05de1e5172bb0fc2ea07930 100644 --- a/mobile/src/screens/edit_profile/edit_profile_page.tsx +++ b/mobile/src/profile/screens/edit_profile_page.tsx @@ -1,5 +1,5 @@ import { View, Text, StyleSheet } from "react-native"; -import { useEditProfile } from "../../hooks/useEditProfile"; +import { useEditProfile } from "../../profile/hooks/useEditProfile"; import { Controller } from "react-hook-form"; import { useAuth } from "../../auth/contexts/auth_context"; import { CustomTextInput } from "../../common/components/form/text_input"; diff --git a/mobile/src/domain/datasources/route_datasource.ts b/mobile/src/route/domain/datasource/route_datasource.ts similarity index 65% rename from mobile/src/domain/datasources/route_datasource.ts rename to mobile/src/route/domain/datasource/route_datasource.ts index 38fcd2aa6cea7032c8e69c125dc01678d8177ff8..e897c74018387eea8c85dbf736e2471b539cc73c 100644 --- a/mobile/src/domain/datasources/route_datasource.ts +++ b/mobile/src/route/domain/datasource/route_datasource.ts @@ -1,4 +1,4 @@ -import { ActivityRouteEntity } from "../../activity/domain/entities/activity_info_entity"; +import { ActivityRouteEntity } from "../../../activity/domain/entities/activity_info_entity"; export interface RouteDataSource { diff --git a/mobile/src/domain/repositories/route_repository.ts b/mobile/src/route/domain/repositories/route_repository.ts similarity index 65% rename from mobile/src/domain/repositories/route_repository.ts rename to mobile/src/route/domain/repositories/route_repository.ts index f2667ab37ee70d41b6621852de87b75d38409f04..b655d59be369803b48f781b8548f6b0d5ca7bb73 100644 --- a/mobile/src/domain/repositories/route_repository.ts +++ b/mobile/src/route/domain/repositories/route_repository.ts @@ -1,4 +1,4 @@ -import { ActivityRouteEntity } from "../entities/activity_info_entity"; +import { ActivityRouteEntity } from "../../../activity/domain/entities/activity_info_entity"; export interface RouteRepository { generateRoute: (townId: number) => Promise; diff --git a/mobile/src/hooks/useGenerateRoute.ts b/mobile/src/route/hooks/useGenerateRoute.ts similarity index 61% rename from mobile/src/hooks/useGenerateRoute.ts rename to mobile/src/route/hooks/useGenerateRoute.ts index 0694c2aa5b4fddd08d540053f090c56c1ae6c94b..a685b5127dec6f8d8e6d63a981bcca87eac9b967 100644 --- a/mobile/src/hooks/useGenerateRoute.ts +++ b/mobile/src/route/hooks/useGenerateRoute.ts @@ -1,6 +1,6 @@ -import { ActivityRouteEntity } from "../activity/domain/entities/activity_info_entity"; -import { useDataContext } from "../common/contexts/data_context"; -import { useGet } from "./useGet"; +import { ActivityRouteEntity } from "../../activity/domain/entities/activity_info_entity"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useGet } from "../../common/hooks/useGet"; export const useGenerateRoute = (townId: number) => { const { routeRepository } = useDataContext(); diff --git a/mobile/src/route/hooks/useGetRouteActivities.ts b/mobile/src/route/hooks/useGetRouteActivities.ts index e1ed69fd3b4ec7919dc620a1260b146cd70f4737..0e9063f9369c303addff35661c5724f1e5fba29e 100644 --- a/mobile/src/route/hooks/useGetRouteActivities.ts +++ b/mobile/src/route/hooks/useGetRouteActivities.ts @@ -1,6 +1,7 @@ +import { ActivityRouteEntity } from "../../activity/domain/entities/activity_info_entity"; import { useDataContext } from "../../common/contexts/data_context" -import { ActivityRouteEntity } from "../../domain/entities/activity_info_entity"; -import { useGet } from "../../hooks/useGet"; +import { useGet } from "../../common/hooks/useGet"; + export const useGetRouteActivities = (routeId: number) => { const { routeRepository } = useDataContext(); diff --git a/mobile/src/infrastructure/datasource/dev/route_datasource.ts b/mobile/src/route/infrastructure/datasources/dev/route_datasource.ts similarity index 94% rename from mobile/src/infrastructure/datasource/dev/route_datasource.ts rename to mobile/src/route/infrastructure/datasources/dev/route_datasource.ts index 8f04ae0cb258a87f387e19075aba5e931bccdaba..13d0bb052df9d1088b8c6f243d54f669fab715ab 100644 --- a/mobile/src/infrastructure/datasource/dev/route_datasource.ts +++ b/mobile/src/route/infrastructure/datasources/dev/route_datasource.ts @@ -1,5 +1,5 @@ -import { RouteDataSource } from "../../../domain/datasources/route_datasource"; -import { ActivityInfoEntity, ActivityRouteEntity } from "../../../domain/entities/activity_info_entity"; +import { ActivityInfoEntity, ActivityRouteEntity } from "../../../../activity/domain/entities/activity_info_entity"; +import { RouteDataSource } from "../../../domain/datasource/route_datasource"; export class RouteDataSourceDev implements RouteDataSource { async generateRoute(townId: number): Promise { diff --git a/mobile/src/infrastructure/datasource/prod/route_datasource.ts b/mobile/src/route/infrastructure/datasources/prod/route_datasource.ts similarity index 74% rename from mobile/src/infrastructure/datasource/prod/route_datasource.ts rename to mobile/src/route/infrastructure/datasources/prod/route_datasource.ts index fa9735d049f466f6e2f980cfbdec9bc0ab8dc14f..84674dcdf7da61a3f1e624e8b7071ce0f0e2105a 100644 --- a/mobile/src/infrastructure/datasource/prod/route_datasource.ts +++ b/mobile/src/route/infrastructure/datasources/prod/route_datasource.ts @@ -1,9 +1,9 @@ import axios from "axios"; -import { ActivityRouteEntity } from "../../../activity/domain/entities/activity_info_entity"; -import { RouteDataSource } from "../../../domain/datasources/route_datasource"; -import { API_URL } from "../../../common/constants/api"; -import { ActivityRouteModel } from "../../models/prod/route_activity_model"; +import { ActivityRouteEntity } from "../../../../activity/domain/entities/activity_info_entity"; +import { API_URL } from "../../../../common/constants/api"; import { activityRouteModelToActivityRouteEntity } from "../../utils/route_utils"; +import { RouteDataSource } from "../../../domain/datasource/route_datasource"; +import { ActivityRouteModel } from "../../model/route_activity_model"; export class RouteDatasourceProd implements RouteDataSource { private readonly language: string; diff --git a/mobile/src/infrastructure/models/prod/route_activity_model.ts b/mobile/src/route/infrastructure/model/route_activity_model.ts similarity index 78% rename from mobile/src/infrastructure/models/prod/route_activity_model.ts rename to mobile/src/route/infrastructure/model/route_activity_model.ts index 6a35ae0947e485ab1c39b0a2acd5c37a019580e2..1fefea9fe46fd6bafc8c3f6cce94a1bfce0db524 100644 --- a/mobile/src/infrastructure/models/prod/route_activity_model.ts +++ b/mobile/src/route/infrastructure/model/route_activity_model.ts @@ -1,4 +1,4 @@ -import { TagModel } from "./tag_model"; +import { TagModel } from "../../../activity/infrastructure/models/tag_model"; export interface ActivityRouteModel { address: string; diff --git a/mobile/src/infrastructure/repositories/route_repository.ts b/mobile/src/route/infrastructure/repositories/route_repository.ts similarity index 84% rename from mobile/src/infrastructure/repositories/route_repository.ts rename to mobile/src/route/infrastructure/repositories/route_repository.ts index b6b33140cd70e386c2470283e901cd3949ac1959..dea92db56bafd4df232afb51d3a5bfd73edce1cc 100644 --- a/mobile/src/infrastructure/repositories/route_repository.ts +++ b/mobile/src/route/infrastructure/repositories/route_repository.ts @@ -1,4 +1,4 @@ -import { RouteDataSource } from "../../domain/datasources/route_datasource"; +import { RouteDataSource } from "../../domain/datasource/route_datasource"; import { RouteRepository } from "../../domain/repositories/route_repository"; export class RouteRepositoryImpl implements RouteRepository { diff --git a/mobile/src/infrastructure/utils/route_utils.ts b/mobile/src/route/infrastructure/utils/route_utils.ts similarity index 83% rename from mobile/src/infrastructure/utils/route_utils.ts rename to mobile/src/route/infrastructure/utils/route_utils.ts index 6daa75f946971408d5113e89fcdada35f8b7d55e..2cf8d14a03b64250a5b67da535d0739646db14d5 100644 --- a/mobile/src/infrastructure/utils/route_utils.ts +++ b/mobile/src/route/infrastructure/utils/route_utils.ts @@ -1,5 +1,5 @@ -import { ActivityRouteEntity } from "../../activity/domain/entities/activity_info_entity"; -import { ActivityRouteModel } from "../models/prod/route_activity_model"; +import { ActivityRouteEntity } from "../../../activity/domain/entities/activity_info_entity"; +import { ActivityRouteModel } from "../model/route_activity_model"; export const activityRouteModelToActivityRouteEntity = (activity: ActivityRouteModel): ActivityRouteEntity => { const startTime = new Date(activity.openAt); diff --git a/mobile/src/route/screens/maps.tsx b/mobile/src/route/screens/maps.tsx index 8ba63e59f9c5cab1f12ead9447ec132231eeb1ab..17a4deb0a1f987ab0b01a248853330fd615915ab 100644 --- a/mobile/src/route/screens/maps.tsx +++ b/mobile/src/route/screens/maps.tsx @@ -2,11 +2,11 @@ import MapView from "react-native-maps"; import { View } from "react-native"; import { router, useFocusEffect } from "expo-router"; import { CustomMapMarker } from "../components/maps/custom_map_marker"; -import { ActivityRouteEntity } from "../../domain/entities/activity_info_entity"; import { useGetRouteActivities } from "../hooks/useGetRouteActivities"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; import { FullPageLoader } from "../../common/components/full_page_loader"; import { useRef } from "react"; +import { ActivityRouteEntity } from "../../activity/domain/entities/activity_info_entity"; interface MapsPageProps { routeId: number; diff --git a/mobile/src/route/screens/route_preview.tsx b/mobile/src/route/screens/route_preview.tsx index 4c60d99749dae18dd4b3a757218b3084bde4801a..4596020dc6ca29782094442b22038bde0cf6a020 100644 --- a/mobile/src/route/screens/route_preview.tsx +++ b/mobile/src/route/screens/route_preview.tsx @@ -1,5 +1,5 @@ import { View, StyleSheet, Text, FlatList } from "react-native"; -import { useGenerateRoute } from "../../hooks/useGenerateRoute"; +import { useGenerateRoute } from "../hooks/useGenerateRoute"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; import { FullPageLoader } from "../../common/components/full_page_loader"; import { RouteActivityTile } from "../components/route_activity_tile"; diff --git a/mobile/src/travel_history/components/activity_list.tsx b/mobile/src/travel/components/activity_list.tsx similarity index 96% rename from mobile/src/travel_history/components/activity_list.tsx rename to mobile/src/travel/components/activity_list.tsx index 5e1849c2747455d2d02fe32bd2880a9e01e448a6..466c7b028b6e9ffcde442462b3734743129fe6c4 100644 --- a/mobile/src/travel_history/components/activity_list.tsx +++ b/mobile/src/travel/components/activity_list.tsx @@ -7,8 +7,8 @@ import { Animated, StyleSheet, } from "react-native"; -import { TravelHistoryActivity } from "../../domain/entities/travel_details"; import { TravelDetailsTile } from "./travel_details_tile"; +import { TravelHistoryActivity } from "../domain/entities/travel_details"; const HORIZONTAL_SPACING = 20; const VERTICAL_SPACING = 10; diff --git a/mobile/src/travel_history/components/share_button.tsx b/mobile/src/travel/components/share_button.tsx similarity index 100% rename from mobile/src/travel_history/components/share_button.tsx rename to mobile/src/travel/components/share_button.tsx diff --git a/mobile/src/travel_history/components/travel_details_tile.tsx b/mobile/src/travel/components/travel_details_tile.tsx similarity index 95% rename from mobile/src/travel_history/components/travel_details_tile.tsx rename to mobile/src/travel/components/travel_details_tile.tsx index 3e9e07f123766ac3c2c0ee7f1f4df9f59a4deb81..309f02704faaae9b6d7867f23edc2a50c84a6563 100644 --- a/mobile/src/travel_history/components/travel_details_tile.tsx +++ b/mobile/src/travel/components/travel_details_tile.tsx @@ -1,6 +1,6 @@ import { Animated, Image, View, Text, StyleSheet } from "react-native"; -import { TravelHistoryActivity } from "../../domain/entities/travel_details"; import { AntDesign } from "@expo/vector-icons"; +import { TravelHistoryActivity } from "../domain/entities/travel_details"; interface TravelDetailsTileProps { item: TravelHistoryActivity; diff --git a/mobile/src/domain/datasources/travel_datasource.ts b/mobile/src/travel/domain/datasources/travel_datasource.ts similarity index 76% rename from mobile/src/domain/datasources/travel_datasource.ts rename to mobile/src/travel/domain/datasources/travel_datasource.ts index a5b2697ac8a0a3d3ffc8ad0541e7d80a09ee41f3..4d46e6cda4bf7bc8cbf0cb39eb89046cd61dd4f7 100644 --- a/mobile/src/domain/datasources/travel_datasource.ts +++ b/mobile/src/travel/domain/datasources/travel_datasource.ts @@ -1,4 +1,4 @@ -import { TravelDetails } from "../entities/travel_details"; +import { TravelDetails, } from "../entities/travel_details"; import { TravelHistory } from "../entities/travel_history"; export interface TravelDataSource { diff --git a/mobile/src/domain/entities/travel_details.ts b/mobile/src/travel/domain/entities/travel_details.ts similarity index 76% rename from mobile/src/domain/entities/travel_details.ts rename to mobile/src/travel/domain/entities/travel_details.ts index fd4bdcb64a332c0ff8c5bf4711954b8494445459..6ab94783716cef9edb154911b8f67a8007791c40 100644 --- a/mobile/src/domain/entities/travel_details.ts +++ b/mobile/src/travel/domain/entities/travel_details.ts @@ -1,4 +1,4 @@ -import { PlaceInfoEntity } from "./place_info_entity"; +import { PlaceInfoEntity } from "../../../place/domain/entities/place_info_entity"; import { Route } from "./travel_history"; export interface TravelDetails { diff --git a/mobile/src/domain/entities/travel_history.ts b/mobile/src/travel/domain/entities/travel_history.ts similarity index 100% rename from mobile/src/domain/entities/travel_history.ts rename to mobile/src/travel/domain/entities/travel_history.ts diff --git a/mobile/src/domain/repositories/travel_repository.ts b/mobile/src/travel/domain/repositories/travel_repository.ts similarity index 100% rename from mobile/src/domain/repositories/travel_repository.ts rename to mobile/src/travel/domain/repositories/travel_repository.ts diff --git a/mobile/src/hooks/useGetTravelDetails.ts b/mobile/src/travel/hooks/useGetTravelDetails.ts similarity index 79% rename from mobile/src/hooks/useGetTravelDetails.ts rename to mobile/src/travel/hooks/useGetTravelDetails.ts index ed3d2cbfc9ba2dd176f53614ba7816dea7bf3ae6..4987c8dbffd51c7b51bf1586d5fd159789bb4ef0 100644 --- a/mobile/src/hooks/useGetTravelDetails.ts +++ b/mobile/src/travel/hooks/useGetTravelDetails.ts @@ -1,6 +1,6 @@ -import { useDataContext } from "../common/contexts/data_context"; +import { useDataContext } from "../../common/contexts/data_context"; +import { useGet } from "../../common/hooks/useGet"; import { TravelDetails } from "../domain/entities/travel_details"; -import { useGet } from "./useGet"; interface GetTravelDetailsProps { id: number; diff --git a/mobile/src/hooks/useGetTravelHistory.ts b/mobile/src/travel/hooks/useGetTravelHistory.ts similarity index 92% rename from mobile/src/hooks/useGetTravelHistory.ts rename to mobile/src/travel/hooks/useGetTravelHistory.ts index 69f63e4a019e4e03d454f564f1e630ef29b99bad..5ea050445fcef220c1e45c397e9ad1459872ce60 100644 --- a/mobile/src/hooks/useGetTravelHistory.ts +++ b/mobile/src/travel/hooks/useGetTravelHistory.ts @@ -1,8 +1,9 @@ import { useEffect, useState } from "react"; -import { useDataContext } from "../common/contexts/data_context" +import { useDataContext } from "../../common/contexts/data_context" import { Route, TravelHistory } from "../domain/entities/travel_history"; -import { useGet } from "./useGet"; + import { useTranslation } from "react-i18next"; +import { useGet } from "../../common/hooks/useGet"; export enum TravelHistorySection { ACTIVE = "Active Travels", PAST = "Past Travels", diff --git a/mobile/src/infrastructure/datasource/dev/travel_datasource.ts b/mobile/src/travel/infrastructure/datasources/dev/travel_datasource.ts similarity index 100% rename from mobile/src/infrastructure/datasource/dev/travel_datasource.ts rename to mobile/src/travel/infrastructure/datasources/dev/travel_datasource.ts diff --git a/mobile/src/infrastructure/repositories/travel_repository.ts b/mobile/src/travel/infrastructure/repositories/travel_repository.ts similarity index 100% rename from mobile/src/infrastructure/repositories/travel_repository.ts rename to mobile/src/travel/infrastructure/repositories/travel_repository.ts diff --git a/mobile/src/screens/travel_details/travel_details_page.tsx b/mobile/src/travel/screens/travel_details_page.tsx similarity index 92% rename from mobile/src/screens/travel_details/travel_details_page.tsx rename to mobile/src/travel/screens/travel_details_page.tsx index f09afa1bdd9130c34dd9840443bc12eab8d31296..67dfea9396901b2abea504e08b0354388b7eafe9 100644 --- a/mobile/src/screens/travel_details/travel_details_page.tsx +++ b/mobile/src/travel/screens/travel_details_page.tsx @@ -5,10 +5,10 @@ import { Image, Dimensions, } from "react-native"; -import { useGetTravelDetails } from "../../hooks/useGetTravelDetails"; +import { useGetTravelDetails } from "../../travel/hooks/useGetTravelDetails"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; import { FullPageLoader } from "../../common/components/full_page_loader"; -import { TravelActivityList } from "../../travel_history/components/activity_list"; +import { TravelActivityList } from "../../travel/components/activity_list"; interface TravelDetailsPageProps { id: number; diff --git a/mobile/src/screens/travel_history/travel_history_page.tsx b/mobile/src/travel/screens/travel_history_page.tsx similarity index 98% rename from mobile/src/screens/travel_history/travel_history_page.tsx rename to mobile/src/travel/screens/travel_history_page.tsx index 5dd1d2a6b484a93090c918ca01c609401644dd1e..eaf43b1a802a7d85a7abb3720f7d97f4751d9248 100644 --- a/mobile/src/screens/travel_history/travel_history_page.tsx +++ b/mobile/src/travel/screens/travel_history_page.tsx @@ -2,7 +2,7 @@ import { View, Text, FlatList, StyleSheet, SectionList } from "react-native"; import { TravelHistorySection, useGetTravelHistory, -} from "../../hooks/useGetTravelHistory"; +} from "../../travel/hooks/useGetTravelHistory"; import { ApiRequestStatus } from "../../common/constants/api_request_states"; import { FullPageLoader } from "../../common/components/full_page_loader"; import { CustomTileButton } from "../../common/components/custom_tile_button";