Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/shop mobile expo v0.4.3 #1496

Merged
merged 115 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
feaae84
chore(conf): configure expo host location
Neosoulink Apr 8, 2022
7ba8526
chore(conf): configure default android navigation bg color
Neosoulink Apr 8, 2022
f72dcb3
chore(lint): updates rules
Neosoulink Apr 8, 2022
11f4043
refactor: review
Neosoulink Apr 9, 2022
5102e14
feat: add modal to enter correct host
Neosoulink Apr 9, 2022
c5fdcca
refactor: upgrade styles
Neosoulink Apr 9, 2022
b8b0387
refactor: review
Neosoulink Apr 9, 2022
adaaacb
feat: add checkServer method
Neosoulink Apr 9, 2022
23f4d99
refactor: minor update for checkServer method
Neosoulink Apr 9, 2022
cd19577
refactor: add strick checking to serverCheck method
Neosoulink Apr 9, 2022
46e5dad
fix: add missing styles
Neosoulink Apr 9, 2022
3a1fcb2
refactor: modal to handle host GraphQL requests
Neosoulink Apr 9, 2022
a3c98a0
feat: save prev host
Neosoulink Apr 11, 2022
ea5642c
feat: add user interface
Neosoulink Apr 11, 2022
2732e07
refactor: code review & implement user interface
Neosoulink Apr 11, 2022
1e27137
feat: add signout feature
Neosoulink Apr 11, 2022
70166dd
refactor: minor review
Neosoulink Apr 11, 2022
1314738
refactor: redisign search bar
Neosoulink Apr 11, 2022
1e82583
chore(deps): add expo-updates && lodash
Neosoulink Apr 12, 2022
22f4d51
refactor: minor
Neosoulink Apr 12, 2022
3d8697a
feat: implement debounce logic
Neosoulink Apr 12, 2022
2cd2b97
refactor: code update
Neosoulink Apr 12, 2022
f55c250
refactor: use lazy query to get merchants
Neosoulink Apr 12, 2022
c108db5
refactor: ise correct translations
Neosoulink Apr 12, 2022
a9febf8
fix: house prop type
Neosoulink Apr 12, 2022
2fb743e
feat: base merchant client support
Neosoulink Apr 12, 2022
20d887a
refactor: minor
Neosoulink Apr 12, 2022
fc101e3
feat: implement merchant searching feature
Neosoulink Apr 12, 2022
91530c1
refactor: code review
Neosoulink Apr 12, 2022
767932f
feat: add base oders client support
Neosoulink Apr 12, 2022
6bfd827
refactor: code review
Neosoulink Apr 12, 2022
729f65b
refactor: minor
Neosoulink Apr 12, 2022
c657fac
refactor: use right env
Neosoulink Apr 13, 2022
f722884
fix: minor
Neosoulink Apr 13, 2022
fe7c47e
refactor: increase network check duration
Neosoulink Apr 18, 2022
ffc2a1b
feat: add inStore screen
Neosoulink Apr 18, 2022
eaf313e
refactor: link inStore screen
Neosoulink Apr 18, 2022
4a10834
refactor: minor fix
Neosoulink Apr 18, 2022
0dcd65f
refactor: minor update
Neosoulink Apr 18, 2022
3c7531f
fix: resolve eslint warns
Neosoulink Apr 19, 2022
4d20eba
refactor: set default search btn event
Neosoulink Apr 19, 2022
d636883
feat: add screens
Neosoulink Apr 19, 2022
82e03c0
fix: missing search view props
Neosoulink Apr 19, 2022
b634884
feat: create ProductHistoryItem component
Neosoulink Apr 19, 2022
fd75efa
refactor: use ProductHistoryItem components
Neosoulink Apr 19, 2022
3b5770e
feat: impelement searching logic
Neosoulink Apr 19, 2022
35c9a14
refactor: improve screen
Neosoulink Apr 19, 2022
c0dbb9a
refactor: minor update
Neosoulink Apr 19, 2022
d699e5d
refactor: update ui for marchant status at search screen
Neosoulink Apr 19, 2022
7772ce5
refactor: improve merchants search at MerchantsSearch screen
Neosoulink Apr 19, 2022
da004e6
feat: unmount in store screen on blur
Neosoulink Apr 20, 2022
5b55856
feat: add query to get merchants products
Neosoulink Apr 20, 2022
576d6d0
refactor: minor
Neosoulink Apr 20, 2022
f449cff
refactor: update data structure of props
Neosoulink Apr 20, 2022
027c46e
feat: add intreface arg for merchants products query
Neosoulink Apr 20, 2022
6ff9e3c
refactor: hadapt data structure for product items
Neosoulink Apr 20, 2022
d2b67e9
feat: link search screens with mechant screen
Neosoulink Apr 20, 2022
2e4028a
feat: add method to navigate to product details
Neosoulink Apr 20, 2022
d41b6f0
feat: create product details screen
Neosoulink Apr 20, 2022
dadbd1d
feat: add queries to get warehouse products
Neosoulink Apr 21, 2022
d4daf8e
refactor: handle press details btn
Neosoulink Apr 21, 2022
d9d01b1
feat: handle product details
Neosoulink Apr 21, 2022
a298283
refactor: display correct price
Neosoulink Apr 21, 2022
4ffca52
refactor: get warehouse data in getStoreProducts query
Neosoulink Apr 21, 2022
cb584a5
fix: get correct data at InStore screen
Neosoulink Apr 21, 2022
ae24d4f
feat: show warehouse products onPress pprofile at InStore screen
Neosoulink Apr 21, 2022
f0e7b16
refactor: display warehouse name at inStore screen
Neosoulink Apr 21, 2022
947b47f
refactor: update shopMobileExpo readme
Neosoulink Apr 21, 2022
78e5ae2
feat: view product details from search screen
Neosoulink Apr 22, 2022
9d169bd
fix: use interface Props for CustomDrawer component
Neosoulink Apr 22, 2022
79906e9
fix: external link at drawer menu
Neosoulink Apr 22, 2022
d6b9008
fix: product item data at InStore view
Neosoulink Apr 22, 2022
aa6ce71
refactor: renamed registration screens folder to authentication && ad…
Neosoulink Apr 23, 2022
f92344e
refactor: update route path for authentications screens
Neosoulink Apr 23, 2022
1353230
refactor: update route path for authentications screens
Neosoulink Apr 23, 2022
3692a07
refactor: move screens from registration folder to authencication folder
Neosoulink Apr 23, 2022
e6b8438
refactor: update registration screens routes
Neosoulink Apr 23, 2022
6a63b44
feat: add event to go registration for invites
Neosoulink Apr 23, 2022
d25833c
feat: add types for user
Neosoulink Apr 23, 2022
9f56e08
feat: setting up user signup flow
Neosoulink Apr 24, 2022
4328c1f
refactor: secure app to conneected users without data
Neosoulink Apr 24, 2022
27c8c2a
fix: fromApp route param at account screen
Neosoulink Apr 24, 2022
64aae6a
feat: add sign in btn at authetication home
Neosoulink Apr 24, 2022
bef74f0
refactor: improve behavior of geolocated data at sign up screen
Neosoulink Apr 24, 2022
a0b307d
feat: setting up signin screen
Neosoulink Apr 24, 2022
a588ace
refactor: update user types
Neosoulink Apr 24, 2022
61927fd
feat: add user types
Neosoulink Apr 24, 2022
47745b5
refactor: update user data structure
Neosoulink Apr 24, 2022
9df25dc
refactor: update user data structure
Neosoulink Apr 24, 2022
74add32
refactor: update appolo clients types
Neosoulink Apr 25, 2022
43edd2c
feat: overScrollMode && showsVerticalScrollIndicator for app ScrollViews
Neosoulink Apr 25, 2022
2d5b3b2
feat: overScrollMode && showsVerticalScrollIndicator for app ScrollViews
Neosoulink Apr 25, 2022
34eac39
feat: add order store
Neosoulink Apr 25, 2022
ecccdb8
feat: add order store
Neosoulink Apr 25, 2022
b1829b5
feat: create btn to open order dialog
Neosoulink Apr 25, 2022
e656896
feat: use BuyProductBtn component
Neosoulink Apr 25, 2022
a27d677
feat: add dorder views
Neosoulink Apr 25, 2022
f50c004
refactor: add order info type prop
Neosoulink May 9, 2022
01d2642
feat: add order screen
Neosoulink May 9, 2022
d30bcbb
refactor: handle OrderInfoType changes
Neosoulink May 9, 2022
2756711
refactor: manage user's data at account screen
Neosoulink May 9, 2022
d315930
feat: add order info type dialg box
Neosoulink May 10, 2022
8fdc40e
refactor: design order screen
Neosoulink May 11, 2022
4da663d
refactor: manage order info type updates
Neosoulink May 11, 2022
15872de
refactor: manage order info type updates
Neosoulink May 11, 2022
05b2186
refactor: minor
Neosoulink May 11, 2022
9b0720b
fix: check if there's user data
Neosoulink May 12, 2022
97c2ec6
fix: resolve user signup
Neosoulink May 13, 2022
b1759b8
refactor: improve product components footer button label style
Neosoulink May 21, 2022
288e516
refactor: dislay amount on slide view product
Neosoulink May 23, 2022
aaf7452
refactor: use correct translation for buy btn
Neosoulink May 24, 2022
fb03dbf
feat: add create order mutation
Neosoulink May 25, 2022
729fdd4
refactor: minor
Neosoulink May 25, 2022
f58e07a
feat: implement create order mutation
Neosoulink May 25, 2022
9c6923e
fix: resolve product id ref
Neosoulink May 26, 2022
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
117 changes: 108 additions & 9 deletions packages/shop-mobile-expo/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,124 @@
{
"root": true,
"extends": "@react-native-community",
"env": {
"es6": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/no-use-before-define": ["error"],
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"brace-style": ["off", "off"],
"comma-dangle": ["off", "always-multiline"],
"constructor-super": "error",
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": ["error", "smart"],
"guard-for-in": "error",
"id-denylist": "off",
"id-match": "off",
"import/order": "off",
"indent": "off",
"max-classes-per-file": ["off", 1],
"max-len": [
"error",
{
"code": 120
}
],
"no-caller": "error",
"no-console": "off",
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-multiple-empty-lines": "off",
"no-new-wrappers": "error",
"no-restricted-imports": "error",
"no-shadow": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unused-labels": "error",
"no-use-before-define": "off",
"no-var": "error",
"prefer-arrow/prefer-arrow-functions": "off",
"prefer-const": "error",
"quote-props": "off",
"quotes": "error",
"radix": "error",
"semi": "off",
"valid-typeof": "error"
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/no-shadow": ["error"],
"no-shadow": "off",
"no-undef": "off",
"jsx-quotes": ["error", "prefer-single"],
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"no-extra-semi": "error",
"no-mixed-spaces-and-tabs": ["off", "smart-tabs"],
"no-spaced-func": "off",
"jsx-quotes": ["error", "prefer-single"],
"spaced-comment": [
"error",
"always",
{ "block": { "balanced": true } }
],
"no-mixed-spaces-and-tabs": ["off", "smart-tabs"],
"no-extra-semi": "error",
"semi": "off"
{ "block": { "balanced": true }, "markers": ["/"] }
]
}
}
]
Expand Down
39 changes: 21 additions & 18 deletions packages/shop-mobile-expo/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# @ever-platform/shop-mobile-expo

