Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"i18n-ally.localesPaths": [
"src/i18n",
"ios/Pods/RCT-Folly/folly/lang",
"ios/Pods/boost/boost/predef/language",
"ios/Pods/Headers/Private/RCT-Folly/folly/lang",
"ios/Pods/Headers/Public/RCT-Folly/folly/lang"
]
}
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

<application
Expand Down
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ newArchEnabled=true
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

VisionCamera_enableCodeScanner=true
12 changes: 12 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"name": "Xanyah",
"dependencies": {
"@hookform/resolvers": "^5.0.1",
"@react-native-community/hooks": "^100.1.0",
"@react-navigation/bottom-tabs": "^7.3.10",
"@react-navigation/native": "^7.1.6",
"@react-navigation/native-stack": "^7.3.10",
Expand All @@ -15,6 +16,7 @@
"lodash": "^4.17.21",
"lucide-react-native": "^0.503.0",
"luxon": "^3.6.1",
"object-to-formdata": "^4.5.1",
"react": "19.0.0",
"react-hook-form": "^7.56.1",
"react-i18next": "^15.5.1",
Expand All @@ -24,7 +26,9 @@
"react-native-safe-area-context": "^5.4.0",
"react-native-screens": "^4.10.0",
"react-native-svg": "^15.11.2",
"react-native-vision-camera": "^4.6.4",
"styled-components": "^6.1.17",
"uuid": "^11.1.0",
"zod": "^3.24.3",
"zod-i18n-map": "^2.27.0",
},
Expand Down Expand Up @@ -401,6 +405,8 @@

"@react-native-community/cli-types": ["@react-native-community/cli-types@18.0.0", "", { "dependencies": { "joi": "^17.2.1" } }, "sha512-J84+4IRXl8WlVdoe1maTD5skYZZO9CbQ6LNXEHx1kaZcFmvPZKfjsaxuyQ+8BsSqZnM2izOw8dEWnAp/Zuwb0w=="],

"@react-native-community/hooks": ["@react-native-community/hooks@100.1.0", "", { "peerDependencies": { "react": ">=18.0.0", "react-native": ">=0.70" } }, "sha512-aXESGr6WcnwyeIl+SiCLNFpbApzTmupyYzm2OkGjMuwHr42+a3G65xxTxN/xHuNdTVWO0dXbOwyLgEkQ0i/qZg=="],

"@react-native/assets-registry": ["@react-native/assets-registry@0.79.1", "", {}, "sha512-q5BwZtL0YbaJRgofl8qrD9BNdGJkecTJNYG8VFOVQYXPTBa3ZSooip1aj0wrjoa0HloKx/Hmx5UMvuhfEsjn8A=="],

"@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.79.1", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@react-native/codegen": "0.79.1" } }, "sha512-y3VyrPO/ej8Uhjk2IM+vBZok8cEyMl3DwJ3o/tsgiIVROITL+MWdk6M6iQOHRvwRWAgLe5jLSR3Zv5IIdDVY4A=="],
Expand Down Expand Up @@ -1277,6 +1283,8 @@

