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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
root: true,
extends: [
'@react-native-community',
'airbnb-typescript',
'prettier',
'prettier/@typescript-eslint',
'prettier/react'
]
};
15 changes: 15 additions & 0 deletions .expo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.

> What do the files contain?
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
- "settings.json": contains the server configuration that is used to serve the application manifest.

> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.

Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
9 changes: 9 additions & 0 deletions .expo/packager-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"expoServerPort": null,
"packagerPort": null,
"packagerPid": null,
"expoServerNgrokUrl": null,
"packagerNgrokUrl": null,
"ngrokPid": null,
"webpackServerPort": null
}
10 changes: 10 additions & 0 deletions .expo/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"hostType": "lan",
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": null,
"https": false,
"scheme": null,
"devClient": false
}
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'none',
tabWidth: 4
};
20 changes: 0 additions & 20 deletions App.js

This file was deleted.

21 changes: 21 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {StyleSheet, Text, View} from 'react-native';
import {Provider} from 'react-redux';
import {store} from './src/redux';
import {NavigationContainer} from '@react-navigation/native';
import {NativeBaseProvider, Box} from 'native-base';

import Navigator from './src/navigation';

import 'react-native-gesture-handler';

export default function App() {
return (
<NavigationContainer>
<NativeBaseProvider>
<Provider store={store}>
<Navigator />
</Provider>
</NativeBaseProvider>
</NavigationContainer>
);
}
Binary file added assets/pokemon-go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pokemon_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function(api) {
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
presets: ['babel-preset-expo', '@babel/preset-typescript'],
};
};
25 changes: 25 additions & 0 deletions jest/helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import {render as rtlRender} from '@testing-library/react-native';
import {Provider} from 'react-redux';
import {store as DefaultStore} from '../src/redux';

// Overriding the render method
function render(ui, {store = DefaultStore, renderOptions} = {}) {
console.log('storeasdasdasd', store);
function Wrapper({children}) {
return <Provider store={store}>{children}</Provider>;
}

return rtlRender(ui, {wrapper: Wrapper, ...renderOptions});
}

// re-export everything
export * from '@testing-library/react-native';
// override render method
export {render};

export function renderWithRedux(ui, options) {
const store = options?.store ?? configureStore(options?.initialState);
const queries = render(<Provider store={store}>{ui}</Provider>);
return {...queries, store};
}
4 changes: 4 additions & 0 deletions jest/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
jest.mock('@react-native-community/datetimepicker', function () {
const mockComponent = require('react-native/jest/mockComponent');
return mockComponent('@react-native-community/datetimepicker');
});
49 changes: 49 additions & 0 deletions jest/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import 'react-native-gesture-handler/jestSetup';

// include this section and the NativeAnimatedHelper section for mocking react-native-reanimated
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');

// The mock for `call` immediately calls the callback which is incorrect
// So we override it with a no-op
Reanimated.default.call = () => {};

return Reanimated;
});

// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');

jest.mock('react-native/Libraries/Utilities/Platform', () => {
const fs = require('fs');
const json = JSON.parse(
fs.readFileSync('node_modules/react-native/package.json', 'utf8')
);
const platform = jest.requireActual(
'react-native/Libraries/Utilities/Platform'
);
const version = json.version.toString().split('.');
return {
...platform,
constants: {
...platform.constants,
reactNativeVersion: {
major: version[0],
minor: version[1],
patch: version[2]
}
}
};
});

jest.mock('@react-navigation/native', () => {
const actualNav = jest.requireActual('@react-navigation/native');
return {
...actualNav,
useNavigation: () => ({
navigate: jest.fn(),
dispatch: jest.fn()
})
};
});
//
Loading