> 🛑 **NOT YET COMPATIBLE**: Currently this package don't works fine with Lerna mono-repo logic.
To be able to run this package locally, you've to extract the package outside of @ever-platform and then install dependencies (see [setup](#-setup) section).
But this package depend on @ever-platform server, don't forget to start it...
> To be able to run this package locally, you've to extract the package outside of @ever-platform and then install dependencies (see [setup](#-setup) section).
> But this package depend on @ever-platform server, don't forget to start the api...

## 📋 Contents

- [Contents](#-contents)
- [Demo](#-demo)
- [Setup](#-setup)
- [Testing](#-testing)
- [Contribution](#-contribution)
- [Contents](#-contents)
- [Demo](#-demo)
- [Setup](#-setup)
- [Testing](#-testing)
- [Contribution](#-contribution)

## 🤳 Demo

> We used expo to test our application easily and quickly.
> So you must first install expo on your mobile and then test the demo version.

Copy that link -> **[link not available](https://docs.expo.io/)** and past it into your expo app to preview demo.
Copy that link -> **[https://exp.host/@everco/ever-demand-shop-mobile-expo](https://exp.host/@everco/ever-demand-shop-mobile-expo)** and past it into your expo app to preview demo.

## ⚡ Setup

<!-- TODO: Add more folders and files descriptions -->

### 📋 Package structure

.
Expand Down Expand Up @@ -57,28 +58,30 @@ Copy that link -> **[link not available](https://docs.expo.io/)** and past it in

**🚧 Before installing et running project locally, make sure you have :**

- The latest Yarn version installed in your computer **(note that we're only use Yarn)**
- Node.js V14.x.x or higher installed in your computer
- Expo 5.x.x or higher installed in your computer
- The latest version of expo app installed in your phone (or virtual device)
- The latest Yarn version installed in your computer **(note that we're only use Yarn)**
- Node.js V14.x.x or higher installed in your computer
- Expo 5.x.x or higher installed in your computer
- The latest version of expo app installed in your phone (or virtual device)

### ⚡ Installation & Running

- Install dependencies `Yarn`. run `yarn add`.
- Create environment files by running `yarn run config`.
- After these steps, run `yarn run start` command to start bundle server
- Install dependencies `Yarn`. run `yarn add`.
- Create environment files by running `yarn run config`.
- After these steps, run `yarn run start` command to start bundle server

> 🚧 If you can't connect to the server, maybe the endpoint aren't compatible.
To update them, got to `./src/environments/environment.ts` and change urls props into `ENDPOINT` prop from `http://localhost/...` to `http://10.0.2.2/...`
> To update them, got to `./src/environments/environment.ts` and change urls props into `ENDPOINT` prop from `http://localhost/...` to `<http://10.0.2.2/>...

<!-- -->

> 💡 If you still can't connect to the API, we recommend that you consult the wiki where we explain how to expose your local network: <https://github.com/ever-co/ever-demand/wiki/Expose-Local-Network>

<!-- TODO: Add contribution -->
## 🧪 Testing

We're using Jest to test our application.

To run all tests, run `yarn run test`

<!-- TODO: Add contribution -->
### 🤝 Contribution

Please refer to the [guide of the platform](https://github.com/ever-co/ever-demand/#contribute)
13 changes: 11 additions & 2 deletions packages/shop-mobile-expo/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"expo": {
"name": "@ever-platform/shop-mobile-expo",
"slug": "shop-mobile-expo",
"name": "ever-demand-shop-mobile-expo",
"slug": "ever-demand-shop-mobile-expo",
"owner": "everco",
"description": "Ever Shop Mobile App build with expo",
"version": "0.4.3",
"orientation": "portrait",
Expand All @@ -18,14 +19,22 @@
},
"assetBundlePatterns": ["**/*"],
"ios": {
"bundleIdentifier": "com.everDemand.shopMobileExpo",
"buildNumber": "0.4.3",
"supportsTablet": true
},
"androidStatusBar": {
"barStyle": "light-content",
"translucent": true,
"backgroundColor": "#00000000"
},
"androidNavigationBar": {
"backgroundColor": "#2A2C39",
"barStyle": "light-content"
},
"android": {
"package": "com.everDemand.shopMobileExpo",
"versionCode": 1,
"adaptiveIcon": {
"foregroundImage": "./src/assets/img/appIcons/adaptive-icon.png",
"backgroundColor": "#2A2C39"
Expand Down
18 changes: 10 additions & 8 deletions packages/shop-mobile-expo/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "@ever-platform/shop-mobile-expo",
"name": "@ever-platform/shop-mobile-expo",
"version": "0.4.3",
"description": "Ever Shop Mobile App built with Expo (ReactNative)",
"license": "GPL-3.0",
"homepage": "https://ever.co/",
"description": "Ever Shop Mobile App built with Expo (ReactNative)",
"license": "GPL-3.0",
"homepage": "https://ever.co/",
"repository": {
"type": "git",
"url": "https://github.com/ever-co/ever-demand.git"
},
"bugs": {
"url": "https://github.com/ever-co/ever-demand/issues"
},
"private": true,
"private": true,
"author": {
"name": "Ever Co. LTD",
"email": "ever@ever.co",
"url": "https://ever.co"
},
"main": "App.tsx",
"main": "App.tsx",
"scripts": {
"config": "cross-env NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 yarn ts-node ./scripts/configure.ts",
"config:dev": "cross-env NODE_ENV=development NODE_OPTIONS=--max_old_space_size=4096 yarn run config -- --environment=dev",
Expand All @@ -44,7 +44,9 @@
"expo-location": "~14.0.1",
"expo-status-bar": "~1.2.0",
"expo-system-ui": "~1.1.0",
"expo-updates": "~0.11.6",
"graphql": "^16.3.0",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",
"react": "17.0.2",
"react-dom": "17.0.1",
Expand Down Expand Up @@ -103,10 +105,10 @@
"node"
]
},
"engines": {
"engines": {
"node": ">=14.4.0",
"yarn": ">=1.13.0"
},
"production": false,
"snyk": false
"snyk": false
}
3 changes: 2 additions & 1 deletion packages/shop-mobile-expo/scripts/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ const environment: Environment = {
/**
* Contain app endpoints
*
* _🚧 warning: if you're using a AVD (Android Virtual Device) and localhost don't works, replace it with **10.0.2.2**_
* _🚧 warning: if you're using a AVD (Android Virtual Device)_
* _and localhost doesn't works, replace it with **10.0.2.2**_
*/
ENDPOINT: {
GQL: 'http://localhost:8443/graphql',
Expand Down
4 changes: 1 addition & 3 deletions packages/shop-mobile-expo/scripts/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ export type Env = Readonly<{
}>;

// TODO: validate better merchantIDs
const merchantIDs: any = makeValidator((x) => {
return x;
});
const merchantIDs: any = makeValidator((x) => x);

const opt: CleanOptions<Env> = {};

Expand Down
41 changes: 41 additions & 0 deletions packages/shop-mobile-expo/src/assets/ts/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ export const GLOBAL_STYLE = StyleSheet.create({

elevation: 8.5,
},
rounded0: {
borderRadius: 0,
},
roundedSm: {
borderRadius: 5,
},
Expand Down Expand Up @@ -526,6 +529,27 @@ export const GLOBAL_STYLE = StyleSheet.create({
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.3)',
},
positionAbsolute: {
position: 'absolute',
},
positionRelative: {
position: 'relative',
},
positionReset: {
position: undefined,
},
t0: {
top: 0,
},
b0: {
bottom: 0,
},
l0: {
left: 0,
},
r0: {
right: 0,
},
card: {
position: 'relative',
padding: 15,
Expand Down Expand Up @@ -633,6 +657,17 @@ export const GLOBAL_STYLE = StyleSheet.create({
row: {
flexDirection: 'row',
},
alignBaseline: { alignItems: 'baseline' },
alignCenter: { alignItems: 'center' },
alignEnd: { alignItems: 'flex-end' },
alignStart: { alignItems: 'flex-start' },
alignStretch: { alignItems: 'stretch' },
justifyCenter: { justifyContent: 'center' },
justifyEnd: { justifyContent: 'flex-end' },
justifyStart: { justifyContent: 'flex-start' },
justifyAround: { justifyContent: 'space-around' },
justifyBetween: { justifyContent: 'space-between' },
justifyEvenly: { justifyContent: 'space-evenly' },
inlineItems: {
flexDirection: 'row',
alignItems: 'center',
Expand All @@ -642,6 +677,12 @@ export const GLOBAL_STYLE = StyleSheet.create({
justifyContent: 'space-between',
alignItems: 'center',
},
flex1: {
flex: 1,
},
flexWrap: {
flexWrap: 'wrap',
},
tableBtn: {
padding: 5,
flexDirection: 'row',
Expand Down
Loading