"object-keys": ["object-keys@1.1.1", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="],

"object-to-formdata": ["object-to-formdata@4.5.1", "", {}, "sha512-QiM9D0NiU5jV6J6tjE1g7b4Z2tcUnKs1OPUi4iMb2zH+7jwlcUrASghgkFk9GtzqNNq8rTQJtT8AzjBAvLoNMw=="],

"object.assign": ["object.assign@4.1.7", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="],

"object.entries": ["object.entries@1.1.9", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-object-atoms": "^1.1.1" } }, "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw=="],
Expand Down Expand Up @@ -1393,6 +1401,8 @@

"react-native-svg": ["react-native-svg@15.11.2", "", { "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3", "warn-once": "0.1.1" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-+YfF72IbWQUKzCIydlijV1fLuBsQNGMT6Da2kFlo1sh+LE3BIm/2Q7AR1zAAR6L0BFLi1WaQPLfFUC9bNZpOmw=="],

"react-native-vision-camera": ["react-native-vision-camera@4.6.4", "", { "peerDependencies": { "@shopify/react-native-skia": "*", "react": "*", "react-native": "*", "react-native-reanimated": "*", "react-native-worklets-core": "*" }, "optionalPeers": ["@shopify/react-native-skia", "react-native-reanimated", "react-native-worklets-core"] }, "sha512-d998uTHsGJ9bTlsClgT37RK1sK7ZQekv5y6ylynds3vmdK6YbFQJUoi2cvMrFN4dp9qvSlCjEfwekjMIz3guQA=="],

"react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="],

"react-test-renderer": ["react-test-renderer@19.0.0", "", { "dependencies": { "react-is": "^19.0.0", "scheduler": "^0.25.0" }, "peerDependencies": { "react": "^19.0.0" } }, "sha512-oX5u9rOQlHzqrE/64CNr0HB0uWxkCQmZNSfozlYvwE71TLVgeZxVf0IjouGEr1v7r1kcDifdAJBeOhdhxsG/DA=="],
Expand Down Expand Up @@ -1615,6 +1625,8 @@

"utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],

"uuid": ["uuid@11.1.0", "", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="],

"v8-to-istanbul": ["v8-to-istanbul@9.3.0", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", "convert-source-map": "^2.0.0" } }, "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA=="],

"vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
Expand Down
Binary file removed bun.lockb
Binary file not shown.
10 changes: 10 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,12 @@ PODS:
- ReactCommon/turbomodule/core
- Yoga
- SocketRocket (0.7.1)
- VisionCamera (4.6.4):
- VisionCamera/Core (= 4.6.4)
- VisionCamera/React (= 4.6.4)
- VisionCamera/Core (4.6.4)
- VisionCamera/React (4.6.4):
- React-Core
- Yoga (0.0.0)

DEPENDENCIES:
Expand Down Expand Up @@ -1934,6 +1940,7 @@ DEPENDENCIES:
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNSVG (from `../node_modules/react-native-svg`)
- VisionCamera (from `../node_modules/react-native-vision-camera`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
Expand Down Expand Up @@ -2088,6 +2095,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-screens"
RNSVG:
:path: "../node_modules/react-native-svg"
VisionCamera:
:path: "../node_modules/react-native-vision-camera"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

Expand Down Expand Up @@ -2166,6 +2175,7 @@ SPEC CHECKSUMS:
RNScreens: 5621e3ad5a329fbd16de683344ac5af4192b40d3
RNSVG: 794f269526df9ddc1f79b3d1a202b619df0368e3
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
VisionCamera: f56eaedde0d3fa095143b78374d29e89e71735f9
Yoga: d15f5aa644c466e917569ac43b19cbf17975239a

PODFILE CHECKSUM: 9e38bfd28ce2559db030c097e143886dc989e19c
Expand Down
6 changes: 4 additions & 2 deletions ios/Xanyah.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 4XJW77H24F;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Xanyah/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
Expand All @@ -273,7 +274,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = io.xanyah.ios;
PRODUCT_NAME = Xanyah;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -288,6 +289,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 4XJW77H24F;
INFOPLIST_FILE = Xanyah/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -300,7 +302,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = io.xanyah.ios;
PRODUCT_NAME = Xanyah;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
3 changes: 2 additions & 1 deletion ios/Xanyah/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Camera.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"postinstall": "(cd ios; bundle exec pod install)",
"test": "jest"
},
"dependencies": {
"@hookform/resolvers": "^5.0.1",
"@react-native-community/hooks": "^100.1.0",
"@react-navigation/bottom-tabs": "^7.3.10",
"@react-navigation/native": "^7.1.6",
"@react-navigation/native-stack": "^7.3.10",
Expand All @@ -21,6 +23,7 @@
"lodash": "^4.17.21",
"lucide-react-native": "^0.503.0",
"luxon": "^3.6.1",
"object-to-formdata": "^4.5.1",
"react": "19.0.0",
"react-hook-form": "^7.56.1",
"react-i18next": "^15.5.1",
Expand All @@ -30,7 +33,9 @@
"react-native-safe-area-context": "^5.4.0",
"react-native-screens": "^4.10.0",
"react-native-svg": "^15.11.2",
"react-native-vision-camera": "^4.6.4",
"styled-components": "^6.1.17",
"uuid": "^11.1.0",
"zod": "^3.24.3",
"zod-i18n-map": "^2.27.0"
},
Expand Down Expand Up @@ -63,4 +68,4 @@
"patchedDependencies": {
"styled-components@6.1.17": "patches/styled-components@6.1.17.patch"
}
}
}
14 changes: 14 additions & 0 deletions src/api/categories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { decamelizeKeys } from 'humps'
import { apiClient } from '../constants/api-client'

export const getCategories = params =>
apiClient.get<Category[]>('v2/categories', decamelizeKeys({ params }))

export const getCategory = categoryId =>
apiClient.get<Category>(`v2/categories/${categoryId}`)

export const updateCategory = (categoryId, params) =>
apiClient.patch<Category>(`v2/categories/${categoryId}`, decamelizeKeys(params))

export const createCategory = newCategory =>
apiClient.post<Category>('v2/categories', decamelizeKeys(newCategory))
8 changes: 8 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export * from './auth'
export * from './categories'
export * from './manufacturers'
export * from './products'
export * from './providers'
export * from './shippings'
export * from './stores'
export * from './vat-rates'
14 changes: 14 additions & 0 deletions src/api/manufacturers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { decamelizeKeys } from 'humps'
import { apiClient } from '../constants/api-client'

export const getManufacturers = params =>
apiClient.get<Manufacturer[]>('v2/manufacturers', decamelizeKeys({ params }))

export const getManufacturer = manufacturerId =>
apiClient.get<Manufacturer>(`v2/manufacturers/${manufacturerId}`)

export const updateManufacturer = (manufacturerId, params) =>
apiClient.patch<Manufacturer>(`v2/manufacturers/${manufacturerId}`, decamelizeKeys(params))

export const createManufacturer = newManufacturer =>
apiClient.post<Manufacturer>('v2/manufacturers', decamelizeKeys(newManufacturer))
25 changes: 25 additions & 0 deletions src/api/products.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { decamelizeKeys } from 'humps'
import { apiClient } from '../constants/api-client'

export const getProducts = (params: any) =>
apiClient.get<Product[]>('v2/products', decamelizeKeys({ params }))

export const getNextProductSku = (params: any) =>
apiClient.get<{ nextSku: number }>('v2/products/next_sku', decamelizeKeys({ params }))

export const getProduct = (productId: any) =>
apiClient.get<Product>(`v2/products/${productId}`)

export const updateProduct = (productId: any, params: any) =>
apiClient.patch<Product>(`v2/products/${productId}`, params, {
headers: {
'Content-Type': 'multipart/form-data',
},
})

export const createProduct = (newProduct: any) =>
apiClient.post<Product>(`v2/products`, newProduct, {
headers: {
'Content-Type': 'multipart/form-data',
},
})
18 changes: 18 additions & 0 deletions src/api/providers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { decamelizeKeys } from 'humps'
import { apiClient } from '../constants/api-client'

export const getProviders = params =>
apiClient.get<Provider[]>('v2/providers', decamelizeKeys({ params }))

export const getProvider = providerId =>
apiClient.get<Provider>(`v2/providers/${providerId}`)

export const updateProvider = (providerId, params) =>
apiClient.patch<Provider>(`v2/providers/${providerId}`, decamelizeKeys(params))

export const createProvider = newProvider =>
apiClient.post<Provider>('v2/providers', decamelizeKeys(newProvider))

/** @deprecated */
export const searchProvider = params =>
apiClient.get('providers/search', decamelizeKeys({ params }))
44 changes: 22 additions & 22 deletions src/api/shippings.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import {decamelizeKeys} from 'humps';
import {apiClient} from '../constants/api-client';
import { decamelizeKeys } from 'humps'
import { apiClient } from '../constants/api-client'

export const getShippings = params =>
apiClient.get<Shipping[]>('v2/shippings', decamelizeKeys({params}));
apiClient.get<Shipping[]>('v2/shippings', decamelizeKeys({ params }))

export const getShipping = (shippingId: string) =>
apiClient.get<Shipping>(`v2/shippings/${shippingId}`);
export const getShipping = shippingId =>
apiClient.get<Shipping>(`v2/shippings/${shippingId}`)

export const updateShipping = (shippingId: string, params) =>
apiClient.patch<Shipping>(
`v2/shippings/${shippingId}`,
decamelizeKeys(params),
);
export const updateShipping = (shippingId, params) =>
apiClient.patch<Shipping>(`v2/shippings/${shippingId}`, decamelizeKeys(params))

export const validateShipping = (shippingId: string) =>
apiClient.patch<Shipping>(`v2/shippings/${shippingId}/validate`);
export const validateShipping = shippingId =>
apiClient.patch<Shipping>(`v2/shippings/${shippingId}/validate`)

export const cancelShipping = (shippingId: string) =>
apiClient.patch<Shipping>(`v2/shippings/${shippingId}/cancel`);
export const cancelShipping = shippingId =>
apiClient.patch<Shipping>(`v2/shippings/${shippingId}/cancel`)

export const createShipping = (newShipping: string) =>
apiClient.post<Shipping>('v2/shippings', decamelizeKeys(newShipping));
export const createShipping = newShipping =>
apiClient.post<Shipping>('v2/shippings', decamelizeKeys(newShipping))

export const getShippingProducts = params =>
apiClient.get<ShippingProduct[]>(
'v2/shipping_products',
decamelizeKeys({params}),
);
apiClient.get<ShippingProduct[]>('v2/shipping_products', decamelizeKeys({ params }))

export const getShippingProduct = (id: string) =>
apiClient.get<ShippingProduct>(`v2/shipping_products/${id}`);
export const getShippingProduct = id =>
apiClient.get<ShippingProduct>(`v2/shipping_products/${id}`)

export const createShippingProduct = (params: { shippingId: Shipping['id'], productId: Product['id'], quantity: number }) =>
apiClient.post<ShippingProduct>('v2/shipping_products', decamelizeKeys(params));

export const updateShippingProduct = (id: string, params: { quantity: number }) =>
apiClient.patch<ShippingProduct>(`v2/shipping_products/${id}`, params);
11 changes: 11 additions & 0 deletions src/api/stores.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { decamelizeKeys } from 'humps'
import { apiClient } from '../constants/api-client'

export const getStores = params =>
apiClient.get<Store[]>('v2/stores', decamelizeKeys({ params }))

export const getStoreMemberships = params =>
apiClient.get<StoreMembership[]>('v2/store_memberships', decamelizeKeys({ params }))

export const updateStore = (storeId, params) =>
apiClient.patch<Store>(`v2/stores/${storeId}`, decamelizeKeys(params))
8 changes: 8 additions & 0 deletions src/api/vat-rates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { decamelizeKeys } from 'humps'
import { apiClient } from '../constants/api-client'

export const getVatRates = params =>
apiClient.get<VatRate[]>('v2/vat_rates', decamelizeKeys({ params }))

export const getVatRate = id =>
apiClient.get<VatRate>(`v2/vat_rates/${id}`)
Loading