├── .watchmanconfig
├── src
├── redux
│ ├── sagas
│ │ ├── cart.js
│ │ ├── index.js
│ │ └── products.js
│ ├── docks
│ │ ├── index.js
│ │ ├── cart.js
│ │ └── products.js
│ └── store.js
├── screens
│ ├── checkout
│ │ ├── styled.js
│ │ └── index.js
│ ├── signIn
│ │ ├── components
│ │ │ └── signInForm
│ │ │ │ ├── styled.js
│ │ │ │ └── index.js
│ │ ├── styled.js
│ │ └── index.js
│ ├── signUp
│ │ ├── components
│ │ │ └── signUpForm
│ │ │ │ ├── styled.js
│ │ │ │ └── index.js
│ │ ├── styled.js
│ │ └── index.js
│ ├── productDetail
│ │ ├── components
│ │ │ ├── productImage
│ │ │ │ ├── index.js
│ │ │ │ └── styled.js
│ │ │ └── productInfo
│ │ │ │ ├── styled.js
│ │ │ │ └── index.js
│ │ ├── styled.js
│ │ └── index.js
│ ├── menu
│ │ ├── styled.js
│ │ └── index.js
│ ├── storyComponents
│ │ ├── index.js
│ │ └── styled.js
│ ├── products
│ │ ├── styled.js
│ │ ├── components
│ │ │ ├── listProducts
│ │ │ │ ├── styled.js
│ │ │ │ └── index.js
│ │ │ └── orderProducts
│ │ │ │ ├── styled.js
│ │ │ │ └── index.js
│ │ └── index.js
│ ├── authLoading
│ │ ├── styled.js
│ │ └── index.js
│ ├── home
│ │ ├── styled.js
│ │ └── index.js
│ ├── trackOrder
│ │ ├── index.js
│ │ ├── components
│ │ │ └── orderList
│ │ │ │ ├── styled.js
│ │ │ │ └── index.js
│ │ └── styled.js
│ └── cart
│ │ ├── styled.js
│ │ └── index.js
├── utils
│ ├── test-utils.js
│ ├── images.js
│ ├── httpClient.js
│ └── index.js
├── assets
│ ├── images
│ │ ├── logo.png
│ │ ├── home-bg.png
│ │ ├── logo@2x.png
│ │ ├── home-bg@2x.png
│ │ ├── home-bg@3x.png
│ │ ├── product01.png
│ │ ├── product02.png
│ │ ├── product01@2x.png
│ │ ├── product02@2x.png
│ │ ├── productThumb01.png
│ │ ├── productThumb02.png
│ │ ├── productThumb@2x.png
│ │ └── productThumb02@2x.png
│ └── fonts
│ │ ├── Roboto-Bold.ttf
│ │ ├── Roboto-Thin.ttf
│ │ ├── Roboto-Black.ttf
│ │ ├── Roboto-Italic.ttf
│ │ ├── Roboto-Light.ttf
│ │ ├── Roboto-Medium.ttf
│ │ ├── Roboto-Regular.ttf
│ │ ├── Roboto-BlackItalic.ttf
│ │ ├── Roboto-BoldItalic.ttf
│ │ ├── Roboto-LightItalic.ttf
│ │ ├── Roboto-ThinItalic.ttf
│ │ └── Roboto-MediumItalic.ttf
├── components
│ ├── headers
│ │ ├── index.js
│ │ ├── headerModal
│ │ │ ├── styled.js
│ │ │ └── index.js
│ │ └── headerDefault
│ │ │ ├── styled.js
│ │ │ └── index.js
│ ├── loading
│ │ ├── index.js
│ │ └── styled.js
│ ├── card
│ │ ├── index.js
│ │ └── styled.js
│ ├── productItem
│ │ ├── index.js
│ │ └── styled.js
│ ├── button
│ │ ├── index.js
│ │ └── styled.js
│ └── textField
│ │ ├── styled.js
│ │ └── index.js
├── navigation
│ ├── index.js
│ ├── navigationService.js
│ ├── optionsRouter.js
│ └── createRoutes.js
├── styles
│ ├── common.js
│ ├── fonts.js
│ ├── variables.js
│ ├── theme.js
│ └── typography.js
├── services
│ ├── authService.js
│ └── productService.js
├── index.js
├── __tests__
│ ├── __snapshots__
│ │ └── App-test.js.snap
│ └── App-test.js
└── fake-data
│ └── index.js
├── .gitattributes
├── app.json
├── .vscode
└── settings.json
├── babel.config.js
├── storybook
├── addons.js
├── rn-addons.js
├── index.js
└── stories
│ └── index.js
├── .prettierrc.js
├── android
├── app
│ ├── debug.keystore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── drawable
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-ldpi
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-land
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-xxxhdpi
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-land-hdpi
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-land-ldpi
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-land-mdpi
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-land-xhdpi
│ │ │ │ │ └── screen.png
│ │ │ │ ├── drawable-land-xxhdpi
│ │ │ │ │ └── screen.png
│ │ │ │ └── drawable-land-xxxhdpi
│ │ │ │ │ └── screen.png
│ │ │ ├── assets
│ │ │ │ └── fonts
│ │ │ │ │ ├── Entypo.ttf
│ │ │ │ │ ├── Zocial.ttf
│ │ │ │ │ ├── AntDesign.ttf
│ │ │ │ │ ├── EvilIcons.ttf
│ │ │ │ │ ├── Feather.ttf
│ │ │ │ │ ├── Fontisto.ttf
│ │ │ │ │ ├── Ionicons.ttf
│ │ │ │ │ ├── Octicons.ttf
│ │ │ │ │ ├── FontAwesome.ttf
│ │ │ │ │ ├── Foundation.ttf
│ │ │ │ │ ├── Roboto-Bold.ttf
│ │ │ │ │ ├── Roboto-Thin.ttf
│ │ │ │ │ ├── MaterialIcons.ttf
│ │ │ │ │ ├── Roboto-Black.ttf
│ │ │ │ │ ├── Roboto-Italic.ttf
│ │ │ │ │ ├── Roboto-Light.ttf
│ │ │ │ │ ├── Roboto-Medium.ttf
│ │ │ │ │ ├── Roboto-Regular.ttf
│ │ │ │ │ ├── SimpleLineIcons.ttf
│ │ │ │ │ ├── FontAwesome5_Brands.ttf
│ │ │ │ │ ├── FontAwesome5_Solid.ttf
│ │ │ │ │ ├── Roboto-BlackItalic.ttf
│ │ │ │ │ ├── Roboto-BoldItalic.ttf
│ │ │ │ │ ├── Roboto-LightItalic.ttf
│ │ │ │ │ ├── Roboto-MediumItalic.ttf
│ │ │ │ │ ├── Roboto-ThinItalic.ttf
│ │ │ │ │ ├── FontAwesome5_Regular.ttf
│ │ │ │ │ └── MaterialCommunityIcons.ttf
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── protain
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── MainApplication.java
│ │ │ └── AndroidManifest.xml
│ │ └── debug
│ │ │ └── AndroidManifest.xml
│ ├── proguard-rules.pro
│ ├── build_defs.bzl
│ ├── BUCK
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── settings.gradle
├── build.gradle
├── gradle.properties
├── gradlew.bat
└── gradlew
├── ios
├── protain
│ ├── Images.xcassets
│ │ ├── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── AppDelegate.h
│ ├── main.m
│ ├── AppDelegate.m
│ ├── Info.plist
│ └── Base.lproj
│ │ └── LaunchScreen.xib
├── protain.xcworkspace
│ └── contents.xcworkspacedata
├── protainTests
│ ├── Info.plist
│ └── protainTests.m
├── protain-tvOSTests
│ └── Info.plist
├── protain-tvOS
│ └── Info.plist
├── Podfile
├── protain.xcodeproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── protain.xcscheme
│ │ └── protain-tvOS.xcscheme
└── Podfile.lock
├── .buckconfig
├── .editorconfig
├── react-native.config.js
├── index.js
├── .eslintrc.js
├── metro.config.js
├── jest.config.js
├── .github
└── workflows
│ └── node.js.yml
├── .gitignore
├── .flowconfig
├── README.MD
└── package.json
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/src/redux/sagas/cart.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/screens/checkout/styled.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/src/utils/test-utils.js:
--------------------------------------------------------------------------------
1 | console.log('utils')
2 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "protain",
3 | "displayName": "protain"
4 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "java.configuration.updateBuildConfiguration": "interactive"
3 | }
4 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | }
4 |
--------------------------------------------------------------------------------
/storybook/addons.js:
--------------------------------------------------------------------------------
1 | import '@storybook/addon-actions/register'
2 | import '@storybook/addon-knobs/register'
3 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | singleQuote: true,
3 | semi: false,
4 | trailingComma: 'all',
5 | }
6 |
--------------------------------------------------------------------------------
/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/debug.keystore
--------------------------------------------------------------------------------
/ios/protain/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/logo.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Protain Full
3 |
4 |
--------------------------------------------------------------------------------
/src/assets/images/home-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/home-bg.png
--------------------------------------------------------------------------------
/src/assets/images/logo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/logo@2x.png
--------------------------------------------------------------------------------
/storybook/rn-addons.js:
--------------------------------------------------------------------------------
1 | import '@storybook/addon-ondevice-knobs/register'
2 | import '@storybook/addon-ondevice-notes/register'
3 |
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-Bold.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-Thin.ttf
--------------------------------------------------------------------------------
/src/assets/images/home-bg@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/home-bg@2x.png
--------------------------------------------------------------------------------
/src/assets/images/home-bg@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/home-bg@3x.png
--------------------------------------------------------------------------------
/src/assets/images/product01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/product01.png
--------------------------------------------------------------------------------
/src/assets/images/product02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/product02.png
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-Black.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-Italic.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-Light.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/src/assets/images/product01@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/product01@2x.png
--------------------------------------------------------------------------------
/src/assets/images/product02@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/product02@2x.png
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/src/assets/images/productThumb01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/productThumb01.png
--------------------------------------------------------------------------------
/src/assets/images/productThumb02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/productThumb02.png
--------------------------------------------------------------------------------
/src/assets/images/productThumb@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/productThumb@2x.png
--------------------------------------------------------------------------------
/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-BlackItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-BlackItalic.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-BoldItalic.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-LightItalic.ttf
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-ThinItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-ThinItalic.ttf
--------------------------------------------------------------------------------
/src/assets/images/productThumb02@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/images/productThumb02@2x.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable/icon.png
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/src/assets/fonts/Roboto-MediumItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/src/assets/fonts/Roboto-MediumItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Entypo.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Zocial.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Zocial.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/AntDesign.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/AntDesign.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/EvilIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/EvilIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Feather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Feather.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Fontisto.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Fontisto.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Ionicons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Octicons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | charset = utf-8
7 | trim_trailing_whitespace = false
8 | insert_final_newline = false
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Foundation.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Foundation.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-Bold.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-Thin.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-hdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-hdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-land/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-land/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-ldpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-ldpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-mdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/src/components/headers/index.js:
--------------------------------------------------------------------------------
1 | import HeaderDefault from './headerDefault'
2 | import HeaderModal from './headerModal'
3 |
4 | export { HeaderDefault, HeaderModal }
5 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/MaterialIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/MaterialIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-Black.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-Italic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-Light.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-xhdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-xxhdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxxhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-xxxhdpi/screen.png
--------------------------------------------------------------------------------
/src/navigation/index.js:
--------------------------------------------------------------------------------
1 | import CreateRoutes from './createRoutes'
2 | import NavigationService from './navigationService'
3 |
4 | export { CreateRoutes, NavigationService }
5 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/SimpleLineIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/SimpleLineIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-land-hdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-land-hdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-land-ldpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-land-ldpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-land-mdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-land-mdpi/screen.png
--------------------------------------------------------------------------------
/react-native.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | project: {
3 | ios: {},
4 | android: {}, // grouped into "project"
5 | },
6 | assets: ['./src/assets/fonts/'],
7 | }
8 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-BlackItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-BlackItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-BoldItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-LightItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-MediumItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-MediumItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto-ThinItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/Roboto-ThinItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-land-xhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-land-xhdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-land-xxhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-land-xxhdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-land-xxxhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/res/drawable-land-xxxhdpi/screen.png
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noel319/react-native-ecommerce-project/HEAD/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'protain'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
--------------------------------------------------------------------------------
/src/redux/docks/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 |
3 | import cart from './cart'
4 | import products from './products'
5 |
6 | export default combineReducers({
7 | cart,
8 | products,
9 | })
10 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import { AppRegistry } from 'react-native'
6 | import App from './src'
7 | import { name as appName } from './app.json'
8 |
9 | AppRegistry.registerComponent(appName, () => App)
10 |
--------------------------------------------------------------------------------
/src/redux/sagas/index.js:
--------------------------------------------------------------------------------
1 | import { all, fork } from 'redux-saga/effects'
2 |
3 | import { watchGetProducts, getAllProducts } from './products'
4 |
5 | export default function* rootSaga() {
6 | yield all([fork(getAllProducts), fork(watchGetProducts)])
7 | }
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/src/screens/signIn/components/signInForm/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | export const ViewButton = styled.View`
4 | margin-top: ${props => props.theme.metrics.spacing(2)};
5 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
6 | `
7 |
--------------------------------------------------------------------------------
/src/screens/signUp/components/signUpForm/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | export const ViewButton = styled.View`
4 | margin-top: ${props => props.theme.metrics.spacing(2)};
5 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
6 | `
7 |
--------------------------------------------------------------------------------
/src/screens/checkout/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { SafeAreaView, Text } from 'react-native'
3 |
4 | const Checkout = () => {
5 | return (
6 |
7 | Checkout
8 |
9 | )
10 | }
11 |
12 | export default Checkout
13 |
--------------------------------------------------------------------------------
/ios/protain.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/screens/productDetail/components/productImage/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import * as S from './styled'
4 |
5 | const ProductImage = ({ sourceImg }) => {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
13 | export default ProductImage
14 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: ['@react-native-community'],
4 | rules: {
5 | 'prettier/prettier': ['error'],
6 | semi: ['error', 'never'],
7 | 'global-require': 'off',
8 | 'no-console': 'off',
9 | 'import/prefer-default-export': 'off',
10 | 'import/no-unresolved': 0,
11 | },
12 | }
13 |
--------------------------------------------------------------------------------
/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | module.exports = {
9 | transformer: {
10 | getTransformOptions: async () => ({
11 | transform: {
12 | experimentalImportSupport: false,
13 | inlineRequires: false,
14 | },
15 | }),
16 | },
17 | }
18 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/utils/images.js:
--------------------------------------------------------------------------------
1 | export default {
2 | homeBg: require('../assets/images/home-bg.png'),
3 | logo: require('../assets/images/logo.png'),
4 | productImg01: require('../assets/images/product01.png'),
5 | productImg02: require('../assets/images/product02.png'),
6 | productThumbImg01: require('../assets/images/productThumb01.png'),
7 | productThumbImg02: require('../assets/images/productThumb02.png'),
8 | }
9 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/screens/productDetail/components/productImage/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | export const ProductImage = styled.View`
4 | padding: ${props => props.theme.metrics.spacing(3)};
5 | background-color: ${props => props.theme.WHITE};
6 | align-items: center;
7 | justify-content: center;
8 | `
9 |
10 | export const Image = styled.Image`
11 | width: 172px;
12 | height: 212px;
13 | `
14 |
--------------------------------------------------------------------------------
/src/redux/store.js:
--------------------------------------------------------------------------------
1 | import { createStore, applyMiddleware } from 'redux'
2 | import createSagaMiddleware from 'redux-saga'
3 |
4 | import reducers from './docks'
5 | import sagas from './sagas'
6 |
7 | const sagaMiddleware = createSagaMiddleware()
8 | const middlewares = [sagaMiddleware]
9 |
10 | const store = createStore(reducers, applyMiddleware(...middlewares))
11 |
12 | sagaMiddleware.run(sagas)
13 |
14 | export default store
15 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/protain/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.protain;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript. This is used to schedule
9 | * rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "protain";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | const ignores = ['/node_modules/', '/__tests__/helpers/', '__mocks__']
2 |
3 | module.exports = {
4 | moduleDirectories: ['node_modules', 'utils', __dirname],
5 | preset: '@testing-library/react-native',
6 | setupFilesAfterEnv: ['@testing-library/react-native/cleanup-after-each'],
7 | collectCoverageFrom: ['src/**/*.+(js|jsx|ts|tsx)'],
8 | testMatch: ['**/__tests__/**/*.+(js|jsx|ts|tsx)'],
9 | testPathIgnorePatterns: [...ignores],
10 | }
11 |
--------------------------------------------------------------------------------
/ios/protain/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (nonatomic, strong) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/ios/protain/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/styles/common.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import {} from './fonts'
4 |
5 | export const Container = styled.SafeAreaView`
6 | flex: 1;
7 | padding: ${props => props.theme.metrics.spacing(2)};
8 | background-color: ${props =>
9 | (props.bgColor === 'primary' && props.theme.PRIMARY_BACKGROUND_COLOR) ||
10 | (props.bgColor === 'secondary' && props.theme.SECONDARY_BACKGROUND_COLOR) ||
11 | (!props.bgColor && props.theme.WHITE)};
12 | `
13 |
--------------------------------------------------------------------------------
/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/src/services/authService.js:
--------------------------------------------------------------------------------
1 | import httpClient from '../utils/httpClient'
2 |
3 | class AuthService {
4 | static login({ email, password }) {
5 | const data = {
6 | email,
7 | password,
8 | }
9 | return httpClient.post('/api/login', data)
10 | }
11 |
12 | static register({ email, password }) {
13 | const data = {
14 | email,
15 | password,
16 | }
17 | return httpClient.post('/api/register', data)
18 | }
19 | }
20 |
21 | export default AuthService
22 |
--------------------------------------------------------------------------------
/src/components/loading/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | import * as S from './styled'
5 |
6 | const Loading = ({ title }) => {
7 | return (
8 |
9 |
10 | {title && {title}}
11 |
12 | )
13 | }
14 |
15 | Loading.defaultProps = {
16 | title: 'Aguarde...',
17 | }
18 |
19 | Loading.propTypes = {
20 | title: PropTypes.string,
21 | }
22 |
23 | export default Loading
24 |
--------------------------------------------------------------------------------
/src/components/card/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | import * as S from './styled'
5 |
6 | export const { CardHeader, CardBody, CardFooter } = S
7 |
8 | const Card = ({ children, variant }) => (
9 | {children}
10 | )
11 |
12 | Card.defaultProps = {
13 | children: null,
14 | variant: null,
15 | }
16 |
17 | Card.propTypes = {
18 | children: PropTypes.node,
19 | variant: PropTypes.string,
20 | }
21 | export default Card
22 |
--------------------------------------------------------------------------------
/src/styles/fonts.js:
--------------------------------------------------------------------------------
1 | export const fontSize = {
2 | small: 12,
3 | regular: 14,
4 | normal: 16,
5 | extra: 18,
6 | medium: 20,
7 | big: 26,
8 | }
9 |
10 | export const fontFamily = {
11 | RobotoThin: 'Roboto-Thin',
12 | RobotoRegular: 'Roboto-Regular',
13 | RobotoLight: 'Roboto-Light',
14 | RobotoMedium: 'Roboto-Medium',
15 | RobotoBold: 'Roboto-Bold',
16 | }
17 |
18 | export const fontWeight = {
19 | thin: 100,
20 | light: 300,
21 | regular: 400,
22 | medium: 500,
23 | bold: 700,
24 | }
25 |
--------------------------------------------------------------------------------
/src/styles/variables.js:
--------------------------------------------------------------------------------
1 | export const Colors = {
2 | WHITE: '#fff',
3 | GREY: '#BCBBBB',
4 | GREY_DARK: '#707070',
5 | GREEN: '#C6ED3E',
6 | PRIMARY_BACKGROUND_COLOR: '#F8F8F8',
7 | SECONDARY_BACKGROUND_COLOR: '#2F2F2F',
8 | TERTIARY_BACKGROUND_COLOR: '#FBF9F7',
9 | PRIMARY_TEXT_COLOR: '#000000',
10 | SECONDARY_TEXT_COLOR: '#FFFFFF',
11 | PRIMARY_BUTTON_COLOR: '#C6ED3E',
12 | SECONDARY_BUTTON_COLOR: '#FFFFFF',
13 | SHADOW_COLOR: 'rgba(0,0,0, 0.20)',
14 | ERROR: '#f55050',
15 | INACTIVE: '#878EA0',
16 | SUCCESS: '#44bd13',
17 | }
18 |
--------------------------------------------------------------------------------
/src/components/headers/headerModal/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | export const HeaderModal = styled.View`
4 | padding-top: ${props => props.theme.metrics.spacing(1)};
5 | padding-right: ${props => props.theme.metrics.spacing(0.8)};
6 | padding-left: ${props => props.theme.metrics.spacing(0.8)};
7 | padding-bottom: ${props => props.theme.metrics.spacing(1)};
8 | align-items: flex-end;
9 | `
10 | export const TouchableOpacity = styled.TouchableOpacity`
11 | padding: ${props => props.theme.metrics.spacing(0.5)};
12 | `
13 |
--------------------------------------------------------------------------------
/src/components/headers/headerDefault/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | export const HeaderDefault = styled.View`
4 | padding-top: ${props => props.theme.metrics.spacing(1)};
5 | padding-right: ${props => props.theme.metrics.spacing(0.8)};
6 | padding-left: ${props => props.theme.metrics.spacing(0.8)};
7 | padding-bottom: ${props => props.theme.metrics.spacing(1)};
8 | align-items: flex-start;
9 | `
10 | export const TouchableOpacity = styled.TouchableOpacity`
11 | padding: ${props => props.theme.metrics.spacing(0.5)};
12 | `
13 |
--------------------------------------------------------------------------------
/src/navigation/navigationService.js:
--------------------------------------------------------------------------------
1 | import { NavigationActions } from 'react-navigation'
2 |
3 | let navigator
4 |
5 | function setTopLevelNavigator(navigatorRef) {
6 | navigator = navigatorRef
7 | }
8 |
9 | function navigate(routeName, params) {
10 | navigator.dispatch(
11 | NavigationActions.navigate({
12 | routeName,
13 | params,
14 | }),
15 | )
16 | }
17 |
18 | function goBack() {
19 | navigator.dispatch(NavigationActions.back())
20 | }
21 |
22 | export default {
23 | navigate,
24 | setTopLevelNavigator,
25 | goBack,
26 | }
27 |
--------------------------------------------------------------------------------
/src/components/card/styled.js:
--------------------------------------------------------------------------------
1 | import styled, { css } from 'styled-components/native'
2 |
3 | const cardStyled = css`
4 | padding: ${props => props.theme.metrics.spacing(2)};
5 | `
6 |
7 | export const Card = styled.View`
8 | background-color: ${props =>
9 | props.variant === 'dark' ? props.theme.GREY_DARK : props.theme.WHITE};
10 | `
11 |
12 | export const CardHeader = styled.View`
13 | ${cardStyled}
14 | `
15 |
16 | export const CardBody = styled.View`
17 | ${cardStyled}
18 | `
19 |
20 | export const CardFooter = styled.View`
21 | ${cardStyled}
22 | `
23 |
--------------------------------------------------------------------------------
/src/screens/menu/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextMediumExtra, TextRegular } from '../../styles/typography'
4 |
5 | export const MenuTitleSection = styled.Text`
6 | background-color: ${props => props.theme.TERTIARY_BACKGROUND_COLOR};
7 | padding: ${props => props.theme.metrics.spacing(1.5)};
8 | ${TextMediumExtra};
9 | `
10 | export const MenuItemTouch = styled.TouchableOpacity`
11 | padding: ${props => props.theme.metrics.spacing(1.5)};
12 | `
13 |
14 | export const MenuItemText = styled.Text`
15 | ${TextRegular};
16 | `
17 |
--------------------------------------------------------------------------------
/src/screens/storyComponents/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { HeaderModal } from '../../components/headers'
4 | import StorybookUI from '../../../storybook'
5 |
6 | import * as S from './styled'
7 |
8 | const StoryComponents = () => {
9 | return (
10 |
11 |
12 |
13 | Storybook Components
14 | Story this Ecommerce
15 |
16 |
17 |
18 | )
19 | }
20 |
21 | export default StoryComponents
22 |
--------------------------------------------------------------------------------
/src/components/headers/headerModal/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { TouchableOpacity } from 'react-native'
3 | import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
4 |
5 | import { NavigationService } from '../../../navigation'
6 | import * as S from './styled'
7 |
8 | const HeaderModal = () => (
9 |
10 | {
12 | NavigationService.goBack()
13 | }}
14 | >
15 |
16 |
17 |
18 | )
19 |
20 | export default HeaderModal
21 |
--------------------------------------------------------------------------------
/src/components/loading/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextRegular } from '../../styles/typography'
4 | import { Colors } from '../../styles/variables'
5 |
6 | export const Loading = styled.View`
7 | margin: ${props => props.theme.metrics.spacing(2)};
8 | justify-content: center;
9 | align-items: center;
10 | flex: 1;
11 | `
12 |
13 | export const ActivityIndicator = styled.ActivityIndicator.attrs({
14 | size: 'large',
15 | color: Colors.GREEN,
16 | })``
17 |
18 | export const Title = styled.Text`
19 | color: ${({ theme }) => theme.SECONDARY_TEXT_COLOR};
20 | ${TextRegular};
21 | `
22 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Provider } from 'react-redux'
3 | import { ThemeProvider } from 'styled-components'
4 |
5 | import { CreateRoutes } from './navigation'
6 | import { darkTheme } from './styles/theme'
7 | import { NavigationService } from './navigation'
8 | import store from './redux/store'
9 |
10 | const App = () => (
11 |
12 |
13 | {
15 | NavigationService.setTopLevelNavigator(navigationRef)
16 | }}
17 | />
18 |
19 |
20 | )
21 |
22 | export default App
23 |
--------------------------------------------------------------------------------
/src/screens/productDetail/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextSmallRegular, TextMediumBold } from '../../styles/typography'
4 |
5 | export const ProductDetail = styled.SafeAreaView`
6 | flex: 1;
7 | `
8 |
9 | export const ProductContentBuy = styled.SafeAreaView`
10 | flex-direction: row;
11 | align-items: center;
12 | justify-content: space-between;
13 | `
14 |
15 | export const ProductTagText = styled.Text`
16 | ${TextSmallRegular};
17 | color: ${props => props.theme.WHITE};
18 | `
19 |
20 | export const ProductPrice = styled.Text`
21 | ${TextMediumBold};
22 | color: ${props => props.theme.GREEN};
23 | `
24 |
--------------------------------------------------------------------------------
/src/redux/sagas/products.js:
--------------------------------------------------------------------------------
1 | import { call, put, takeLatest } from 'redux-saga/effects'
2 |
3 | import { receiveProducts } from '../docks/products'
4 | import productService from '../../services/productService'
5 |
6 | import { Types as TypesProducts } from '../docks/products'
7 |
8 | export function* getAllProducts(action) {
9 | const { type, search } = action ? action.payload : { search: '', type: '' }
10 | const response = yield call(productService.listProducts, {
11 | type,
12 | search,
13 | })
14 | yield put(receiveProducts(response.data))
15 | }
16 |
17 | export function* watchGetProducts() {
18 | yield takeLatest(TypesProducts.GET_ALL, getAllProducts)
19 | }
20 |
--------------------------------------------------------------------------------
/android/app/build_defs.bzl:
--------------------------------------------------------------------------------
1 | """Helper definitions to glob .aar and .jar targets"""
2 |
3 | def create_aar_targets(aarfiles):
4 | for aarfile in aarfiles:
5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6 | lib_deps.append(":" + name)
7 | android_prebuilt_aar(
8 | name = name,
9 | aar = aarfile,
10 | )
11 |
12 | def create_jar_targets(jarfiles):
13 | for jarfile in jarfiles:
14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15 | lib_deps.append(":" + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
--------------------------------------------------------------------------------
/src/screens/products/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { Title as TitleStyle } from '../../styles/typography'
4 |
5 | export const Title = styled.Text`
6 | ${TitleStyle};
7 | margin-bottom: ${props => props.theme.metrics.spacing()};
8 | `
9 |
10 | export const Container = styled.SafeAreaView`
11 | flex: 1;
12 | background-color: ${props => props.theme.WHITE};
13 | `
14 |
15 | export const Header = styled.View`
16 | margin-top: ${props => props.theme.metrics.spacing(2)};
17 | margin-bottom: ${props => props.theme.metrics.spacing(1.5)};
18 | padding: ${props => props.theme.metrics.spacing()};
19 | `
20 |
21 | export const listProduct = {
22 | marginVertical: 15,
23 | }
24 |
--------------------------------------------------------------------------------
/src/screens/productDetail/components/productInfo/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import {
4 | TextMedium,
5 | TextRegular,
6 | TextRegularMedium,
7 | } from '../../../../styles/typography'
8 |
9 | export const ProductInfo = styled.View`
10 | padding: ${props => props.theme.metrics.spacing(1.5)};
11 | flex: 1;
12 | `
13 |
14 | export const ProductName = styled.Text`
15 | ${TextMedium};
16 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
17 | `
18 | export const Subtitle = styled.Text`
19 | ${TextRegularMedium};
20 | margin-bottom: ${props => props.theme.metrics.spacing(0.5)};
21 | `
22 |
23 | export const ProductDescription = styled.Text`
24 | ${TextRegular};
25 | `
26 |
--------------------------------------------------------------------------------
/src/utils/httpClient.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 | import AsyncStorage from '@react-native-community/async-storage'
3 |
4 | const axiosInstace = axios.create({
5 | baseURL: 'https://reqres.in',
6 | })
7 |
8 | axiosInstace.interceptors.request.use(
9 | async config => {
10 | const token = await AsyncStorage.getItem('userToken')
11 |
12 | if (token) {
13 | config.headers.Authorization = token
14 | }
15 |
16 | return Promise.resolve(config)
17 | },
18 | error => Promise.reject(error),
19 | )
20 |
21 | axiosInstace.interceptors.response.use(
22 | async response => response,
23 | error => Promise.reject(error),
24 | )
25 |
26 | const httpClient = axiosInstace
27 |
28 | export default httpClient
29 |
--------------------------------------------------------------------------------
/src/screens/authLoading/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextRegular } from '../../styles/typography'
4 | import { Colors } from '../../styles/variables'
5 |
6 | export const Container = styled.View`
7 | flex: 1;
8 | width: 100%;
9 | padding: ${props => props.theme.metrics.spacing(0.5)};
10 | justify-content: center;
11 | align-items: center;
12 | background-color: ${props => props.theme.SECONDARY_BACKGROUND_COLOR};
13 | `
14 | export const ActivityIndicator = styled.ActivityIndicator.attrs({
15 | size: 'large',
16 | color: Colors.GREEN,
17 | })``
18 |
19 | export const Title = styled.Text`
20 | color: ${({ theme }) => theme.SECONDARY_TEXT_COLOR};
21 | ${TextRegular};
22 | `
23 |
--------------------------------------------------------------------------------
/src/screens/productDetail/components/productInfo/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import * as S from './styled'
4 |
5 | const ProductInfo = ({ info }) => {
6 | return (
7 |
8 | {/* (HOT) Termogênico 60 comprimidos */}
9 | {info.name}
10 | Detalhes
11 | {info.details.description}
12 | {/*
13 | Funciona da seguinte forma, o seu organismo já possui naturalmente uma
14 | necessidade por calorias.
15 | */}
16 |
17 | )
18 | }
19 |
20 | export default ProductInfo
21 |
--------------------------------------------------------------------------------
/src/utils/index.js:
--------------------------------------------------------------------------------
1 | import httpClient from './httpClient'
2 | import images from './images'
3 |
4 | export function IDGenerator() {
5 | this.length = 8
6 | this.timestamp = +new Date()
7 |
8 | var _getRandomInt = function(min, max) {
9 | return Math.floor(Math.random() * (max - min + 1)) + min
10 | }
11 |
12 | this.generate = function() {
13 | var ts = this.timestamp.toString()
14 | var parts = ts.split('').reverse()
15 | var id = ''
16 |
17 | for (var i = 0; i < this.length; ++i) {
18 | var index = _getRandomInt(0, parts.length - 1)
19 | id += parts[index]
20 | }
21 |
22 | return id
23 | }
24 | }
25 |
26 | export const delay = (ms = 1000) => new Promise(res => setTimeout(res, ms))
27 |
28 | export { httpClient, images }
29 |
--------------------------------------------------------------------------------
/ios/protain/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/src/screens/home/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 | import { Dimensions } from 'react-native'
3 |
4 | import { TextMediumExtra } from '../../styles/typography'
5 |
6 | const { width, height } = Dimensions.get('window')
7 |
8 | export const Home = styled.ImageBackground`
9 | width: ${width};
10 | height: ${height};
11 | `
12 |
13 | export const Logo = styled.Image`
14 | width: 134px;
15 | height: 106px;
16 | `
17 |
18 | export const Content = styled.View`
19 | padding: ${props => props.theme.metrics.spacing(2.5)};
20 | flex: 1;
21 | justify-content: space-around;
22 | align-items: center;
23 | background-color: ${props => props.theme.SHADOW_COLOR};
24 | `
25 |
26 | export const Description = styled.Text`
27 | color: ${props => props.theme.WHITE};
28 | ${TextMediumExtra};
29 | `
30 |
--------------------------------------------------------------------------------
/src/screens/products/components/listProducts/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { SubTitle as SubTitleStyle } from '../../../../styles/typography'
4 |
5 | export const SubTitle = styled.Text`
6 | ${SubTitleStyle};
7 | padding: ${props => props.theme.metrics.spacing(1.2)};
8 | `
9 |
10 | export const Header = styled.View`
11 | margin-top: ${props => props.theme.metrics.spacing(2)};
12 | margin-bottom: ${props => props.theme.metrics.spacing(1.5)};
13 | padding: ${props => props.theme.metrics.spacing()};
14 | `
15 |
16 | export const LoadingIndicator = styled.ActivityIndicator`
17 | align-self: center;
18 | margin-top: ${props => props.theme.metrics.spacing(2)};
19 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
20 | `
21 |
22 | export const listProduct = {
23 | marginTop: 15,
24 | }
25 |
--------------------------------------------------------------------------------
/ios/protainTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/storybook/index.js:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native'
2 | import { getStorybookUI, configure } from '@storybook/react-native'
3 |
4 | import './rn-addons'
5 |
6 | // import stories
7 | configure(() => {
8 | require('./stories')
9 | }, module)
10 |
11 | // Refer to https://github.com/storybookjs/storybook/tree/master/app/react-native#start-command-parameters
12 | // To find allowed options for getStorybookUI
13 | const StorybookUIRoot = getStorybookUI({
14 | asyncStorage:
15 | require('@react-native-community/async-storage').AsyncStorage ||
16 | require('react-native').AsyncStorage ||
17 | null,
18 | })
19 |
20 | // If you are using React Native vanilla write your app name here.
21 | // If you use Expo you can safely remove this line.
22 | AppRegistry.registerComponent('%APP_NAME%', () => StorybookUIRoot)
23 |
24 | export default StorybookUIRoot
25 |
--------------------------------------------------------------------------------
/ios/protain-tvOSTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/__tests__/__snapshots__/App-test.js.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`examples of some things 1`] = `
4 |
12 |
21 |
22 |
29 |
32 |
35 | Ada Lovelace
36 |
37 |
38 |
39 |
40 | `;
41 |
--------------------------------------------------------------------------------
/src/components/productItem/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import VMasker from 'vanilla-masker'
4 |
5 | import * as S from './styled'
6 |
7 | const ProductItem = ({ product, onPress, itemWidth }) => {
8 | return (
9 | onPress(product.id)}>
10 |
11 | {product.name}
12 | {`R$ ${VMasker.toMoney(product.price)}`}
13 |
14 | )
15 | }
16 |
17 | ProductItem.propTypes = {
18 | product: PropTypes.shape({
19 | id: PropTypes.string,
20 | title: PropTypes.string,
21 | image: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
22 | }),
23 | onPress: PropTypes.func.isRequired,
24 | itemWidth: PropTypes.number.isRequired,
25 | }
26 |
27 | export default ProductItem
28 |
--------------------------------------------------------------------------------
/src/screens/signIn/styled.js:
--------------------------------------------------------------------------------
1 | import { Platform } from 'react-native'
2 | import styled from 'styled-components/native'
3 |
4 | import { Title } from '../../styles/typography'
5 |
6 | export const SignIn = styled.ScrollView`
7 | background-color: ${props => props.theme.SECONDARY_BACKGROUND_COLOR};
8 | `
9 |
10 | export const SignInKeyboardView = styled.KeyboardAvoidingView.attrs({
11 | behavior: Platform.OS === 'ios' ? 'padding' : null,
12 | })`
13 | flex: 1;
14 | `
15 |
16 | export const SignInSafeView = styled.SafeAreaView`
17 | padding-left: ${props => props.theme.metrics.spacing(2)};
18 | padding-right: ${props => props.theme.metrics.spacing(2)};
19 | `
20 | export const TitleSignIn = styled.Text`
21 | ${Title};
22 | text-align: center;
23 | color: ${props => props.theme.WHITE};
24 | margin-top: ${props => props.theme.metrics.spacing(2)};
25 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
26 | `
27 |
--------------------------------------------------------------------------------
/src/screens/signUp/styled.js:
--------------------------------------------------------------------------------
1 | import { Platform } from 'react-native'
2 | import styled from 'styled-components/native'
3 |
4 | import { Title } from '../../styles/typography'
5 |
6 | export const SignUpKeyboardView = styled.KeyboardAvoidingView.attrs({
7 | behavior: Platform.OS === 'ios' ? 'padding' : null,
8 | })`
9 | flex: 1;
10 | `
11 |
12 | export const SignUp = styled.ScrollView`
13 | background-color: ${props => props.theme.SECONDARY_BACKGROUND_COLOR};
14 | `
15 | export const TitleSignUp = styled.Text`
16 | ${Title};
17 | text-align: center;
18 | color: ${props => props.theme.WHITE};
19 | margin-top: ${props => props.theme.metrics.spacing(2)};
20 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
21 | `
22 |
23 | export const SignInSafeView = styled.SafeAreaView`
24 | padding-left: ${props => props.theme.metrics.spacing(2)};
25 | padding-right: ${props => props.theme.metrics.spacing(2)};
26 | `
27 |
--------------------------------------------------------------------------------
/src/components/headers/headerDefault/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
4 |
5 | import NavigationService from '../../../navigation/navigationService'
6 | import * as S from './styled'
7 |
8 | const modeColor = {
9 | light: '#fff',
10 | dark: '#222',
11 | }
12 |
13 | const HeaderDefault = ({ mode }) => {
14 | return (
15 |
16 | {
18 | NavigationService.goBack()
19 | }}
20 | >
21 |
22 |
23 |
24 | )
25 | }
26 |
27 | HeaderDefault.defaultProps = {
28 | mode: 'dark',
29 | }
30 |
31 | HeaderDefault.propTypes = {
32 | mode: PropTypes.oneOf(['dark', 'light']),
33 | }
34 |
35 | export default HeaderDefault
36 |
--------------------------------------------------------------------------------
/src/components/productItem/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextSmallRegular, TextSmallMedium } from '../../styles/typography'
4 |
5 | export const ProductItemTouch = styled.TouchableOpacity`
6 | width: ${props => {
7 | console.log(props.width)
8 | return `${props.width}px`
9 | }};
10 | min-height: 222px;
11 | margin: ${props => props.theme.metrics.spacing(0.5)};
12 | background-color: ${props => props.theme.WHITE};
13 | padding: ${props => props.theme.metrics.spacing()};
14 | align-items: center;
15 | justify-content: space-around;
16 | `
17 |
18 | export const Image = styled.Image`
19 | width: 108px;
20 | height: 134px;
21 | `
22 |
23 | export const Title = styled.Text`
24 | ${TextSmallRegular}
25 | padding-top: ${props => props.theme.metrics.spacing()};
26 | `
27 |
28 | export const Price = styled.Text`
29 | color: ${props => props.theme.GREEN};
30 | align-self: flex-end;
31 | ${TextSmallMedium};
32 | `
33 |
--------------------------------------------------------------------------------
/src/components/button/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | import * as S from './styled'
5 |
6 | const Button = ({ onPress, title, variant, color, fullscreen, ...rest }) => {
7 | return (
8 |
15 |
16 | {title}
17 |
18 |
19 | )
20 | }
21 |
22 | export default Button
23 |
24 | Button.defaultProps = {
25 | children: null,
26 | variant: null,
27 | fullscreen: false,
28 | color: 'primary',
29 | onPress: () => {},
30 | }
31 |
32 | Button.propTypes = {
33 | children: PropTypes.node,
34 | variant: PropTypes.oneOf(['contained', 'outlined']),
35 | color: PropTypes.string,
36 | onPress: PropTypes.func,
37 | fullscreen: PropTypes.bool,
38 | title: PropTypes.string.isRequired,
39 | }
40 |
--------------------------------------------------------------------------------
/.github/workflows/node.js.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3 |
4 | name: Node.js CI
5 |
6 | on:
7 | push:
8 | branches: [ "master" ]
9 | pull_request:
10 | branches: [ "master" ]
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: ubuntu-latest
16 |
17 | strategy:
18 | matrix:
19 | node-version: [18.x, 20.x, 22.x]
20 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21 |
22 | steps:
23 | - uses: actions/checkout@v4
24 | - name: Use Node.js ${{ matrix.node-version }}
25 | uses: actions/setup-node@v4
26 | with:
27 | node-version: ${{ matrix.node-version }}
28 | cache: 'npm'
29 | - run: npm ci
30 | - run: npm run build --if-present
31 | - run: npm test
32 |
--------------------------------------------------------------------------------
/src/screens/storyComponents/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import {
4 | Title as TitleStyle,
5 | SubTitle as SubTitleStyle,
6 | } from '../../styles/typography'
7 |
8 | export const StoryComponent = styled.SafeAreaView`
9 | flex: 1;
10 | background-color: ${props => props.theme.WHITE};
11 | `
12 |
13 | export const StoryHeader = styled.View`
14 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
15 | padding-left: ${props => props.theme.metrics.spacing()};
16 | padding-right: ${props => props.theme.metrics.spacing()};
17 | padding-bottom: ${props => props.theme.metrics.spacing()};
18 | background-color: ${props => props.theme.GREY_DARK};
19 | min-height: 120px;
20 | justify-content: center;
21 | align-items: center;
22 | `
23 |
24 | export const Title = styled.Text`
25 | ${TitleStyle};
26 | color: ${props => props.theme.WHITE};
27 | `
28 | export const SubTitle = styled.Text`
29 | ${SubTitleStyle};
30 | color: ${props => props.theme.WHITE};
31 | `
32 |
--------------------------------------------------------------------------------
/src/screens/trackOrder/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 |
3 | import { NavigationEvents } from 'react-navigation'
4 |
5 | import productService from '../../services/productService'
6 | import Loading from '../../components/loading'
7 | import OrderList from './components/orderList'
8 |
9 | import * as S from './styled'
10 |
11 | const TrackOrder = () => {
12 | const [orders, setOrders] = useState([])
13 | const [loading, setLoading] = useState(false)
14 | const navigateFocus = () => {
15 | async function listOrder() {
16 | setLoading(true)
17 | const { data } = await productService.listOrder()
18 | setLoading(false)
19 | setOrders(data || [])
20 | }
21 | listOrder()
22 | }
23 | return (
24 |
25 |
26 | Lista de pedidos
27 | {loading ? : }
28 |
29 | )
30 | }
31 |
32 | export default TrackOrder
33 |
--------------------------------------------------------------------------------
/src/screens/authLoading/index.js:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from 'react'
2 | import PropTypes from 'prop-types'
3 | import AsyncStorage from '@react-native-community/async-storage'
4 |
5 | import { delay } from '../../utils'
6 | import * as S from './styled'
7 |
8 | const AuthLoading = ({ navigation }) => {
9 | useEffect(() => {
10 | const bootStrapAsync = async () => {
11 | try {
12 | const { navigate } = navigation
13 | await delay(1100)
14 | const useToken = await AsyncStorage.getItem('userToken')
15 | navigate(useToken ? 'App' : 'Auth')
16 | } catch (error) {
17 | console.log(error)
18 | }
19 | }
20 | bootStrapAsync()
21 | })
22 |
23 | return (
24 |
25 |
26 | Aguarde
27 |
28 | )
29 | }
30 |
31 | AuthLoading.propTypes = {
32 | navigation: PropTypes.shape({
33 | navigate: PropTypes.func,
34 | }).isRequired,
35 | }
36 | export default AuthLoading
37 |
--------------------------------------------------------------------------------
/src/screens/products/components/orderProducts/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextSmallRegular, TextRegular } from '../../../../styles/typography'
4 |
5 | export const OrderProducts = styled.View`
6 | flex-direction: row;
7 | justify-content: space-between;
8 | align-items: center;
9 | `
10 |
11 | export const Title = styled.Text`
12 | ${TextSmallRegular}
13 | `
14 |
15 | export const ButtonGroup = styled.View`
16 | flex-direction: row;
17 | justify-content: space-between;
18 | align-items: center;
19 | `
20 |
21 | export const ButtonTouchText = styled.Text`
22 | ${TextRegular};
23 | `
24 | export const ButtonTouch = styled.TouchableOpacity`
25 | padding: ${props => props.theme.metrics.spacing(0.5)};
26 | margin-right: ${props =>
27 | props.separeteRight
28 | ? props.theme.metrics.spacing(props.separeteRight || 1)
29 | : 0};
30 | border: 1px solid ${props => props.theme.GREY_DARK};
31 | border-radius: ${props => props.theme.metrics.spacing(0.8)};
32 | `
33 |
--------------------------------------------------------------------------------
/src/navigation/optionsRouter.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import IconFontAwesome5Pro from 'react-native-vector-icons/FontAwesome'
3 |
4 | import { Colors } from '../styles/variables'
5 |
6 | export const tabBarIcon = ({ tintColor }, routeName) => {
7 | switch (routeName) {
8 | case 'Products':
9 | return
10 | case 'Cart':
11 | return (
12 |
13 | )
14 | case 'TrackOrder':
15 | return
16 | case 'Menu':
17 | return
18 | default:
19 | return
20 | }
21 | }
22 |
23 | export const tabBarOptions = {
24 | activeTintColor: Colors.GREEN,
25 | inactiveTintColor: Colors.WHITE,
26 | style: {
27 | backgroundColor: Colors.SECONDARY_BACKGROUND_COLOR,
28 | height: 56,
29 | paddingVertical: 8,
30 | },
31 | }
32 |
--------------------------------------------------------------------------------
/src/styles/theme.js:
--------------------------------------------------------------------------------
1 | import { Platform } from 'react-native'
2 |
3 | import { Colors } from './variables'
4 |
5 | export const darkTheme = {
6 | mode: 'dark',
7 | ...Colors,
8 | metrics: {
9 | statusBarHeight: Platform.OS === 'ios' ? 20 : 0,
10 | spacing: (multiply = 1) => `${multiply * 10}px`,
11 | },
12 | shadowGeneration: (options = {}) => {
13 | const optionsDefault = {
14 | shadowColor: this.SHADOW_COLOR,
15 | shadowOffset: {
16 | width: 0,
17 | height: 1,
18 | },
19 | shadowOpacity: 0.22,
20 | shadowRadius: 2.22,
21 | elevation: 3,
22 | ...options,
23 | }
24 | return `
25 | shadowColor: ${optionsDefault.shadowColor};
26 | shadowOffset: {
27 | width: ${optionsDefault.shadowOffset.width};
28 | height: ${optionsDefault.shadowOffset.height};
29 | };
30 | shadowOpacity: ${optionsDefault.shadowOpacity};
31 | shadowRadius: ${optionsDefault.shadowRadius};
32 | elevation: ${optionsDefault.elevation};
33 | `
34 | },
35 | }
36 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 |
24 | # Android/IntelliJ
25 | #
26 | build/
27 | .idea
28 | .gradle
29 | local.properties
30 | *.iml
31 |
32 | # node.js
33 | #
34 | node_modules/
35 | npm-debug.log
36 | yarn-error.log
37 |
38 | # BUCK
39 | buck-out/
40 | \.buckd/
41 | *.keystore
42 | !debug.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
58 | # CocoaPods
59 | /ios/Pods/
60 |
--------------------------------------------------------------------------------
/src/screens/trackOrder/components/orderList/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextRegularMedium } from '../../../../styles/typography'
4 |
5 | export const OrderItem = styled.View`
6 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
7 | `
8 |
9 | export const OrderProduct = styled.View`
10 | flex-direction: row;
11 | justify-content: space-between;
12 | `
13 |
14 | export const OrderProductInfo = styled.View`
15 | flex: 1;
16 | padding-left: ${props => props.theme.metrics.spacing(1.5)};
17 | `
18 |
19 | export const OrderTitle = styled.Text`
20 | ${TextRegularMedium}
21 | color: ${props => props.theme.GREY_DARK};
22 | `
23 |
24 | export const OrderImage = styled.Image`
25 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
26 | width: 54px;
27 | height: 66px;
28 | `
29 |
30 | export const DividerButton = styled.View`
31 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
32 | `
33 |
34 | export const OrderList = styled.ScrollView.attrs({
35 | contentContainerStyle: {
36 | padding: 10,
37 | },
38 | })``
39 |
--------------------------------------------------------------------------------
/src/components/textField/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { TextSmall, TextRegular } from '../../styles/typography'
4 |
5 | export const TextField = styled.View`
6 | color: ${props => props.theme.PRIMARY_TEXT_COLOR};
7 | margin-bottom: ${props => props.theme.metrics.spacing(2.5)};
8 | ${TextRegular};
9 | width: 100%;
10 | `
11 | export const Label = styled.Text`
12 | ${TextRegular};
13 | margin-bottom: ${props => props.theme.metrics.spacing(0.3)};
14 | `
15 | export const TextInput = styled.TextInput`
16 | background-color: ${props => props.theme.WHITE};
17 | color: ${props => props.theme.PRIMARY_TEXT_COLOR};
18 | min-height: 46px;
19 | border-radius: 8px;
20 | margin-bottom: ${props => props.theme.metrics.spacing(0.3)};
21 | padding-left: ${props => props.theme.metrics.spacing()};
22 | padding-right: ${props => props.theme.metrics.spacing()};
23 | border: 1px solid ${props => props.theme.GREY_DARK};
24 | `
25 | export const TextHelper = styled.Text`
26 | color: ${props =>
27 | props.error ? props.theme.ERROR : props.theme.PRIMARY_TEXT_COLOR};
28 | ${TextSmall};
29 | `
30 |
--------------------------------------------------------------------------------
/src/screens/products/components/orderProducts/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | import * as S from './styled'
5 |
6 | const OrderProducts = ({ onAlphabet, onLowestPrice, onClear }) => {
7 | return (
8 |
9 | Ordenar por
10 |
11 | onAlphabet('alphabet')}>
12 | Alfabeto
13 |
14 | onLowestPrice('lowestPrice')}
17 | >
18 | Menor Preço
19 |
20 | onClear('')}>
21 | Limpar
22 |
23 |
24 |
25 | )
26 | }
27 |
28 | OrderProducts.propTypes = {
29 | onAlphabet: PropTypes.func.isRequired,
30 | onLowestPrice: PropTypes.func.isRequired,
31 | onClear: PropTypes.func.isRequired,
32 | }
33 | export default OrderProducts
34 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "28.0.3"
6 | minSdkVersion = 16
7 | compileSdkVersion = 28
8 | targetSdkVersion = 28
9 | }
10 | repositories {
11 | google()
12 | jcenter()
13 | }
14 | dependencies {
15 | classpath("com.android.tools.build:gradle:3.4.2")
16 |
17 | // NOTE: Do not place your application dependencies here; they belong
18 | // in the individual module build.gradle files
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | mavenLocal()
25 | maven {
26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27 | url("$rootDir/../node_modules/react-native/android")
28 | }
29 | maven {
30 | // Android JSC is installed from npm
31 | url("$rootDir/../node_modules/jsc-android/dist")
32 | }
33 |
34 | google()
35 | jcenter()
36 | maven { url 'https://jitpack.io' }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useAndroidX=true
21 | android.enableJetifier=true
22 |
23 | PROTAINFULL_RELEASE_STORE_FILE=protainfull.keystore
24 | PROTAINFULL_RELEASE_KEY_ALIAS=protainfull
25 | PROTAINFULL_RELEASE_STORE_PASSWORD=123456
26 | PROTAINFULL_RELEASE_KEY_PASSWORD=123456
27 |
--------------------------------------------------------------------------------
/src/screens/home/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import { SafeAreaView } from 'react-native'
4 |
5 | import images from '../../utils/images'
6 | import Button from '../../components/button'
7 | import * as S from './styled'
8 |
9 | const Home = ({ navigation }) => {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 | Encontre os melhores produtos com os melhores preços
17 |
18 |
31 |
32 |
33 | )
34 | }
35 |
36 | Home.propTypes = {
37 | navigation: PropTypes.shape({
38 | navigate: PropTypes.func,
39 | }),
40 | }
41 |
42 | export default Home
43 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/screens/trackOrder/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { Title as TitleStyle, TextRegularMedium } from '../../styles/typography'
4 |
5 | export const TrackOrder = styled.SafeAreaView`
6 | flex: 1;
7 | `
8 |
9 | export const Title = styled.Text`
10 | ${TitleStyle};
11 | padding-top: ${props => props.theme.metrics.spacing()};
12 | padding-bottom: ${props => props.theme.metrics.spacing(2)};
13 | text-align: center;
14 | `
15 |
16 | export const OrderItem = styled.View`
17 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
18 | `
19 |
20 | export const OrderProduct = styled.View`
21 | flex-direction: row;
22 | justify-content: space-between;
23 | `
24 |
25 | export const OrderProductInfo = styled.View`
26 | flex: 1;
27 | padding-left: ${props => props.theme.metrics.spacing(1.5)};
28 | `
29 |
30 | export const OrderTitle = styled.Text`
31 | ${TextRegularMedium}
32 | color: ${props => props.theme.GREY_DARK};
33 | `
34 |
35 | export const OrderImage = styled.Image`
36 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
37 | width: 54px;
38 | height: 66px;
39 | `
40 |
41 | export const DividerButton = styled.View`
42 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
43 | `
44 |
--------------------------------------------------------------------------------
/src/components/button/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 |
3 | import { fontFamily, fontSize, fontWeight } from '../../styles/fonts'
4 |
5 | export const ButtonText = styled.Text`
6 | color: ${props =>
7 | (props.variant === 'outlined' && props.theme.PRIMARY_BUTTON_COLOR) ||
8 | (props.color === 'primary' && props.theme.PRIMARY_TEXT_COLOR) ||
9 | (props.color === 'secondary' && props.theme.SECONDARY_TEXT_COLOR)};
10 | font-family: ${fontFamily.RobotoMedium};
11 | font-size: ${fontSize.medium};
12 | font-weight: ${fontWeight.medium};
13 | `
14 |
15 | export const Button = styled.TouchableOpacity`
16 | width: ${props => (props.fullscreen ? '100%' : 'auto')};
17 | background: ${props => {
18 | if (props.disabled) {
19 | return props.theme.INACTIVE
20 | }
21 | return props.variant === 'contained'
22 | ? props.theme.PRIMARY_BUTTON_COLOR
23 | : 'transparent'
24 | }};
25 | border: ${props =>
26 | props.variant === 'outlined'
27 | ? `2px solid ${props.theme.PRIMARY_BUTTON_COLOR}`
28 | : 'none'};
29 | padding: 10px;
30 | justify-content: center;
31 | align-items: center;
32 | border-radius: 8px;
33 | `
34 | // (props.variant === 'outlined' && props.theme.PRIMARY_BUTTON_COLOR) ||
35 |
--------------------------------------------------------------------------------
/src/components/textField/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | import * as S from './styled'
5 |
6 | const TextField = ({
7 | onChangeText,
8 | name,
9 | value,
10 | placeholder,
11 | keyboardType,
12 | label,
13 | error,
14 | textHelper,
15 | ...rest
16 | }) => {
17 | return (
18 |
19 | {label && {label}}
20 |
29 | {textHelper && {textHelper}}
30 |
31 | )
32 | }
33 |
34 | TextField.defaultProps = {
35 | onChangeText: () => {},
36 | keyboardType: 'default',
37 | value: '',
38 | label: null,
39 | textHelper: null,
40 | error: false,
41 | }
42 | TextField.propTypes = {
43 | onChangeText: PropTypes.func,
44 | value: PropTypes.string,
45 | keyboardType: PropTypes.string,
46 | label: PropTypes.string,
47 | name: PropTypes.string.isRequired,
48 | error: PropTypes.bool,
49 | textHelper: PropTypes.string,
50 | }
51 | export default TextField
52 |
--------------------------------------------------------------------------------
/src/screens/menu/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import { SafeAreaView, View, ScrollView } from 'react-native'
4 | import AsyncStorage from '@react-native-community/async-storage'
5 |
6 | import * as S from './styled'
7 |
8 | const Menu = ({ navigation }) => {
9 | const { navigate } = navigation
10 |
11 | const handleLogout = async () => {
12 | await AsyncStorage.removeItem('userToken')
13 | navigate('Auth')
14 | }
15 |
16 | const handleStory = async () => {
17 | navigate('StoryComponents')
18 | }
19 |
20 | return (
21 |
22 |
23 |
24 | Conta
25 |
26 | Sair
27 |
28 |
29 |
30 | For Developer
31 |
32 | Storybook Components
33 |
34 |
35 |
36 |
37 | )
38 | }
39 |
40 | Menu.propTypes = {
41 | navigation: PropTypes.shape({
42 | navigate: PropTypes.func,
43 | }).isRequired,
44 | }
45 |
46 | export default Menu
47 |
--------------------------------------------------------------------------------
/src/__tests__/App-test.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Button, Text, TextInput, View } from 'react-native'
3 | import { fireEvent, render, wait } from '@testing-library/react-native'
4 | import 'utils/test-utils'
5 |
6 | function Example() {
7 | const [name, setUser] = React.useState('')
8 | const [show, setShow] = React.useState(false)
9 |
10 | return (
11 |
12 |
13 | {
16 | setTimeout(() => {
17 | setShow(!show)
18 | }, Math.floor(Math.random() * 200))
19 | }}
20 | />
21 | {show && {name}}
22 |
23 | )
24 | }
25 |
26 | test('examples of some things', async () => {
27 | // Test to confirm if the switch test run
28 | const { getByTestId, getByText, queryByTestId, baseElement } = render(
29 | ,
30 | )
31 | const famousWomanInHistory = 'Jeftar'
32 |
33 | const input = getByTestId('input')
34 | fireEvent.changeText(input, famousWomanInHistory)
35 |
36 | const button = getByText('Print Username')
37 | fireEvent.press(button)
38 |
39 | await wait(() => expect(queryByTestId('printed-username')).toBeTruthy())
40 |
41 | expect(getByTestId('printed-username').props.children).toBe(
42 | famousWomanInHistory,
43 | )
44 | expect(baseElement).toMatchSnapshot()
45 | })
46 |
--------------------------------------------------------------------------------
/android/app/BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12 |
13 | lib_deps = []
14 |
15 | create_aar_targets(glob(["libs/*.aar"]))
16 |
17 | create_jar_targets(glob(["libs/*.jar"]))
18 |
19 | android_library(
20 | name = "all-libs",
21 | exported_deps = lib_deps,
22 | )
23 |
24 | android_library(
25 | name = "app-code",
26 | srcs = glob([
27 | "src/main/java/**/*.java",
28 | ]),
29 | deps = [
30 | ":all-libs",
31 | ":build_config",
32 | ":res",
33 | ],
34 | )
35 |
36 | android_build_config(
37 | name = "build_config",
38 | package = "com.protain",
39 | )
40 |
41 | android_resource(
42 | name = "res",
43 | package = "com.protain",
44 | res = "src/main/res",
45 | )
46 |
47 | android_binary(
48 | name = "app",
49 | keystore = "//android/keystores:debug",
50 | manifest = "src/main/AndroidManifest.xml",
51 | package_type = "debug",
52 | deps = [
53 | ":app-code",
54 | ],
55 | )
56 |
--------------------------------------------------------------------------------
/ios/protain/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 | #import
13 |
14 | @implementation AppDelegate
15 |
16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
17 | {
18 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
19 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
20 | moduleName:@"protain"
21 | initialProperties:nil];
22 |
23 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
24 |
25 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
26 | UIViewController *rootViewController = [UIViewController new];
27 | rootViewController.view = rootView;
28 | self.window.rootViewController = rootViewController;
29 | [self.window makeKeyAndVisible];
30 | return YES;
31 | }
32 |
33 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
34 | {
35 | #if DEBUG
36 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
37 | #else
38 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
39 | #endif
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/src/screens/signIn/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 | import PropTypes from 'prop-types'
3 | import { Alert } from 'react-native'
4 | import AsyncStorage from '@react-native-community/async-storage'
5 |
6 | import authService from '../../services/authService'
7 | import SignInForm from './components/signInForm'
8 | import { HeaderDefault } from '../../components/headers'
9 | import * as S from './styled'
10 |
11 | const SignIn = ({ navigation }) => {
12 | const [loading, setLoading] = useState(false)
13 | const signInSubmit = async (values, { resetForm }) => {
14 | try {
15 | setLoading(true)
16 | const { data } = await authService.login(values)
17 | await AsyncStorage.setItem('userToken', data.token)
18 | setLoading(false)
19 | resetForm()
20 | navigation.navigate('App')
21 | } catch ({ response }) {
22 | setLoading(false)
23 | if (response) {
24 | const { data } = response
25 | Alert.alert('Informação', data.error)
26 | }
27 | }
28 | }
29 |
30 | return (
31 |
32 |
33 |
34 |
35 | Login
36 |
37 |
38 |
39 |
40 | )
41 | }
42 |
43 | SignIn.propTypes = {
44 | navigation: PropTypes.shape({
45 | navigate: PropTypes.func,
46 | }).isRequired,
47 | }
48 | export default SignIn
49 |
--------------------------------------------------------------------------------
/src/screens/signUp/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 | import PropTypes from 'prop-types'
3 | import { Alert } from 'react-native'
4 | import AsyncStorage from '@react-native-community/async-storage'
5 |
6 | import authService from '../../services/authService'
7 | import { HeaderDefault } from '../../components/headers'
8 | import SignUpForm from './components/signUpForm'
9 | import * as S from './styled'
10 |
11 | const SignUp = ({ navigation }) => {
12 | const [loading, setLoading] = useState(false)
13 | const signUpSubmit = async (values, { resetForm }) => {
14 | try {
15 | setLoading(true)
16 | const { data } = await authService.register(values)
17 | await AsyncStorage.setItem('userToken', data.token)
18 | setLoading(false)
19 | Alert.alert('Sucesso', 'Cadastro efetuado com sucesso.')
20 | resetForm()
21 | navigation.navigate('App')
22 | } catch ({ response }) {
23 | setLoading(false)
24 | if (response) {
25 | const { data } = response
26 | Alert.alert('Informação', data.error)
27 | }
28 | }
29 | }
30 |
31 | return (
32 |
33 |
34 |
35 |
36 | Cadastro
37 |
38 |
39 |
40 |
41 | )
42 | }
43 |
44 | SignUp.propTypes = {
45 | navigation: PropTypes.shape({
46 | navigate: PropTypes.func,
47 | }).isRequired,
48 | }
49 |
50 | export default SignUp
51 |
--------------------------------------------------------------------------------
/ios/protain-tvOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSAppTransportSecurity
26 |
27 | NSExceptionDomains
28 |
29 | localhost
30 |
31 | NSExceptionAllowsInsecureHTTPLoads
32 |
33 |
34 |
35 |
36 | NSLocationWhenInUseUsageDescription
37 |
38 | UILaunchStoryboardName
39 | LaunchScreen
40 | UIRequiredDeviceCapabilities
41 |
42 | armv7
43 |
44 | UISupportedInterfaceOrientations
45 |
46 | UIInterfaceOrientationPortrait
47 | UIInterfaceOrientationLandscapeLeft
48 | UIInterfaceOrientationLandscapeRight
49 |
50 | UIViewControllerBasedStatusBarAppearance
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/src/styles/typography.js:
--------------------------------------------------------------------------------
1 | import * as fonts from './fonts'
2 |
3 | export const TextSmall = `
4 | font-size: ${fonts.fontSize.small};
5 | font-family: ${fonts.fontFamily.RobotoThin};
6 | font-weight: ${fonts.fontWeight.thin};
7 | `
8 |
9 | export const TextSmallRegular = `
10 | font-size: ${fonts.fontSize.small};
11 | font-family: ${fonts.fontFamily.RobotoRegular};
12 | font-weight: ${fonts.fontWeight.regular};
13 | `
14 |
15 | export const TextSmallMedium = `
16 | font-size: ${fonts.fontSize.medium};
17 | font-family: ${fonts.fontFamily.RobotoMedium};
18 | font-weight: ${fonts.fontWeight.medium};
19 | `
20 |
21 | export const TextRegular = `
22 | font-size: ${fonts.fontSize.regular};
23 | font-family: ${fonts.fontFamily.RobotoRegular};
24 | font-weight: ${fonts.fontWeight.regular};
25 | `
26 |
27 | export const TextMediumBold = `
28 | font-size: ${fonts.fontSize.medium};
29 | font-family: ${fonts.fontFamily.RobotoBold};
30 | font-weight: ${fonts.fontWeight.bold};
31 | `
32 |
33 | export const TextRegularMedium = `
34 | font-size: ${fonts.fontSize.regular};
35 | font-family: ${fonts.fontFamily.RobotoMedium};
36 | font-weight: ${fonts.fontWeight.medium};
37 | `
38 |
39 | export const TextMedium = `
40 | font-size: ${fonts.fontSize.medium};
41 | font-family: ${fonts.fontFamily.RobotoMedium};
42 | font-weight: ${fonts.fontWeight.medium};
43 | `
44 |
45 | export const TextMediumExtra = `
46 | font-size: ${fonts.fontSize.extra};
47 | font-family: ${fonts.fontFamily.RobotoMedium};
48 | font-weight: ${fonts.fontWeight.medium};
49 | `
50 |
51 | export const Title = `
52 | font-size: ${fonts.fontSize.big};
53 | font-family: ${fonts.fontFamily.RobotoRegular};
54 | font-weight: ${fonts.fontWeight.regular};
55 | `
56 |
57 | export const SubTitle = `
58 | font-size: ${fonts.fontSize.medium};
59 | font-family: ${fonts.fontFamily.RobotoRegular};
60 | font-weight: ${fonts.fontWeight.regular};
61 | `
62 |
--------------------------------------------------------------------------------
/src/redux/docks/cart.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 |
3 | import { Types as TypeProducts, getProduct } from './products'
4 |
5 | export const Types = {
6 | REQUEST: 'cart/REQUEST',
7 | EMPTY: 'cart/EMPTY',
8 | CHECKOUT_REQUEST: 'cart/CHECKOUT_REQUEST',
9 | CHECKOUT_SUCCESS: 'cart/CHECKOUT_SUCCESS',
10 | CHECKOUT_FAILURE: 'cart/CHECKOUT_FAILURE',
11 | }
12 |
13 | const initialState = {
14 | quantityById: {},
15 | }
16 |
17 | function quantityById(state = initialState.quantityById, action) {
18 | const { productId } = action
19 | switch (action.type) {
20 | case Types.CHECKOUT_SUCCESS:
21 | return initialState.quantityById
22 | case TypeProducts.ADD:
23 | return {
24 | ...state,
25 | [productId]: (state[productId] || 0) + 1,
26 | }
27 | case TypeProducts.REMOVE:
28 | const qty = (state[productId] || 0) - 1
29 | const copy = { ...state }
30 | console.log('COPY REMOVE: ', copy[productId])
31 | if (qty > 0) {
32 | copy[productId] = qty
33 | } else {
34 | delete copy[productId]
35 | }
36 | return copy
37 | default:
38 | return state
39 | }
40 | }
41 |
42 | export default combineReducers({
43 | quantityById,
44 | })
45 |
46 | export const clearCart = (id = 1) => {
47 | return {
48 | type: Types.EMPTY,
49 | }
50 | }
51 |
52 | export function getQuantity(state, productId) {
53 | return state.quantityById[productId] || 0
54 | }
55 |
56 | export function getAddedIds(state) {
57 | return Object.keys(state.quantityById)
58 | }
59 |
60 | export function getCart(state) {
61 | return state.cart
62 | }
63 |
64 | export function getTotal(state) {
65 | return getAddedIds(state.cart)
66 | .reduce(
67 | (total, id) =>
68 | total +
69 | getProduct(state.products, id).price * getQuantity(state.cart, id),
70 | 0,
71 | )
72 | .toFixed(2)
73 | }
74 |
75 | export function getCartProducts(state) {
76 | return getAddedIds(state.cart).map(id => ({
77 | ...getProduct(state.products, id),
78 | quantity: getQuantity(state.cart, id),
79 | }))
80 | }
81 |
--------------------------------------------------------------------------------
/src/screens/products/components/listProducts/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useCallback } from 'react'
2 | import PropTypes from 'prop-types'
3 | import { FlatList, Dimensions } from 'react-native'
4 | import { connect } from 'react-redux'
5 |
6 | import { setProductId } from '../../../../redux/docks/products'
7 | import ProductItem from '../../../../components/productItem'
8 | import { NavigationService } from '../../../../navigation'
9 | import * as S from './styled'
10 |
11 | const columns = 2
12 | const ITEM_WIDTH = Dimensions.get('window').width
13 |
14 | const ListProducts = ({ products, setProduct, loading }) => {
15 | const [selected, setSelected] = useState(new Map())
16 |
17 | const onSelect = useCallback(
18 | id => {
19 | const newSelected = new Map(selected)
20 | newSelected.set(id, !selected.get(id))
21 | setProduct(id)
22 | NavigationService.navigate('ProductDetail', { id })
23 | setSelected(newSelected)
24 | },
25 | [selected, setProduct],
26 | )
27 |
28 | const productLoding = () => (
29 | <>
30 |
31 | >
32 | )
33 | const renderList = () => {
34 | return products.length ? (
35 | (
39 |
44 | )}
45 | horizontal={false}
46 | numColumns={columns}
47 | keyExtractor={item => item.id}
48 | extraData={selected}
49 | />
50 | ) : (
51 | Nenhum produto encontrado :(
52 | )
53 | }
54 | return loading ? productLoding() : renderList()
55 | }
56 |
57 | ListProducts.defaultProps = {
58 | products: [],
59 | loading: false,
60 | }
61 | ListProducts.propTypes = {
62 | products: PropTypes.arrayOf(PropTypes.object),
63 | loading: PropTypes.bool,
64 | setProduct: PropTypes.func.isRequired,
65 | }
66 |
67 | export default connect(null, { setProduct: setProductId })(ListProducts)
68 |
--------------------------------------------------------------------------------
/src/screens/products/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useCallback } from 'react'
2 | import { connect } from 'react-redux'
3 |
4 | import {
5 | getProducts as getProductsAction,
6 | getVisibleProducts,
7 | } from '../../redux/docks/products'
8 | import TextField from '../../components/textField'
9 | import ListProducts from './components/listProducts'
10 | import OrderProducts from './components/orderProducts'
11 | import * as S from './styled'
12 |
13 | const Products = ({ getProducts, products }) => {
14 | const [searchValue, setSearchValue] = useState('')
15 | const [typeSort, setTypeSort] = useState('')
16 |
17 | const listProducts = useCallback(
18 | (type = '', search = '') => {
19 | getProducts(type, search)
20 | },
21 | [getProducts],
22 | )
23 |
24 | const handleOrderAlphabet = type => {
25 | setTypeSort(type)
26 | listProducts(type)
27 | }
28 |
29 | const handleOrderLowestPrice = type => {
30 | setTypeSort(type)
31 | listProducts(type)
32 | }
33 |
34 | const handleOrderClear = type => {
35 | setTypeSort(type)
36 | listProducts(type)
37 | }
38 |
39 | const handleSearchProducts = (value = '') => {
40 | listProducts(typeSort, value)
41 | }
42 |
43 | return (
44 |
45 |
46 | Lista de produtos
47 | {
51 | handleSearchProducts(text)
52 | setSearchValue(text)
53 | }}
54 | value={searchValue}
55 | />
56 |
61 |
62 |
63 |
64 | )
65 | }
66 |
67 | const mapStateToProps = state => {
68 | return {
69 | products: getVisibleProducts(state.products),
70 | }
71 | }
72 |
73 | export default connect(mapStateToProps, {
74 | getProducts: getProductsAction,
75 | })(Products)
76 |
--------------------------------------------------------------------------------
/ios/protainTests/protainTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | #import
12 | #import
13 |
14 | #define TIMEOUT_SECONDS 600
15 | #define TEXT_TO_LOOK_FOR @"Welcome to React"
16 |
17 | @interface protainTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation protainTests
22 |
23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
24 | {
25 | if (test(view)) {
26 | return YES;
27 | }
28 | for (UIView *subview in [view subviews]) {
29 | if ([self findSubviewInView:subview matching:test]) {
30 | return YES;
31 | }
32 | }
33 | return NO;
34 | }
35 |
36 | - (void)testRendersWelcomeScreen
37 | {
38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
40 | BOOL foundElement = NO;
41 |
42 | __block NSString *redboxError = nil;
43 | #ifdef DEBUG
44 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
45 | if (level >= RCTLogLevelError) {
46 | redboxError = message;
47 | }
48 | });
49 | #endif
50 |
51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
54 |
55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
57 | return YES;
58 | }
59 | return NO;
60 | }];
61 | }
62 |
63 | #ifdef DEBUG
64 | RCTSetLogFunction(RCTDefaultLogFunction);
65 | #endif
66 |
67 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
68 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
69 | }
70 |
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/src/screens/signUp/components/signUpForm/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import { View } from 'react-native'
4 | import { useFormik } from 'formik'
5 | import * as Yup from 'yup'
6 |
7 | import TextField from '../../../../components/textField'
8 | import Button from '../../../../components/button'
9 | import { NavigationService } from '../../../../navigation'
10 | import * as S from './styled'
11 |
12 | const signUpSchema = Yup.object().shape({
13 | password: Yup.string().required('Obrigatório'),
14 | email: Yup.string()
15 | .email('E-mail inválido')
16 | .required('Obrigatório'),
17 | })
18 |
19 | const SignUpForm = ({ onPress, loading }) => {
20 | const { handleSubmit, handleChange, values, errors } = useFormik({
21 | initialValues: { email: '', password: '' },
22 | validationSchema: signUpSchema,
23 | onSubmit: onPress,
24 | })
25 | return (
26 |
27 |
37 |
47 |
48 |
56 |
57 | {
59 | NavigationService.navigate('SignIn')
60 | }}
61 | title="Login"
62 | color="secondary"
63 | fullscreen
64 | />
65 |
66 | )
67 | }
68 |
69 | SignUpForm.defaultProps = {
70 | loading: false,
71 | }
72 |
73 | SignUpForm.propTypes = {
74 | onPress: PropTypes.func.isRequired,
75 | loading: PropTypes.bool,
76 | }
77 |
78 | export default SignUpForm
79 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | ; We fork some components by platform
3 | .*/*[.]android.js
4 |
5 | ; Ignore "BUCK" generated dirs
6 | /\.buckd/
7 |
8 | ; Ignore polyfills
9 | node_modules/react-native/Libraries/polyfills/.*
10 |
11 | ; These should not be required directly
12 | ; require from fbjs/lib instead: require('fbjs/lib/warning')
13 | node_modules/warning/.*
14 |
15 | ; Flow doesn't support platforms
16 | .*/Libraries/Utilities/LoadingView.js
17 |
18 | [untyped]
19 | .*/node_modules/@react-native-community/cli/.*/.*
20 |
21 | [include]
22 |
23 | [libs]
24 | node_modules/react-native/Libraries/react-native/react-native-interface.js
25 | node_modules/react-native/flow/
26 |
27 | [options]
28 | emoji=true
29 |
30 | esproposal.optional_chaining=enable
31 | esproposal.nullish_coalescing=enable
32 |
33 | module.file_ext=.js
34 | module.file_ext=.json
35 | module.file_ext=.ios.js
36 |
37 | munge_underscores=true
38 |
39 | module.name_mapper='^react-native$' -> '/node_modules/react-native/Libraries/react-native/react-native-implementation'
40 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1'
41 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub'
42 |
43 | suppress_type=$FlowIssue
44 | suppress_type=$FlowFixMe
45 | suppress_type=$FlowFixMeProps
46 | suppress_type=$FlowFixMeState
47 |
48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
50 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
51 |
52 | [lints]
53 | sketchy-null-number=warn
54 | sketchy-null-mixed=warn
55 | sketchy-number=warn
56 | untyped-type-import=warn
57 | nonstrict-import=warn
58 | deprecated-type=warn
59 | unsafe-getters-setters=warn
60 | inexact-spread=warn
61 | unnecessary-invariant=warn
62 | signature-verification-failure=warn
63 | deprecated-utility=error
64 |
65 | [strict]
66 | deprecated-type
67 | nonstrict-import
68 | sketchy-null
69 | unclear-type
70 | unsafe-getters-setters
71 | untyped-import
72 | untyped-type-import
73 |
74 | [version]
75 | ^0.105.0
76 |
--------------------------------------------------------------------------------
/src/navigation/createRoutes.js:
--------------------------------------------------------------------------------
1 | import { createAppContainer, createSwitchNavigator } from 'react-navigation'
2 | import { createBottomTabNavigator } from 'react-navigation-tabs'
3 | import { createStackNavigator } from 'react-navigation-stack'
4 |
5 | import AuthLoading from '../screens/authLoading'
6 | import Home from '../screens/home'
7 | import SignIn from '../screens/signIn'
8 | import SignUp from '../screens/signUp'
9 | import Products from '../screens/products'
10 | import ProductDetail from '../screens/productDetail'
11 | import TrackOrder from '../screens/trackOrder'
12 | import Cart from '../screens/cart'
13 | import Checkout from '../screens/checkout'
14 | import Menu from '../screens/menu'
15 | import StoryComponents from '../screens/storyComponents'
16 |
17 | import { tabBarIcon, tabBarOptions } from './optionsRouter'
18 |
19 | const AuthStack = createStackNavigator(
20 | {
21 | Home,
22 | SignIn,
23 | SignUp,
24 | },
25 | {
26 | initialRouteName: 'Home',
27 | headerMode: 'none',
28 | },
29 | )
30 |
31 | const MainStack = createBottomTabNavigator(
32 | {
33 | Products: {
34 | screen: Products,
35 | navigationOptions: {
36 | tabBarLabel: 'Produtos',
37 | },
38 | },
39 | Cart: {
40 | screen: Cart,
41 | navigationOptions: {
42 | tabBarLabel: 'Carrinho',
43 | },
44 | },
45 | TrackOrder: {
46 | screen: TrackOrder,
47 | navigationOptions: {
48 | tabBarLabel: 'Meus Pedidos',
49 | },
50 | },
51 | Menu,
52 | },
53 | {
54 | initialRouteName: 'Products',
55 | defaultNavigationOptions: ({ navigation }) => {
56 | const { routeName } = navigation.state
57 | return {
58 | tabBarIcon: options => tabBarIcon(options, routeName),
59 | }
60 | },
61 | tabBarOptions,
62 | },
63 | )
64 |
65 | const AppStack = createStackNavigator(
66 | {
67 | Main: MainStack,
68 | ProductDetail: ProductDetail,
69 | Checkout: Checkout,
70 | StoryComponents: StoryComponents,
71 | },
72 | {
73 | mode: 'modal',
74 | headerMode: 'none',
75 | },
76 | )
77 |
78 | const SwitchApp = createSwitchNavigator(
79 | {
80 | AuthLoading,
81 | Auth: AuthStack,
82 | App: AppStack,
83 | },
84 | {
85 | initialRouteName: 'AuthLoading',
86 | },
87 | )
88 |
89 | const createRootNavigation = createAppContainer(SwitchApp)
90 |
91 | export default createRootNavigation
92 |
--------------------------------------------------------------------------------
/src/screens/signIn/components/signInForm/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 | import { Platform, KeyboardAvoidingView } from 'react-native'
4 | import { useFormik } from 'formik'
5 | import * as Yup from 'yup'
6 |
7 | import TextField from '../../../../components/textField'
8 | import Button from '../../../../components/button'
9 | import { NavigationService } from '../../../../navigation'
10 | import * as S from './styled'
11 |
12 | const signInSchema = Yup.object().shape({
13 | password: Yup.string().required('Obrigatório'),
14 | email: Yup.string()
15 | .email('E-mail inválido')
16 | .required('Obrigatório'),
17 | })
18 |
19 | const SignInForm = ({ onPress, loading }) => {
20 | const { handleSubmit, handleChange, values, errors } = useFormik({
21 | initialValues: { email: '', password: '' },
22 | validationSchema: signInSchema,
23 | onSubmit: onPress,
24 | })
25 | return (
26 |
27 |
37 |
47 |
48 |
56 |
57 | {
59 | NavigationService.navigate('SignUp')
60 | }}
61 | title="Cadastrar"
62 | color="secondary"
63 | fullscreen
64 | />
65 |
66 | )
67 | }
68 |
69 | SignInForm.defaultProps = {
70 | loading: false,
71 | }
72 |
73 | SignInForm.propTypes = {
74 | onPress: PropTypes.func.isRequired,
75 | loading: PropTypes.bool,
76 | }
77 |
78 | export default SignInForm
79 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/protain/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.protain;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.soloader.SoLoader;
10 | import java.lang.reflect.InvocationTargetException;
11 | import java.util.List;
12 |
13 | public class MainApplication extends Application implements ReactApplication {
14 |
15 | private final ReactNativeHost mReactNativeHost =
16 | new ReactNativeHost(this) {
17 | @Override
18 | public boolean getUseDeveloperSupport() {
19 | return BuildConfig.DEBUG;
20 | }
21 |
22 | @Override
23 | protected List getPackages() {
24 | @SuppressWarnings("UnnecessaryLocalVariable")
25 | List packages = new PackageList(this).getPackages();
26 | // Packages that cannot be autolinked yet can be added manually here, for example:
27 | // packages.add(new MyReactNativePackage());
28 | return packages;
29 | }
30 |
31 | @Override
32 | protected String getJSMainModuleName() {
33 | return "index";
34 | }
35 | };
36 |
37 | @Override
38 | public ReactNativeHost getReactNativeHost() {
39 | return mReactNativeHost;
40 | }
41 |
42 | @Override
43 | public void onCreate() {
44 | super.onCreate();
45 | SoLoader.init(this, /* native exopackage */ false);
46 | initializeFlipper(this); // Remove this line if you don't want Flipper enabled
47 | }
48 |
49 | /**
50 | * Loads Flipper in React Native templates.
51 | *
52 | * @param context
53 | */
54 | private static void initializeFlipper(Context context) {
55 | if (BuildConfig.DEBUG) {
56 | try {
57 | /*
58 | We use reflection here to pick up the class that initializes Flipper,
59 | since Flipper library is not available in release mode
60 | */
61 | Class> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
62 | aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
63 | } catch (ClassNotFoundException e) {
64 | e.printStackTrace();
65 | } catch (NoSuchMethodException e) {
66 | e.printStackTrace();
67 | } catch (IllegalAccessException e) {
68 | e.printStackTrace();
69 | } catch (InvocationTargetException e) {
70 | e.printStackTrace();
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/screens/productDetail/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, ScrollView, Alert } from 'react-native'
3 | import PropTypes from 'prop-types'
4 | import VMasker from 'vanilla-masker'
5 | import { connect } from 'react-redux'
6 | import { addToCart, getProduct } from '../../redux/docks/products'
7 |
8 | import Card, { CardBody } from '../../components/card'
9 | import Loading from '../../components/loading'
10 | import Button from '../../components/button'
11 | import { HeaderModal } from '../../components/headers'
12 |
13 | import ProductImage from './components/productImage'
14 | import ProductInfo from './components/productInfo'
15 |
16 | import * as S from './styled'
17 |
18 | const ProductDetail = ({ navigation, addProduct, product }) => {
19 | const id = navigation.getParam('id')
20 |
21 | const handleAddToCart = () => {
22 | addProduct(id)
23 | Alert.alert('Informação', 'Produto adicionado.')
24 | }
25 |
26 | return (
27 |
28 |
29 | {!product.name ? (
30 |
31 | ) : (
32 | <>
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | Valor
42 | {`R$ ${VMasker.toMoney(
43 | product.price,
44 | )}`}
45 |
46 | 0 ? 'Adicionar' : 'Indisponível'}
50 | onPress={handleAddToCart}
51 | />
52 |
53 |
54 |
55 | >
56 | )}
57 |
58 | )
59 | }
60 |
61 | ProductDetail.propTypes = {
62 | addProduct: PropTypes.func.isRequired,
63 | product: PropTypes.shape({
64 | name: PropTypes.string,
65 | price: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
66 | image: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
67 | }).isRequired,
68 | }
69 |
70 | const mapStateToProps = state => {
71 | return {
72 | product: getProduct(
73 | state.products,
74 | state.products.productVisibleId.productId,
75 | ),
76 | }
77 | }
78 |
79 | export default connect(mapStateToProps, { addProduct: addToCart })(
80 | ProductDetail,
81 | )
82 |
--------------------------------------------------------------------------------
/src/screens/trackOrder/components/orderList/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react'
2 | import { Alert } from 'react-native'
3 | import PropTypes from 'prop-types'
4 | import { Text, View } from 'react-native'
5 | import VMasker from 'vanilla-masker'
6 |
7 | import Card, { CardBody, CardHeader } from '../../../../components/card'
8 | import Button from '../../../../components/button'
9 |
10 | import * as S from './styled'
11 |
12 | const OrderList = ({ orders }) => {
13 | const [showDetails, setShowDetails] = useState(false)
14 | return (
15 |
16 | {orders.length ? (
17 | orders.map(orderItem => (
18 |
19 |
20 |
21 | {`Nº ${orderItem.orderNumber}`}
22 | {`Total R$ ${VMasker.toMoney(
23 | orderItem.total,
24 | )}`}
25 |
26 |
27 | {showDetails &&
28 | orderItem.products.map(product => (
29 |
30 |
31 |
32 | {product.name}
33 | {`Valor: R$ ${VMasker.toMoney(
34 | product.price,
35 | )}`}
36 | {`Quantitade: ${product.quantity}`}
37 |
38 |
39 | ))}
40 |
41 |
45 | Alert.alert(
46 | 'Acompanhamento',
47 | 'Seu pedido será entregue em 3 dias úteis',
48 | )
49 | }
50 | />
51 |
52 | setShowDetails(!showDetails)}
56 | />
57 |
58 |
59 |
60 | ))
61 | ) : (
62 |
63 | Nenhuma ordem encontrada
64 |
65 | )}
66 |
67 | )
68 | }
69 |
70 | OrderList.defaultProps = {
71 | orders: [],
72 | }
73 |
74 | OrderList.propTypes = {
75 | orders: PropTypes.arrayOf(PropTypes.object),
76 | }
77 | export default OrderList
78 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '9.0'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | target 'protain' do
5 | # Pods for protain
6 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
7 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
8 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
9 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
10 | pod 'React', :path => '../node_modules/react-native/'
11 | pod 'React-Core', :path => '../node_modules/react-native/'
12 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
13 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
14 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
15 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
16 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
17 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
18 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
19 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
20 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
21 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
22 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
23 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
24 |
25 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
26 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
27 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
28 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
29 | pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
30 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
31 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
32 |
33 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
34 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
35 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
36 |
37 | target 'protainTests' do
38 | inherit! :search_paths
39 | # Pods for testing
40 | end
41 |
42 | use_native_modules!
43 | end
44 |
45 | target 'protain-tvOS' do
46 | # Pods for protain-tvOS
47 |
48 | target 'protain-tvOSTests' do
49 | inherit! :search_paths
50 | # Pods for testing
51 | end
52 |
53 | end
54 |
--------------------------------------------------------------------------------
/src/services/productService.js:
--------------------------------------------------------------------------------
1 | import AsyncStorage from '@react-native-community/async-storage'
2 |
3 | import { products as _products } from '../fake-data'
4 | import { IDGenerator } from '../utils'
5 |
6 | const alphabetNameSort = (data = []) => {
7 | if (!data.length && !data.name) {
8 | return data
9 | }
10 | data.sort(function(a, b) {
11 | if (a.name > b.name) {
12 | return 1
13 | }
14 | if (a.name < b.name) {
15 | return -1
16 | }
17 | // a must be equal to b
18 | return 0
19 | })
20 | return [...data]
21 | }
22 | const lowestPrice = (data = []) => {
23 | if (!!data.length && !!data.price) {
24 | return data
25 | }
26 | data.sort(function(a, b) {
27 | return a.price - b.price
28 | })
29 | return [...data]
30 | }
31 |
32 | const productsSort = type => {
33 | switch (type) {
34 | case 'alphabet':
35 | return alphabetNameSort(_products)
36 | case 'lowestPrice':
37 | return lowestPrice(_products)
38 | default:
39 | return [..._products]
40 | }
41 | }
42 |
43 | const searchProducts = (search = '', data) => {
44 | const response = search.length
45 | ? data.filter(product => product.name.includes(search))
46 | : data
47 |
48 | return response
49 | }
50 |
51 | const fakeRequest = (data, ms = 500) =>
52 | new Promise(resolve => setTimeout(() => resolve(data), ms))
53 |
54 | class ProductService {
55 | static async listProducts({ type, search }) {
56 | const dataSort = productsSort(type)
57 | const data = searchProducts(search, dataSort)
58 | return await fakeRequest({ data })
59 | }
60 |
61 | static productById(id) {
62 | const data = { data: _products.find(product => product.id === id) }
63 | return fakeRequest(data)
64 | }
65 |
66 | static async listOrder() {
67 | const orders = await AsyncStorage.getItem('userOrders')
68 | let data = []
69 | if (orders) {
70 | data = JSON.parse(orders)
71 | }
72 |
73 | return {
74 | data,
75 | }
76 | }
77 |
78 | static async createOrder(products, total) {
79 | try {
80 | const orderNumber = new IDGenerator().generate()
81 | const order = {
82 | orderNumber,
83 | products,
84 | total,
85 | created_at: Date.now(),
86 | }
87 | const orders = await AsyncStorage.getItem('userOrders')
88 | let orderParser = []
89 | if (orders) {
90 | orderParser = JSON.parse(orders)
91 | }
92 | const ordersUpdate = [...orderParser, order]
93 | await AsyncStorage.setItem('userOrders', JSON.stringify(ordersUpdate))
94 |
95 | return { data: { message: 'Pedido realizado com sucesso' } }
96 | } catch (error) {
97 | throw {
98 | data: { message: 'Desculpe houve um erro ao processar o pagamento' },
99 | }
100 | }
101 | }
102 | }
103 |
104 | export default ProductService
105 |
--------------------------------------------------------------------------------
/src/fake-data/index.js:
--------------------------------------------------------------------------------
1 | import uuid from 'uuid/v4'
2 |
3 | import images from '../utils/images'
4 |
5 | export const products = [
6 | {
7 | id: uuid(),
8 | name: 'Termogênico 60 comprimidos',
9 | image: images.productImg01,
10 | thumbimage: images.productThumbImg01,
11 | price: 35.99,
12 | inventory: 3,
13 | details: {
14 | description:
15 | 'Funciona da seguinte forma, o seu organismo já possui naturalmente uma necessidade por calorias. Uma das principais dúvidas de quem deseja investir nesses suplementos é justamente o medo de engordar.',
16 | },
17 | },
18 | {
19 | id: uuid(),
20 | name: 'Blend Vegan - Growth supplements',
21 | image: images.productImg02,
22 | thumbimage: images.productThumbImg02,
23 | price: 102.36,
24 | inventory: 10,
25 | details: {
26 | description:
27 | 'Funciona da seguinte forma, o seu organismo já possui naturalmente uma necessidade por calorias. Uma das principais dúvidas de quem deseja investir nesses suplementos é justamente o medo de engordar.',
28 | },
29 | },
30 | {
31 | id: uuid(),
32 | name: 'Termogênico 60 comprimidos',
33 | image: images.productImg01,
34 | thumbimage: images.productThumbImg01,
35 | price: 159.25,
36 | inventory: 5,
37 | details: {
38 | description:
39 | 'Funciona da seguinte forma, o seu organismo já possui naturalmente uma necessidade por calorias. Uma das principais dúvidas de quem deseja investir nesses suplementos é justamente o medo de engordar.',
40 | },
41 | },
42 | {
43 | id: uuid(),
44 | name: 'Blend Vegan - Growth supplements',
45 | image: images.productImg02,
46 | thumbimage: images.productThumbImg02,
47 | price: 65.12,
48 | inventory: 8,
49 | details: {
50 | description:
51 | 'Funciona da seguinte forma, o seu organismo já possui naturalmente uma necessidade por calorias. Uma das principais dúvidas de quem deseja investir nesses suplementos é justamente o medo de engordar.',
52 | },
53 | },
54 | {
55 | id: uuid(),
56 | name: 'Termogênico 60 comprimidos',
57 | image: images.productImg01,
58 | thumbimage: images.productImg01,
59 | price: 42.33,
60 | inventory: 20,
61 | details: {
62 | description:
63 | 'Funciona da seguinte forma, o seu organismo já possui naturalmente uma necessidade por calorias. Uma das principais dúvidas de quem deseja investir nesses suplementos é justamente o medo de engordar.',
64 | },
65 | },
66 | {
67 | id: uuid(),
68 | name: 'Blend Vegan - Growth supplements',
69 | image: images.productImg02,
70 | thumbimage: images.productImg02,
71 | price: 17.89,
72 | inventory: 16,
73 | details: {
74 | description:
75 | 'Funciona da seguinte forma, o seu organismo já possui naturalmente uma necessidade por calorias. Uma das principais dúvidas de quem deseja investir nesses suplementos é justamente o medo de engordar.',
76 | },
77 | },
78 | ]
79 |
--------------------------------------------------------------------------------
/README.MD:
--------------------------------------------------------------------------------
1 | ## Project React Native with Ecommerce
2 |
3 | This app is simple ecommercer created with React Native.
4 |
5 | This project was bootstrapped with [React Native CLI](https://facebook.github.io/react-native/docs/getting-started).
6 |
7 | ## Available Scripts
8 |
9 | In the project directory, you can run:
10 |
11 | Install modules of project.
12 |
13 | ### `yarn` or `npm install`
14 |
15 | Run your project if have device or emulator
16 |
17 | ### `npx react-native run-android`
18 |
19 | ### `npx react-native run-ios`
20 |
21 | ### `react-native run-android`
22 |
23 | ### `react-native run-ios`
24 |
25 | ### Run Test
26 |
27 | Launches the test runner in the interactive watch mode.
28 |
29 | ### `yarn test` or `npm test`
30 |
31 | Run product app in your smartphone.
32 | ## Generate Build
33 | ### `yarn run build` or `npm run build`
34 |
35 | ## Install app release
36 | ### `yarn run prod` or `npm run prod`
37 |
38 | ## What we use?
39 |
40 | #### Environment
41 |
42 | React Native Storybook - _to tell stories with different behaviors of the component and provide an example page._
43 |
44 | - [Storybook](https://storybook.js.org/) - _Storybook is an open source tool for developing UI components in isolation for React_
45 |
46 | #### Style Guide
47 |
48 | - [EditorConfig](http://editorconfig.org/) - _standardize some general settings among multiple editors_
49 | - [Pretttier](https://prettier.io/) - An opinionated code formatter\*
50 | - [ESLint](http://eslint.org/) - _for reporting the patterns of code_
51 | - **Plugins**
52 | - [@react-native-community JavaScript Style Guide](https://github.com/facebook/react-native/tree/master/packages/eslint-config-react-native-community)
53 | - [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
54 | - [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import)
55 |
56 | #### Tests
57 |
58 | - [Jest](https://github.com/chaijs/chai) - _assertions_
59 | - [Testing Library React](https://testing-library.com/docs/react-testing-library/intro) - _render component_
60 | - [Jsdom](https://github.com/tmpvar/jsdom) - _mock the browser_
61 |
62 | #### Compiler
63 |
64 | - [babel](https://babeljs.io/)
65 | - **Plugins**
66 | - [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver)
67 |
68 | #### Routing System
69 |
70 | - [React Navigation](https://reactnavigation.org/docs/en/getting-started.html) - React Native Routing\*
71 |
72 | #### Css in JS
73 |
74 | - [Styled Components](https://styled-components.com) - Style Components\*
75 |
76 | #### Validation Libs
77 |
78 | - [Formik](https://jaredpalmer.com/formik/docs/overview) - System validation for react\*
79 |
80 | - [Yup](https://github.com/jquense/yup) - Yup is a JavaScript object schema validator and object parser.\*
81 |
82 | #### HTTP Client
83 |
84 | - [axios](https://github.com/axios/axios) - Promise based HTTP client for the browser and node.js\*
85 |
86 | ## Print of app
87 |
88 | coming soon...
89 |
--------------------------------------------------------------------------------
/ios/protain/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | protain
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 | NSExceptionDomains
32 |
33 | localhost
34 |
35 | NSExceptionAllowsInsecureHTTPLoads
36 |
37 |
38 |
39 |
40 | NSLocationWhenInUseUsageDescription
41 |
42 | UILaunchStoryboardName
43 | LaunchScreen
44 | UIRequiredDeviceCapabilities
45 |
46 | armv7
47 |
48 | UISupportedInterfaceOrientations
49 |
50 | UIInterfaceOrientationPortrait
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UIViewControllerBasedStatusBarAppearance
55 |
56 | UIAppFonts
57 |
58 | Roboto-Black.ttf
59 | Roboto-BlackItalic.ttf
60 | Roboto-Bold.ttf
61 | Roboto-BoldItalic.ttf
62 | Roboto-Italic.ttf
63 | Roboto-Light.ttf
64 | Roboto-LightItalic.ttf
65 | Roboto-Medium.ttf
66 | Roboto-MediumItalic.ttf
67 | Roboto-Regular.ttf
68 | Roboto-Thin.ttf
69 | Roboto-ThinItalic.ttf
70 | AntDesign.ttf
71 | Entypo.ttf
72 | EvilIcons.ttf
73 | Feather.ttf
74 | FontAwesome.ttf
75 | FontAwesome5_Brands.ttf
76 | FontAwesome5_Regular.ttf
77 | FontAwesome5_Solid.ttf
78 | Fontisto.ttf
79 | Foundation.ttf
80 | Ionicons.ttf
81 | MaterialCommunityIcons.ttf
82 | MaterialIcons.ttf
83 | Octicons.ttf
84 | SimpleLineIcons.ttf
85 | Zocial.ttf
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "protain",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "start": "react-native start",
9 | "build": "cd android && ./gradlew assembleRelease && cd ..",
10 | "prod": "react-native run-android --variant=release",
11 | "test": "jest",
12 | "lint": "eslint .",
13 | "lint:fix": "eslint . --fix",
14 | "prettier": "prettier --write '*.js'",
15 | "format-code": "npm run prettier && npm run lint:fix",
16 | "storybook": "(adb reverse tcp:7007 tcp:7007 || true) && start-storybook"
17 | },
18 | "dependencies": {
19 | "@react-native-community/async-storage": "^1.7.1",
20 | "@react-native-community/masked-view": "^0.1.5",
21 | "@react-native-community/netinfo": "^5.3.1",
22 | "@react-navigation/native": "^5.0.0-alpha.22",
23 | "@react-navigation/stack": "^5.0.0-alpha.52",
24 | "axios": "^0.19.0",
25 | "babel-loader": "^8.0.6",
26 | "babel-preset-react-native": "^4.0.1",
27 | "formik": "^2.0.8",
28 | "react": "16.9.0",
29 | "react-native": "0.61.5",
30 | "react-native-gesture-handler": "^1.5.3",
31 | "react-native-picker-select": "^6.3.3",
32 | "react-native-reanimated": "^1.4.0",
33 | "react-native-safe-area-context": "^0.6.2",
34 | "react-native-screens": "^2.0.0-alpha.22",
35 | "react-native-vector-icons": "^6.6.0",
36 | "react-navigation": "^4.0.10",
37 | "react-navigation-stack": "^2.0.5",
38 | "react-navigation-tabs": "^2.7.0",
39 | "react-redux": "^7.1.3",
40 | "redux": "^4.0.4",
41 | "redux-saga": "^1.1.3",
42 | "styled-components": "^4.4.1",
43 | "uuid": "^3.3.3",
44 | "vanilla-masker": "^1.2.0",
45 | "yup": "^0.28.0"
46 | },
47 | "devDependencies": {
48 | "@babel/core": "^7.7.7",
49 | "@babel/runtime": "^7.7.7",
50 | "@react-native-community/eslint-config": "^0.0.5",
51 | "@storybook/addon-actions": "^5.3.0-rc.9",
52 | "@storybook/addon-knobs": "^5.3.0-rc.9",
53 | "@storybook/addon-ondevice-knobs": "^5.3.0-rc.9",
54 | "@storybook/addon-ondevice-notes": "^5.3.0-rc.9",
55 | "@storybook/react-native": "^5.3.0-rc.9",
56 | "@storybook/react-native-server": "^5.3.0-rc.9",
57 | "@testing-library/react-native": "^5.0.3",
58 | "@types/jest": "^24.0.24",
59 | "babel-jest": "^24.9.0",
60 | "babel-plugin-module-resolver": "^4.0.0",
61 | "eslint": "^6.8.0",
62 | "eslint-import-resolver-babel-module": "^5.1.0",
63 | "eslint-plugin-import": "^2.19.1",
64 | "eslint-plugin-prettier": "^3.1.2",
65 | "husky": "^3.1.0",
66 | "jest": "^24.9.0",
67 | "jest-styled-components": "^6.3.4",
68 | "metro-react-native-babel-preset": "^0.57.0",
69 | "prettier": "^1.19.1",
70 | "prop-types": "^15.7.2",
71 | "react-native-storybook-loader": "^1.8.1",
72 | "react-test-renderer": "16.9.0",
73 | "typescript": "^3.7.4"
74 | },
75 | "husky": {
76 | "hooks": {
77 | "pre-commit": "npm run format-code"
78 | }
79 | },
80 | "jest": {
81 | "preset": "react-native"
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/redux/docks/products.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 |
3 | export const Types = {
4 | GET_ALL: 'products/GET_ALL',
5 | GET_PRODUCT_ID: 'products/GET_PRODUCT_ID',
6 | CLEAR_PRODUCT_ID: 'products/CLEAR_PRODUCT_ID',
7 | RECEIVE: 'products/RECEIVE',
8 | ADD: 'products/ADD',
9 | REMOVE: 'products/REMOVE',
10 | }
11 |
12 | function products(state, action) {
13 | switch (action.type) {
14 | case Types.ADD:
15 | return {
16 | ...state,
17 | inventory: state.inventory - 1,
18 | }
19 | case Types.REMOVE:
20 | console.log('PRODUCT REMOVE: ', state.inventory)
21 | return {
22 | ...state,
23 | inventory: state.inventory + 1,
24 | }
25 | default:
26 | return state
27 | }
28 | }
29 |
30 | function byId(state = {}, action) {
31 | switch (action.type) {
32 | case Types.RECEIVE:
33 | const mapProductsToObject = action.payload.products.reduce(
34 | (obj, product) => {
35 | obj[product.id] = product
36 | return obj
37 | },
38 | {},
39 | )
40 | return {
41 | ...state,
42 | ...mapProductsToObject,
43 | }
44 | default:
45 | const { productId } = action
46 | if (productId) {
47 | return {
48 | ...state,
49 | [productId]: products(state[productId], action),
50 | }
51 | }
52 | return state
53 | }
54 | }
55 |
56 | function visibleIds(state = [], action) {
57 | switch (action.type) {
58 | case Types.RECEIVE:
59 | return action.payload.products.map(product => product.id)
60 | default:
61 | return state
62 | }
63 | }
64 |
65 | function productVisibleId(state = { productId: '' }, action) {
66 | const { productId } = action
67 | switch (action.type) {
68 | case Types.GET_PRODUCT_ID:
69 | return { ...state, productId }
70 | case Types.CLEAR_PRODUCT_ID:
71 | return { ...state, productId: '' }
72 | default:
73 | return state
74 | }
75 | }
76 |
77 | export default combineReducers({
78 | byId,
79 | visibleIds,
80 | productVisibleId,
81 | })
82 |
83 | export const getProduct = (state, id) => {
84 | return state.byId[id]
85 | }
86 |
87 | export const getVisibleProducts = state =>
88 | state.visibleIds.map(id => getProduct(state, id))
89 |
90 | export const receiveProducts = productsData => {
91 | return {
92 | type: Types.RECEIVE,
93 | payload: { products: productsData },
94 | }
95 | }
96 |
97 | export const setProductId = productId => {
98 | return {
99 | type: Types.GET_PRODUCT_ID,
100 | productId,
101 | }
102 | }
103 | export const clearProductId = productId => {
104 | return {
105 | type: Types.CLEAR_PRODUCT_ID,
106 | }
107 | }
108 |
109 | export const getProducts = (type = '', search = '') => ({
110 | type: Types.GET_ALL,
111 | payload: { type, search },
112 | })
113 |
114 | export const addToCart = productId => {
115 | return {
116 | type: Types.ADD,
117 | productId,
118 | }
119 | }
120 |
121 | export const removeFromCart = productId => {
122 | return {
123 | type: Types.REMOVE,
124 | productId,
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/src/screens/cart/styled.js:
--------------------------------------------------------------------------------
1 | import styled from 'styled-components/native'
2 | import IconMaterial from 'react-native-vector-icons/MaterialCommunityIcons'
3 |
4 | import {
5 | TextSmallRegular,
6 | TextMediumBold,
7 | TextRegularMedium,
8 | Title as TitleStyle,
9 | } from '../../styles/typography'
10 |
11 | export const Cart = styled.SafeAreaView`
12 | flex: 1;
13 | background-color: ${props => props.theme.WHITE};
14 | `
15 |
16 | export const Title = styled.Text`
17 | ${TitleStyle};
18 | padding-top: ${props => props.theme.metrics.spacing()};
19 | padding-bottom: ${props => props.theme.metrics.spacing(2)};
20 | text-align: center;
21 | `
22 |
23 | export const GroupButtons = styled.View`
24 | flex-direction: row;
25 | align-items: center;
26 | margin-top: ${props => props.theme.metrics.spacing(1.5)};
27 | `
28 |
29 | export const IconPlus = styled(IconMaterial).attrs({
30 | name: 'plus',
31 | size: 18,
32 | })`
33 | color: ${props => props.theme.PRIMARY_TEXT_COLOR};
34 | `
35 |
36 | export const IconMinus = styled(IconMaterial).attrs({
37 | name: 'minus',
38 | size: 18,
39 | })`
40 | color: ${props => props.theme.PRIMARY_TEXT_COLOR};
41 | `
42 |
43 | export const IconButton = styled.TouchableOpacity`
44 | width: 32px;
45 | height: 32px;
46 | background-color: ${props =>
47 | props.disabled ? props.theme.TERTIARY_BACKGROUND_COLOR : props.theme.GREEN};
48 | border-radius: 50;
49 | justify-content: center;
50 | align-items: center;
51 | `
52 |
53 | export const CartEmpty = styled.View`
54 | padding: ${props => props.theme.metrics.spacing(2)};
55 | `
56 |
57 | export const CartEmptyText = styled.Text`
58 | ${TextRegularMedium};
59 | align-self: center;
60 | `
61 |
62 | export const ProductContentBuy = styled.SafeAreaView`
63 | flex-direction: row;
64 | align-items: center;
65 | justify-content: space-between;
66 | `
67 |
68 | export const ProductList = styled.ScrollView.attrs({
69 | contentContainerStyle: {
70 | padding: 10,
71 | },
72 | })``
73 |
74 | export const ProductItem = styled.View`
75 | flex-direction: row;
76 | align-items: center;
77 | justify-content: space-between;
78 | margin-bottom: ${props => props.theme.metrics.spacing(2)};
79 | `
80 |
81 | export const ProductItemInfo = styled.View`
82 | padding-bottom: ${props => props.theme.metrics.spacing(0.8)};
83 | border-bottom-width: 1px;
84 | border-bottom-color: ${props => props.theme.GREY_DARK};
85 | flex: 1;
86 | align-self: flex-end;
87 | margin-left: ${props => props.theme.metrics.spacing(1.5)};
88 | `
89 |
90 | export const ProductTitle = styled.Text`
91 | ${TextRegularMedium}
92 | color: ${props => props.theme.GREY_DARK};
93 | `
94 |
95 | export const ProductImage = styled.Image`
96 | width: 54px;
97 | height: 66px;
98 | `
99 |
100 | export const ProductTagText = styled.Text`
101 | ${TextSmallRegular};
102 | color: ${props => props.theme.WHITE};
103 | `
104 |
105 | export const ProductQuantity = styled.Text`
106 | ${TextSmallRegular};
107 | margin-left: ${props => props.theme.metrics.spacing(1)};
108 | margin-right: ${props => props.theme.metrics.spacing(1)};
109 | `
110 |
111 | export const ProductPrice = styled.Text`
112 | ${TextMediumBold};
113 | color: ${props => props.theme.GREEN};
114 | `
115 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/src/screens/cart/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View, Alert } from 'react-native'
3 | import PropTypes from 'prop-types'
4 | import { connect } from 'react-redux'
5 | import VMasker from 'vanilla-masker'
6 |
7 | import { clearCart, getCartProducts, getTotal } from '../../redux/docks/cart'
8 | import { addToCart, removeFromCart } from '../../redux/docks/products'
9 | import productService from '../../services/productService'
10 | import Card, { CardBody } from '../../components/card'
11 | import Button from '../../components/button'
12 | import * as S from './styled'
13 |
14 | const Cart = ({
15 | products,
16 | total,
17 | navigation,
18 | cartEmpty,
19 | addProduct,
20 | removeProduct,
21 | }) => {
22 | const handleFinshCart = async () => {
23 | try {
24 | const { data } = await productService.createOrder(products, total)
25 | cartEmpty()
26 | navigation.navigate('TrackOrder')
27 | Alert.alert('Sucesso', data.message)
28 | } catch (error) {
29 | const { message } = error.data
30 | Alert.alert('Error', message || 'Houver um error no seu pagamento')
31 | }
32 | }
33 | return (
34 |
35 | Carrinho
36 |
37 | {products.length ? (
38 | products.map(product => (
39 |
40 |
41 |
42 | {product.name}
43 | {`R$ ${VMasker.toMoney(
44 | product.price,
45 | )}`}
46 |
47 | addProduct(product.id)}
50 | >
51 |
52 |
53 | {product.quantity}
54 | removeProduct(product.id)}>
55 |
56 |
57 |
58 |
59 |
60 | ))
61 | ) : (
62 |
63 | Nenhum item no carrinho :(
64 |
65 | )}
66 |
67 | {!!total && (
68 |
69 |
70 |
71 |
72 | Total
73 | {`R$ ${VMasker.toMoney(
74 | total,
75 | )}`}
76 |
77 |
82 |
83 |
84 |
85 | )}
86 |
87 | )
88 | }
89 |
90 | Cart.propTypes = {
91 | total: PropTypes.string,
92 | products: PropTypes.arrayOf(PropTypes.object).isRequired,
93 | navigation: PropTypes.shape({
94 | navigate: PropTypes.func,
95 | }).isRequired,
96 | }
97 |
98 | const mapStateTopProps = state => {
99 | return {
100 | products: getCartProducts(state),
101 | total: getTotal(state),
102 | }
103 | }
104 |
105 | export default connect(mapStateTopProps, {
106 | cartEmpty: clearCart,
107 | addProduct: addToCart,
108 | removeProduct: removeFromCart,
109 | })(Cart)
110 |
--------------------------------------------------------------------------------
/ios/protain/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/storybook/stories/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Text } from 'react-native'
3 | import { storiesOf, addDecorator } from '@storybook/react-native'
4 | import { action } from '@storybook/addon-actions'
5 | import { ThemeProvider } from 'styled-components/native'
6 |
7 | import { darkTheme } from '../../src/styles/theme'
8 | import { Container } from '../../src/styles/common'
9 | import Button from '../../src/components/button'
10 | import TextField from '../../src/components/textField'
11 | import Card, {
12 | CardBody,
13 | CardHeader,
14 | CardFooter,
15 | } from '../../src/components/card'
16 |
17 | const decorationTheme = storyFn => (
18 | {storyFn()}
19 | )
20 |
21 | addDecorator(decorationTheme)
22 |
23 | storiesOf('Button', module)
24 | .add('text and primary', () => (
25 |
26 | ))
27 | .add('contained and primary', () => (
28 |
29 |
35 |
36 | ))
37 | .add('contained, primary and fullscreen', () => (
38 |
39 |
46 |
47 | ))
48 | .add('outlined and primary', () => (
49 |
56 | ))
57 | .add('secondary', () => (
58 |
59 |
65 |
66 | ))
67 |
68 | storiesOf('TextField', module)
69 | .add('default', () => (
70 |
71 | ))
72 | .add('phone input', () => (
73 |
79 | ))
80 | .add('password input text help', () => (
81 |
88 | ))
89 | .add('validation input e-mail', () => (
90 |
98 | ))
99 |
100 | storiesOf('Card', module)
101 | .add('default', () => (
102 |
103 |
104 | Card Body
105 |
106 |
107 | ))
108 | .add('body Header', () => (
109 |
110 |
111 | Card Header
112 |
113 |
114 | Card Body
115 |
116 |
117 | ))
118 | .add('body Header and Footer', () => (
119 |
120 |
121 | Card Header
122 |
123 |
124 | Card Body
125 |
126 |
127 | Card Body
128 |
129 |
130 | ))
131 | .add('body Header and Footer', () => (
132 |
133 |
134 | Card Body
135 |
136 |
137 | ))
138 |
--------------------------------------------------------------------------------
/ios/protain.xcodeproj/xcshareddata/xcschemes/protain.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/ios/protain.xcodeproj/xcshareddata/xcschemes/protain-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin, switch paths to Windows format before running java
129 | if $cygwin ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=$((i+1))
158 | done
159 | case $i in
160 | (0) set -- ;;
161 | (1) set -- "$args0" ;;
162 | (2) set -- "$args0" "$args1" ;;
163 | (3) set -- "$args0" "$args1" "$args2" ;;
164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=$(save "$@")
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 | cd "$(dirname "$0")"
186 | fi
187 |
188 | exec "$JAVACMD" "$@"
189 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
22 | * bundleCommand: "ram-bundle",
23 | *
24 | * // whether to bundle JS and assets in debug mode
25 | * bundleInDebug: false,
26 | *
27 | * // whether to bundle JS and assets in release mode
28 | * bundleInRelease: true,
29 | *
30 | * // whether to bundle JS and assets in another build variant (if configured).
31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
32 | * // The configuration property can be in the following formats
33 | * // 'bundleIn${productFlavor}${buildType}'
34 | * // 'bundleIn${buildType}'
35 | * // bundleInFreeDebug: true,
36 | * // bundleInPaidRelease: true,
37 | * // bundleInBeta: true,
38 | *
39 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
40 | * // for example: to disable dev mode in the staging build type (if configured)
41 | * devDisabledInStaging: true,
42 | * // The configuration property can be in the following formats
43 | * // 'devDisabledIn${productFlavor}${buildType}'
44 | * // 'devDisabledIn${buildType}'
45 | *
46 | * // the root of your project, i.e. where "package.json" lives
47 | * root: "../../",
48 | *
49 | * // where to put the JS bundle asset in debug mode
50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
51 | *
52 | * // where to put the JS bundle asset in release mode
53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
54 | *
55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
56 | * // require('./image.png')), in debug mode
57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
58 | *
59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
60 | * // require('./image.png')), in release mode
61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
62 | *
63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67 | * // for example, you might want to remove it from here.
68 | * inputExcludes: ["android/**", "ios/**"],
69 | *
70 | * // override which node gets called and with what additional arguments
71 | * nodeExecutableAndArgs: ["node"],
72 | *
73 | * // supply additional arguments to the packager
74 | * extraPackagerArgs: []
75 | * ]
76 | */
77 |
78 | project.ext.react = [
79 | entryFile: "index.js",
80 | enableHermes: false, // clean and rebuild if changing
81 | ]
82 |
83 | apply from: "../../node_modules/react-native/react.gradle"
84 |
85 | /**
86 | * Set this to true to create two separate APKs instead of one:
87 | * - An APK that only works on ARM devices
88 | * - An APK that only works on x86 devices
89 | * The advantage is the size of the APK is reduced by about 4MB.
90 | * Upload all the APKs to the Play Store and people will download
91 | * the correct one based on the CPU architecture of their device.
92 | */
93 | def enableSeparateBuildPerCPUArchitecture = false
94 |
95 | /**
96 | * Run Proguard to shrink the Java bytecode in release builds.
97 | */
98 | def enableProguardInReleaseBuilds = false
99 |
100 | /**
101 | * The preferred build flavor of JavaScriptCore.
102 | *
103 | * For example, to use the international variant, you can use:
104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
105 | *
106 | * The international variant includes ICU i18n library and necessary data
107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
108 | * give correct results when using with locales other than en-US. Note that
109 | * this variant is about 6MiB larger per architecture than default.
110 | */
111 | def jscFlavor = 'org.webkit:android-jsc:+'
112 |
113 | /**
114 | * Whether to enable the Hermes VM.
115 | *
116 | * This should be set on project.ext.react and mirrored here. If it is not set
117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118 | * and the benefits of using Hermes will therefore be sharply reduced.
119 | */
120 | def enableHermes = project.ext.react.get("enableHermes", false);
121 |
122 | android {
123 | compileSdkVersion rootProject.ext.compileSdkVersion
124 |
125 | compileOptions {
126 | sourceCompatibility JavaVersion.VERSION_1_8
127 | targetCompatibility JavaVersion.VERSION_1_8
128 | }
129 |
130 | defaultConfig {
131 | applicationId "com.protain"
132 | minSdkVersion rootProject.ext.minSdkVersion
133 | targetSdkVersion rootProject.ext.targetSdkVersion
134 | versionCode 1
135 | versionName "1.0"
136 | }
137 | signingConfigs {
138 | release {
139 | if (project.hasProperty('PROTAINFULL_RELEASE_STORE_FILE')) {
140 | storeFile file(PROTAINFULL_RELEASE_STORE_FILE)
141 | storePassword PROTAINFULL_RELEASE_STORE_PASSWORD
142 | keyAlias PROTAINFULL_RELEASE_KEY_ALIAS
143 | keyPassword PROTAINFULL_RELEASE_KEY_PASSWORD
144 | }
145 | }
146 | }
147 | splits {
148 | abi {
149 | reset()
150 | enable enableSeparateBuildPerCPUArchitecture
151 | universalApk false // If true, also generate a universal APK
152 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
153 | }
154 | }
155 | signingConfigs {
156 | debug {
157 | storeFile file('debug.keystore')
158 | storePassword 'android'
159 | keyAlias 'androiddebugkey'
160 | keyPassword 'android'
161 | }
162 | }
163 | buildTypes {
164 | debug {
165 | signingConfig signingConfigs.debug
166 | }
167 | release {
168 | // Caution! In production, you need to generate your own keystore file.
169 | // see https://facebook.github.io/react-native/docs/signed-apk-android.
170 | signingConfig signingConfigs.debug
171 | minifyEnabled enableProguardInReleaseBuilds
172 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
173 |
174 | signingConfig signingConfigs.release
175 | }
176 | }
177 | // applicationVariants are e.g. debug, release
178 | applicationVariants.all { variant ->
179 | variant.outputs.each { output ->
180 | // For each separate APK per architecture, set a unique version code as described here:
181 | // https://developer.android.com/studio/build/configure-apk-splits.html
182 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
183 | def abi = output.getFilter(OutputFile.ABI)
184 | if (abi != null) { // null for the universal-debug, universal-release variants
185 | output.versionCodeOverride =
186 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
187 | }
188 |
189 | }
190 | }
191 | }
192 |
193 | dependencies {
194 | implementation fileTree(dir: "libs", include: ["*.jar"])
195 | implementation "com.facebook.react:react-native:+" // From node_modules
196 | implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
197 | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
198 |
199 |
200 | if (enableHermes) {
201 | def hermesPath = "../../node_modules/hermes-engine/android/";
202 | debugImplementation files(hermesPath + "hermes-debug.aar")
203 | releaseImplementation files(hermesPath + "hermes-release.aar")
204 | } else {
205 | implementation jscFlavor
206 | }
207 | }
208 |
209 | // Run this once to be able to run the application with BUCK
210 | // puts all compile dependencies into folder libs for BUCK to use
211 | task copyDownloadableDepsToLibs(type: Copy) {
212 | from configurations.compile
213 | into 'libs'
214 | }
215 |
216 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
217 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost-for-react-native (1.63.0)
3 | - DoubleConversion (1.1.6)
4 | - FBLazyVector (0.61.5)
5 | - FBReactNativeSpec (0.61.5):
6 | - Folly (= 2018.10.22.00)
7 | - RCTRequired (= 0.61.5)
8 | - RCTTypeSafety (= 0.61.5)
9 | - React-Core (= 0.61.5)
10 | - React-jsi (= 0.61.5)
11 | - ReactCommon/turbomodule/core (= 0.61.5)
12 | - Folly (2018.10.22.00):
13 | - boost-for-react-native
14 | - DoubleConversion
15 | - Folly/Default (= 2018.10.22.00)
16 | - glog
17 | - Folly/Default (2018.10.22.00):
18 | - boost-for-react-native
19 | - DoubleConversion
20 | - glog
21 | - glog (0.3.5)
22 | - RCTRequired (0.61.5)
23 | - RCTTypeSafety (0.61.5):
24 | - FBLazyVector (= 0.61.5)
25 | - Folly (= 2018.10.22.00)
26 | - RCTRequired (= 0.61.5)
27 | - React-Core (= 0.61.5)
28 | - React (0.61.5):
29 | - React-Core (= 0.61.5)
30 | - React-Core/DevSupport (= 0.61.5)
31 | - React-Core/RCTWebSocket (= 0.61.5)
32 | - React-RCTActionSheet (= 0.61.5)
33 | - React-RCTAnimation (= 0.61.5)
34 | - React-RCTBlob (= 0.61.5)
35 | - React-RCTImage (= 0.61.5)
36 | - React-RCTLinking (= 0.61.5)
37 | - React-RCTNetwork (= 0.61.5)
38 | - React-RCTSettings (= 0.61.5)
39 | - React-RCTText (= 0.61.5)
40 | - React-RCTVibration (= 0.61.5)
41 | - React-Core (0.61.5):
42 | - Folly (= 2018.10.22.00)
43 | - glog
44 | - React-Core/Default (= 0.61.5)
45 | - React-cxxreact (= 0.61.5)
46 | - React-jsi (= 0.61.5)
47 | - React-jsiexecutor (= 0.61.5)
48 | - Yoga
49 | - React-Core/CoreModulesHeaders (0.61.5):
50 | - Folly (= 2018.10.22.00)
51 | - glog
52 | - React-Core/Default
53 | - React-cxxreact (= 0.61.5)
54 | - React-jsi (= 0.61.5)
55 | - React-jsiexecutor (= 0.61.5)
56 | - Yoga
57 | - React-Core/Default (0.61.5):
58 | - Folly (= 2018.10.22.00)
59 | - glog
60 | - React-cxxreact (= 0.61.5)
61 | - React-jsi (= 0.61.5)
62 | - React-jsiexecutor (= 0.61.5)
63 | - Yoga
64 | - React-Core/DevSupport (0.61.5):
65 | - Folly (= 2018.10.22.00)
66 | - glog
67 | - React-Core/Default (= 0.61.5)
68 | - React-Core/RCTWebSocket (= 0.61.5)
69 | - React-cxxreact (= 0.61.5)
70 | - React-jsi (= 0.61.5)
71 | - React-jsiexecutor (= 0.61.5)
72 | - React-jsinspector (= 0.61.5)
73 | - Yoga
74 | - React-Core/RCTActionSheetHeaders (0.61.5):
75 | - Folly (= 2018.10.22.00)
76 | - glog
77 | - React-Core/Default
78 | - React-cxxreact (= 0.61.5)
79 | - React-jsi (= 0.61.5)
80 | - React-jsiexecutor (= 0.61.5)
81 | - Yoga
82 | - React-Core/RCTAnimationHeaders (0.61.5):
83 | - Folly (= 2018.10.22.00)
84 | - glog
85 | - React-Core/Default
86 | - React-cxxreact (= 0.61.5)
87 | - React-jsi (= 0.61.5)
88 | - React-jsiexecutor (= 0.61.5)
89 | - Yoga
90 | - React-Core/RCTBlobHeaders (0.61.5):
91 | - Folly (= 2018.10.22.00)
92 | - glog
93 | - React-Core/Default
94 | - React-cxxreact (= 0.61.5)
95 | - React-jsi (= 0.61.5)
96 | - React-jsiexecutor (= 0.61.5)
97 | - Yoga
98 | - React-Core/RCTImageHeaders (0.61.5):
99 | - Folly (= 2018.10.22.00)
100 | - glog
101 | - React-Core/Default
102 | - React-cxxreact (= 0.61.5)
103 | - React-jsi (= 0.61.5)
104 | - React-jsiexecutor (= 0.61.5)
105 | - Yoga
106 | - React-Core/RCTLinkingHeaders (0.61.5):
107 | - Folly (= 2018.10.22.00)
108 | - glog
109 | - React-Core/Default
110 | - React-cxxreact (= 0.61.5)
111 | - React-jsi (= 0.61.5)
112 | - React-jsiexecutor (= 0.61.5)
113 | - Yoga
114 | - React-Core/RCTNetworkHeaders (0.61.5):
115 | - Folly (= 2018.10.22.00)
116 | - glog
117 | - React-Core/Default
118 | - React-cxxreact (= 0.61.5)
119 | - React-jsi (= 0.61.5)
120 | - React-jsiexecutor (= 0.61.5)
121 | - Yoga
122 | - React-Core/RCTSettingsHeaders (0.61.5):
123 | - Folly (= 2018.10.22.00)
124 | - glog
125 | - React-Core/Default
126 | - React-cxxreact (= 0.61.5)
127 | - React-jsi (= 0.61.5)
128 | - React-jsiexecutor (= 0.61.5)
129 | - Yoga
130 | - React-Core/RCTTextHeaders (0.61.5):
131 | - Folly (= 2018.10.22.00)
132 | - glog
133 | - React-Core/Default
134 | - React-cxxreact (= 0.61.5)
135 | - React-jsi (= 0.61.5)
136 | - React-jsiexecutor (= 0.61.5)
137 | - Yoga
138 | - React-Core/RCTVibrationHeaders (0.61.5):
139 | - Folly (= 2018.10.22.00)
140 | - glog
141 | - React-Core/Default
142 | - React-cxxreact (= 0.61.5)
143 | - React-jsi (= 0.61.5)
144 | - React-jsiexecutor (= 0.61.5)
145 | - Yoga
146 | - React-Core/RCTWebSocket (0.61.5):
147 | - Folly (= 2018.10.22.00)
148 | - glog
149 | - React-Core/Default (= 0.61.5)
150 | - React-cxxreact (= 0.61.5)
151 | - React-jsi (= 0.61.5)
152 | - React-jsiexecutor (= 0.61.5)
153 | - Yoga
154 | - React-CoreModules (0.61.5):
155 | - FBReactNativeSpec (= 0.61.5)
156 | - Folly (= 2018.10.22.00)
157 | - RCTTypeSafety (= 0.61.5)
158 | - React-Core/CoreModulesHeaders (= 0.61.5)
159 | - React-RCTImage (= 0.61.5)
160 | - ReactCommon/turbomodule/core (= 0.61.5)
161 | - React-cxxreact (0.61.5):
162 | - boost-for-react-native (= 1.63.0)
163 | - DoubleConversion
164 | - Folly (= 2018.10.22.00)
165 | - glog
166 | - React-jsinspector (= 0.61.5)
167 | - React-jsi (0.61.5):
168 | - boost-for-react-native (= 1.63.0)
169 | - DoubleConversion
170 | - Folly (= 2018.10.22.00)
171 | - glog
172 | - React-jsi/Default (= 0.61.5)
173 | - React-jsi/Default (0.61.5):
174 | - boost-for-react-native (= 1.63.0)
175 | - DoubleConversion
176 | - Folly (= 2018.10.22.00)
177 | - glog
178 | - React-jsiexecutor (0.61.5):
179 | - DoubleConversion
180 | - Folly (= 2018.10.22.00)
181 | - glog
182 | - React-cxxreact (= 0.61.5)
183 | - React-jsi (= 0.61.5)
184 | - React-jsinspector (0.61.5)
185 | - react-native-netinfo (5.3.1):
186 | - React
187 | - react-native-safe-area-context (0.6.2):
188 | - React
189 | - React-RCTActionSheet (0.61.5):
190 | - React-Core/RCTActionSheetHeaders (= 0.61.5)
191 | - React-RCTAnimation (0.61.5):
192 | - React-Core/RCTAnimationHeaders (= 0.61.5)
193 | - React-RCTBlob (0.61.5):
194 | - React-Core/RCTBlobHeaders (= 0.61.5)
195 | - React-Core/RCTWebSocket (= 0.61.5)
196 | - React-jsi (= 0.61.5)
197 | - React-RCTNetwork (= 0.61.5)
198 | - React-RCTImage (0.61.5):
199 | - React-Core/RCTImageHeaders (= 0.61.5)
200 | - React-RCTNetwork (= 0.61.5)
201 | - React-RCTLinking (0.61.5):
202 | - React-Core/RCTLinkingHeaders (= 0.61.5)
203 | - React-RCTNetwork (0.61.5):
204 | - React-Core/RCTNetworkHeaders (= 0.61.5)
205 | - React-RCTSettings (0.61.5):
206 | - React-Core/RCTSettingsHeaders (= 0.61.5)
207 | - React-RCTText (0.61.5):
208 | - React-Core/RCTTextHeaders (= 0.61.5)
209 | - React-RCTVibration (0.61.5):
210 | - React-Core/RCTVibrationHeaders (= 0.61.5)
211 | - ReactCommon/jscallinvoker (0.61.5):
212 | - DoubleConversion
213 | - Folly (= 2018.10.22.00)
214 | - glog
215 | - React-cxxreact (= 0.61.5)
216 | - ReactCommon/turbomodule/core (0.61.5):
217 | - DoubleConversion
218 | - Folly (= 2018.10.22.00)
219 | - glog
220 | - React-Core (= 0.61.5)
221 | - React-cxxreact (= 0.61.5)
222 | - React-jsi (= 0.61.5)
223 | - ReactCommon/jscallinvoker (= 0.61.5)
224 | - RNCAsyncStorage (1.7.1):
225 | - React
226 | - RNCMaskedView (0.1.5):
227 | - React
228 | - RNGestureHandler (1.5.3):
229 | - React
230 | - RNReanimated (1.4.0):
231 | - React
232 | - RNScreens (2.0.0-alpha.22):
233 | - React
234 | - RNVectorIcons (6.6.0):
235 | - React
236 | - Yoga (1.14.0)
237 |
238 | DEPENDENCIES:
239 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
240 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
241 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
242 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
243 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
244 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
245 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
246 | - React (from `../node_modules/react-native/`)
247 | - React-Core (from `../node_modules/react-native/`)
248 | - React-Core/DevSupport (from `../node_modules/react-native/`)
249 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
250 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
251 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
252 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
253 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
254 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
255 | - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
256 | - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
257 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
258 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
259 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
260 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
261 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
262 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
263 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
264 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
265 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
266 | - ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)
267 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
268 | - "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
269 | - "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)"
270 | - RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
271 | - RNReanimated (from `../node_modules/react-native-reanimated`)
272 | - RNScreens (from `../node_modules/react-native-screens`)
273 | - RNVectorIcons (from `../node_modules/react-native-vector-icons`)
274 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
275 |
276 | SPEC REPOS:
277 | https://github.com/cocoapods/specs.git:
278 | - boost-for-react-native
279 |
280 | EXTERNAL SOURCES:
281 | DoubleConversion:
282 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
283 | FBLazyVector:
284 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
285 | FBReactNativeSpec:
286 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
287 | Folly:
288 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
289 | glog:
290 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
291 | RCTRequired:
292 | :path: "../node_modules/react-native/Libraries/RCTRequired"
293 | RCTTypeSafety:
294 | :path: "../node_modules/react-native/Libraries/TypeSafety"
295 | React:
296 | :path: "../node_modules/react-native/"
297 | React-Core:
298 | :path: "../node_modules/react-native/"
299 | React-CoreModules:
300 | :path: "../node_modules/react-native/React/CoreModules"
301 | React-cxxreact:
302 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
303 | React-jsi:
304 | :path: "../node_modules/react-native/ReactCommon/jsi"
305 | React-jsiexecutor:
306 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
307 | React-jsinspector:
308 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
309 | react-native-netinfo:
310 | :path: "../node_modules/@react-native-community/netinfo"
311 | react-native-safe-area-context:
312 | :path: "../node_modules/react-native-safe-area-context"
313 | React-RCTActionSheet:
314 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
315 | React-RCTAnimation:
316 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
317 | React-RCTBlob:
318 | :path: "../node_modules/react-native/Libraries/Blob"
319 | React-RCTImage:
320 | :path: "../node_modules/react-native/Libraries/Image"
321 | React-RCTLinking:
322 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
323 | React-RCTNetwork:
324 | :path: "../node_modules/react-native/Libraries/Network"
325 | React-RCTSettings:
326 | :path: "../node_modules/react-native/Libraries/Settings"
327 | React-RCTText:
328 | :path: "../node_modules/react-native/Libraries/Text"
329 | React-RCTVibration:
330 | :path: "../node_modules/react-native/Libraries/Vibration"
331 | ReactCommon:
332 | :path: "../node_modules/react-native/ReactCommon"
333 | RNCAsyncStorage:
334 | :path: "../node_modules/@react-native-community/async-storage"
335 | RNCMaskedView:
336 | :path: "../node_modules/@react-native-community/masked-view"
337 | RNGestureHandler:
338 | :path: "../node_modules/react-native-gesture-handler"
339 | RNReanimated:
340 | :path: "../node_modules/react-native-reanimated"
341 | RNScreens:
342 | :path: "../node_modules/react-native-screens"
343 | RNVectorIcons:
344 | :path: "../node_modules/react-native-vector-icons"
345 | Yoga:
346 | :path: "../node_modules/react-native/ReactCommon/yoga"
347 |
348 | SPEC CHECKSUMS:
349 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
350 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
351 | FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f
352 | FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75
353 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
354 | glog: 1f3da668190260b06b429bb211bfbee5cd790c28
355 | RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1
356 | RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320
357 | React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78
358 | React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04
359 | React-CoreModules: d04f8494c1a328b69ec11db9d1137d667f916dcb
360 | React-cxxreact: d0f7bcafa196ae410e5300736b424455e7fb7ba7
361 | React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
362 | React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
363 | React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
364 | react-native-netinfo: 54a7323159edfcd97e7be4141d8d1c232ddfbbef
365 | react-native-safe-area-context: 25260c5d0b9c53fd7aa88e569e2edae72af1f6a3
366 | React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
367 | React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
368 | React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72
369 | React-RCTImage: 6b8e8df449eb7c814c99a92d6b52de6fe39dea4e
370 | React-RCTLinking: 121bb231c7503cf9094f4d8461b96a130fabf4a5
371 | React-RCTNetwork: fb353640aafcee84ca8b78957297bd395f065c9a
372 | React-RCTSettings: 8db258ea2a5efee381fcf7a6d5044e2f8b68b640
373 | React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
374 | React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
375 | ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
376 | RNCAsyncStorage: 44395cb9c7c1523104c2b499eb426ef7aff82bca
377 | RNCMaskedView: dd13f9f7b146a9ad82f9b7eb6c9b5548fcf6e990
378 | RNGestureHandler: 02905abe54e1f6e59c081a10b4bd689721e17aa6
379 | RNReanimated: b2ab0b693dddd2339bd2f300e770f6302d2e960c
380 | RNScreens: 6adf01eb4080f44af6cca551207c6b0505066857
381 | RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
382 | Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
383 |
384 | PODFILE CHECKSUM: 48d1f1c705f830ffbfc8e0e4baba43354fa208e4
385 |
386 | COCOAPODS: 1.7.5
387 |
--------------------------------------------------------------------------------