...
 
Commits (46)
module.exports = {
"parser": "babel-eslint",
"plugins": [
"react",
"react-native",
"flowtype"
],
"extends": ["plugin:react-native/all", "plugin:react/recommended"],
"env": {
"react-native/react-native": true
},
"rules": {
"no-unused-vars": [1],
"react/jsx-uses-vars": [2],
"flowtype/boolean-style": [
2,
"boolean"
],
"flowtype/define-flow-type": 1,
"flowtype/delimiter-dangle": [
2,
"never"
],
"flowtype/generic-spacing": [
2,
"never"
],
"flowtype/no-mixed": 0,
"flowtype/no-primitive-constructor-types": 2,
"flowtype/no-types-missing-file-annotation": 2,
"flowtype/no-weak-types": 0,
"flowtype/object-type-delimiter": [
2,
"comma"
],
"flowtype/require-parameter-type": 2,
"flowtype/require-readonly-react-props": 0,
"flowtype/require-return-type": [
2,
"always",
{
"annotateUndefined": "never"
}
],
"flowtype/require-valid-file-annotation": 2,
"flowtype/semi": [
2,
"always"
],
"flowtype/space-after-type-colon": [
2,
"always"
],
"flowtype/space-before-generic-bracket": [
2,
"never"
],
"flowtype/space-before-type-colon": [
2,
"never"
],
"flowtype/type-id-match": [
2,
"^([A-Z][a-z0-9]+)+Type$"
],
"flowtype/union-intersection-spacing": [
2,
"always"
],
"flowtype/use-flow-type": 1,
"flowtype/valid-syntax": 1
},
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
}
}
}
\ No newline at end of file
root: true,
extends: '@react-native-community',
};
\ No newline at end of file
......@@ -5,67 +5,71 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*
; Ignore polyfills
.*/Libraries/polyfills/.*
; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js
; Ignore metro
.*/node_modules/metro/.*
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/
[options]
emoji=true
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable
esproposal.decorators=ignore
module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
munge_underscores=true
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\)$' -> 'RelativeImageStub'
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
module.file_ext=.ios.js
munge_underscores=true
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
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\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error
[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import
[version]
^0.92.0
^0.107.0
......@@ -42,6 +42,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore
# fastlane
#
......@@ -57,6 +58,9 @@ buck-out/
# Bundle artifact
*.jsbundle
# CocoaPods
/ios/Pods/
# Jest cache
.jest/
......
......@@ -6,7 +6,7 @@ stages:
- deploy
test:jest:
image: node:10.10.0
image: node:10.16.3
stage: test
cache:
key: ${CI_COMMIT_REF_SLUG}
......@@ -22,7 +22,7 @@ build:android:
stage: build
before_script:
- sudo sysctl fs.inotify.max_user_watches=524288
- sudo sysctl -p
- sudo sysctl -p
script:
- yarn install
- cd android
......@@ -37,7 +37,7 @@ build:android:
when: on_success
e2e:browserstacks:
image: node:10.10.0
image: node:10.16.3
stage: e2e
cache:
key: ${CI_COMMIT_REF_SLUG}
......
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
//import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'
import './global';
import './shim'
//import crypto from "crypto"; // DO NOT REMOVE!
import React, {
Component
} from 'react';
import {
createStackNavigator,
NavigationActions
} from 'react-navigation';
import {
BackHandler,
Platform,
AppState,
Linking,
Text,
Alert,
View,
} from 'react-native';
import NavigationStack from './src/navigation/NavigationStack';
import NavigationService from './src/navigation/NavigationService';
const Stack = createStackNavigator({});
/**
* App
*/
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
appState: AppState.currentState
};
}
/**
* Handle app state changes
*/
handleAppStateChange = (nextState) => {
// if the app turns active we check for shared
if (this.state.appState.match(/inactive|background/) && nextState === 'active') {
receiveShare.handle();
}
this.setState({appState: nextState})
}
/**
* On component will mount
*/
componentWillMount() {
if (!Text.defaultProps) Text.defaultProps = {};
Text.defaultProps.style = {
fontFamily: 'Roboto',
color: '#444',
};
}
/**
* Render
*/
render() {
const app = (
<View></View>
);
return [ app ];
}
}
......@@ -5,18 +5,14 @@
* @format
* @flow
*/
import './global';
import './shim'
import crypto from "crypto"; // DO NOT REMOVE!
import React, {
Component
Component,
} from 'react';
import {
Observer,
Provider,
} from 'mobx-react/native' // import from mobx-react/native instead of mobx-react fix test
} from 'mobx-react/native'; // import from mobx-react/native instead of mobx-react fix test
import NavigationService from './src/navigation/NavigationService';
......@@ -30,8 +26,7 @@ import {
Clipboard,
} from 'react-native';
import FlashMessage from "react-native-flash-message";
import CookieManager from 'react-native-cookies';
import FlashMessage from 'react-native-flash-message';
import KeychainModalScreen from './src/keychain/KeychainModalScreen';
import BlockchainTransactionModalScreen from './src/blockchain/transaction-modal/BlockchainTransactionModalScreen';
......@@ -47,9 +42,9 @@ import sessionService from './src/common/services/session.service';
import deeplinkService from './src/common/services/deeplinks-router.service';
import badgeService from './src/common/services/badge.service';
import authService from './src/auth/AuthService';
import NotificationsService from "./src/notifications/NotificationsService";
import NotificationsService from './src/notifications/NotificationsService';
import getMaches from './src/common/helpers/getMatches';
import {CODE_PUSH_TOKEN, GOOGLE_PLAY_STORE} from './src/config/Config';
import { GOOGLE_PLAY_STORE } from './src/config/Config';
import updateService from './src/common/services/update.service';
import ErrorBoundary from './src/common/components/ErrorBoundary';
import { CommonStyle as CS } from './src/styles/Common';
......@@ -63,6 +58,7 @@ import connectivityService from './src/common/services/connectivity.service';
import sqliteStorageProviderService from './src/common/services/sqlite-storage-provider.service';
import commentStorageService from './src/comments/CommentStorageService';
import * as Sentry from '@sentry/react-native';
import apiService from './src/common/services/api.service';
import boostedContentService from './src/common/services/boosted-content.service';
let deepLinkUrl = '';
......@@ -73,7 +69,7 @@ pushService.init();
// fire sqlite init
sqliteStorageProviderService.get();
CookieManager.clearAll();
apiService.clearCookies();
// On app login (runs if the user login or if it is already logged in)
sessionService.onLogin(async () => {
......@@ -104,7 +100,7 @@ sessionService.onLogin(async () => {
}
logService.info('[App] navigating to initial screen', sessionService.initialScreen);
NavigationService.reset(sessionService.initialScreen);
NavigationService.navigate(sessionService.initialScreen);
// check update
if (Platform.OS !== 'ios' && !GOOGLE_PLAY_STORE) {
......@@ -218,7 +214,7 @@ export default class App extends Component<Props, State> {
if (!token) {
logService.info('[App] there is no active session');
NavigationService.reset('Login');
NavigationService.navigate('Login');
} else {
logService.info('[App] session initialized');
}
......@@ -299,8 +295,7 @@ export default class App extends Component<Props, State> {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
<FlashMessage renderCustomContent={this.renderNotification}
/>
<FlashMessage renderCustomContent={this.renderNotification} />
</ErrorBoundary>
</Provider>
);
......@@ -314,7 +309,7 @@ export default class App extends Component<Props, State> {
);
const tosModal = (
<TosModal user={stores.user}/>
<TosModal user={stores.user} key="tosModal"/>
)
return [ app, keychainModal, blockchainTransactionModal, tosModal];
......
......@@ -31,7 +31,7 @@
## Building
- `yarn install`
- `react-native run-ios` or `react-native run-android`
- `yarn android` or `yarn ios`
## Testing
......
export default {
}
\ No newline at end of file
import { View as mockView } from "react-native";
export default {
Value: jest.fn(),
event: jest.fn(),
add: jest.fn(),
eq: jest.fn(),
set: jest.fn(),
cond: jest.fn(),
interpolate: jest.fn(),
View: mockView,
Extrapolate: { CLAMP: jest.fn() },
Clock: jest.fn(),
greaterThan: jest.fn(),
lessThan: jest.fn(),
startClock: jest.fn(),
stopClock: jest.fn(),
clockRunning: jest.fn(),
not: jest.fn(),
or: jest.fn(),
and: jest.fn(),
spring: jest.fn(),
decay: jest.fn(),
defined: jest.fn(),
call: jest.fn(),
Code: mockView,
block: jest.fn(),
abs: jest.fn(),
greaterOrEq: jest.fn(),
lessOrEq: jest.fn(),
debug: jest.fn(),
Transition: {
Out: "Out"
},
};
export default {
Header: {}
};
export const createStackNavigator = jest.fn();
export const Header = {
HEIGHT:80,
};
export const createMaterialTopTabNavigator = jest.fn().mockImplementation(x => ({router: 'router'}));
export default {
createDrawerNavigator: jest.fn(),
withNavigation: jest.fn(),
StackActions: {
push: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/PUSH"})),
replace: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/REPLACE"})),
},
};
export const createAppContainer = jest.fn().mockReturnValue(function NavigationContainer(props) {return null;});
export const createSwitchNavigator = jest.fn().mockImplementation(x => ({router: 'router'}));
export const withNavigation = jest.fn();
export const Header = {
HEIGHT:80
}
export const StackActions = {
reset: jest.fn()
}
......
import 'react-native';
import React from 'react';
import App from '../App';
import videochat from '../src/common/services/videochat.service';
import sqliteStorageProviderService from '../src/common/services/sqlite-storage-provider.service';
import logService from '../src/common/services/log.service';
import {
......@@ -18,31 +17,16 @@ jest.mock('../src/common/services/sqlite-storage-provider.service')
jest.mock('../src/common/services/log.service', () => {});
jest.mock('../src/common/services/push.service');
jest.mock('react-native-gesture-handler', () => {});
jest.mock('react-navigation-stack', () => { Header: {} });
jest.mock('react-navigation', () => {
return {
createAppContainer: jest.fn().mockReturnValue(function NavigationContainer(props) {return null;}),
createDrawerNavigator: jest.fn(),
createMaterialTopTabNavigator: jest.fn().mockImplementation(x => ({router: 'router'})),
createStackNavigator: jest.fn(),
withNavigation: jest.fn(),
StackActions: {
push: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/PUSH"})),
replace: jest.fn().mockImplementation(x => ({...x, "type": "Navigation/REPLACE"})),
},
NavigationActions: {
navigate: jest.fn().mockImplementation(x => x),
}
}
});
// use the web3 mock to prevent sintax error from node_tar
jest.mock('web3');
//mock notifications
jest.mock('react-native-notifications');
jest.mock('../src/common/services/videochat.service');
jest.mock('react-native-convert-ph-asset');
jest.mock('react-navigation');
jest.mock('react-navigation-tabs');
jest.mock('react-navigation-stack');
//mock i18n
jest.mock('react-native-video');
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Activity component renders correctly 1`] = `
<ContextConsumer>
<Component />
</ContextConsumer>
<View
style={
Object {
"flex": 1,
}
}
>
<View
style={
Object {
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"padding": 4,
"paddingBottom": 8,
"paddingTop": 8,
}
}
>
<ThumbUpAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
me={
Object {
"guid": "guidguid",
}
}
/>
<ThumbDownAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
me={
Object {
"guid": "guidguid",
}
}
/>
<WireAction
owner={
Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
}
}
/>
<CommentsAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
/>
<RemindAction
entity={
Object {
"_list": Object {
"viewed": Object {
"addViewed": [Function],
"viewed": Map {
"1019155171608096768" => true,
},
},
},
"attachment_guid": false,
"blurb": false,
"container_guid": "activityguid0",
"custom_data": false,
"custom_type": false,
"description": "Congratulations! ",
"edited": "",
"getThumbSource": [Function],
"guid": "activityguid0",
"mature": false,
"message": "Message",
"ownerObj": Object {
"getAvatarSource": [Function],
"guid": "824853017709780997",
"subtype": false,
"time_created": "1522036284",
"type": "user",
},
"owner_guid": "824853017709780997",
"parent_guid": "838106762591510528",
"perma_url": false,
"rowKey": "something0",
"shouldBeBlured": [MockFunction],
"thumbnail_src": false,
"time_created": "1522036284",
"title": "TITLE",
"type": "activity",
"wire_totals": Object {
"tokens": 1000000000000000000,
},
}
}
/>
</View>
</View>
`;
......@@ -16,7 +16,9 @@ exports[`Boost action component renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -2,19 +2,15 @@ import api from '../../src/common/services/api.service';
import session from '../../src/common/services/session.service';
import authService from '../../src/auth/AuthService';
import delay from '../../src/common/helpers/delay';
import CookieManager from 'react-native-cookies';
jest.mock('../../src/common/services/api.service');
jest.mock('../../src/common/services/session.service');
jest.mock('../../src/common/helpers/delay', () => jest.fn());
jest.mock('react-native-cookies');
describe('auth service login', () => {
beforeEach(() => {
api.post.mockClear();
session.login.mockClear();
CookieManager.clearAll.mockClear();
CookieManager.clearAll.mockResolvedValue();
delay.mockClear();
delay.mockResolvedValue();
});
......
import 'react-native';
import React from 'react';
import { Text, TouchableOpacity } from "react-native";
import { shallow } from 'enzyme';
import RegisterScreen from '../../src/auth/RegisterScreen';
import { NavigationActions, StackActions } from 'react-navigation';
jest.mock('../../src/auth/RegisterForm', () => 'RegisterForm');
jest.mock('../../src/common/components/VideoBackground', () => 'VideoBackground');
......@@ -35,15 +33,14 @@ describe('RegisterScreen component', () => {
it('should navigate on RegisterForm events', async () => {
const navigation = {
dispatch: jest.fn()
dispatch: jest.fn(),
navigate: jest.fn(),
};
const wrapper = shallow(
<RegisterScreen navigation={navigation}/>
);
StackActions.reset.mockReturnValue(1)
// find register form
const registerForms = wrapper.find('RegisterForm');
......@@ -53,10 +50,7 @@ describe('RegisterScreen component', () => {
// simulate onBack event
registerForms.at(0).props().onBack();
// should call navigate
expect(StackActions.reset).toBeCalledWith({"actions": [undefined], "index": 0});
// with a navigation action with route to Login
expect(NavigationActions.navigate).toBeCalledWith({"routeName": "Login"});
expect(navigation.navigate).toBeCalledWith('Login');
});
});
......@@ -87,7 +87,9 @@ exports[`ForgotPassword component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -193,7 +195,9 @@ exports[`ForgotPassword component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -42,7 +42,11 @@ exports[`ForgotScreen component should renders correctly 1`] = `
>
<Image
resizeMode="contain"
source={1}
source={
Object {
"testUri": "../../../src/assets/logos/logo-white.png",
}
}
style={
Object {
"alignSelf": "center",
......@@ -151,7 +155,9 @@ exports[`ForgotScreen component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -257,7 +263,9 @@ exports[`ForgotScreen component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -133,7 +133,9 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -239,7 +241,9 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -413,6 +417,7 @@ exports[`LoginForm component should renders correctly 1`] = `
onModalWillHide={[Function]}
onModalWillShow={[Function]}
onRequestClose={[Function]}
scrollHorizontal={false}
scrollOffset={0}
scrollOffsetMax={0}
scrollTo={null}
......@@ -428,6 +433,8 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -454,6 +461,7 @@ exports[`LoginForm component should renders correctly 1`] = `
onModalWillHide={[Function]}
onModalWillShow={[Function]}
pointerEvents="box-none"
scrollHorizontal={false}
scrollOffset={0}
scrollOffsetMax={0}
scrollTo={null}
......@@ -622,7 +630,9 @@ exports[`LoginForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -659,7 +669,9 @@ exports[`LoginForm component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -42,7 +42,11 @@ exports[`LoginScreen component should renders correctly 1`] = `
>
<Image
resizeMode="contain"
source={1}
source={
Object {
"testUri": "../../../src/assets/logos/logo-white.png",
}
}
style={
Object {
"alignSelf": "center",
......
......@@ -105,7 +105,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
/>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -181,7 +183,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -296,7 +300,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -402,7 +408,9 @@ exports[`RegisterForm component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`blog card component should renders correctly 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -546,7 +546,9 @@ exports[`blog list screen component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -583,7 +585,9 @@ exports[`blog list screen component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -890,7 +890,7 @@ exports[`blog view screen component should renders correctly 1`] = `
underlayColor="white"
/>
</View>
<SafeAreaView
<ForwardRef(_SafeAreaView)
style={
Object {
"left": 0,
......@@ -909,7 +909,7 @@ exports[`blog view screen component should renders correctly 1`] = `
size={22}
underlayColor="white"
/>
</SafeAreaView>
</ForwardRef(_SafeAreaView)>
</View>
}
keyboardVerticalOffset={15}
......@@ -925,8 +925,9 @@ exports[`blog view screen component should renders correctly 1`] = `
store={
CommentsStore {
"attachment": AttachmentStore {
"fileName": null,
"guid": "",
"tempIosVideo": "",
"transcoding": false,
},
"embed": RichEmbedStore {
"_richEmbedFetchTimer": null,
......
import 'react-native';
import React from 'react';
import { Platform, CameraRoll, TouchableOpacity } from "react-native";
import { Platform, TouchableOpacity } from "react-native";
import { shallow, render } from 'enzyme';
import CameraRoll from '@react-native-community/cameraroll';
import androidPermission from '../../src/common/services/android-permissions.service';
import { getPhotosFaker } from '../../__mocks__/fake/CameraRollFaker';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
jest.mock('../../src/common/services/android-permissions.service');
//jest.mock('TouchableOpacity', () => 'TouchableOpacity' )
jest.mock('CameraRoll');
jest.mock('@react-native-community/cameraroll');
CameraRoll.getPhotos = jest.fn();
// fake camera roll data
const response = getPhotosFaker(5);
......
import 'react-native';
import React from 'react';
import { Alert, CameraRoll } from 'react-native';
import { Alert } from 'react-native';
import { shallow } from 'enzyme';
import { Icon } from 'react-native-elements'
import CameraRoll from '@react-native-community/cameraroll';
import CapturePoster from '../../src/capture/CapturePoster';
import CapturePreview from '../../src/capture/CapturePreview';
......@@ -21,7 +22,6 @@ jest.mock('../../src/capture/CapturePosterFlags', () => 'CapturePosterFlags');
jest.mock('../../src/common/services/translation.service');
Alert.alert = jest.fn();
jest.mock('CameraRoll');
CameraRoll.getPhotos = jest.fn();
// fake camera roll data
const response = getPhotosFaker(5);
......
......@@ -27,7 +27,9 @@ exports[`cature tabs component should renders correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -94,7 +96,9 @@ exports[`cature tabs component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -161,7 +165,9 @@ exports[`cature tabs component should renders correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
import 'react-native';
import React from 'react';
//import { Platform, CameraRoll, TouchableOpacity } from "react-native";
import { shallow } from 'enzyme';
import ChannelScreen from '../../src/channel/ChannelScreen';
import { activitiesServiceFaker } from '../../__mocks__/fake/ActivitiesFaker';
......
......@@ -17,7 +17,9 @@ exports[`channel actions component should renders correctly 1`] = `
<View
accessibilityLabel="Wire Button"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -91,7 +93,9 @@ exports[`channel actions component should renders correctly 1`] = `
<View
accessibilityLabel="More"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -254,7 +254,7 @@ exports[`Channel screen component should renders correctly 1`] = `
}
hasRewards={0}
/>
<SafeAreaView
<ForwardRef(_SafeAreaView)
style={
Object {
"left": 0,
......@@ -273,7 +273,7 @@ exports[`Channel screen component should renders correctly 1`] = `
size={22}
underlayColor="white"
/>
</SafeAreaView>
</ForwardRef(_SafeAreaView)>
</View>
}
navigation={
......
......@@ -15,7 +15,6 @@ jest.mock('../../../src/auth/UserStore');
jest.mock('../../../AppStores');
jest.mock('../../../src/channel/ChannelStore');
jest.mock('../../../src/common/services/boosted-content.service');
jest.mock('TouchableHighlight', () => 'TouchableHighlight');
/**
* Tests
......
......@@ -4,7 +4,9 @@ exports[`channel header component owner should render correctly 1`] = `
<View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -131,16 +133,26 @@ exports[`channel header component owner should render correctly 1`] = `
</View>
<View>
<View>
<TouchableHighlight
onPress={[Function]}
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Array [
undefined,
]
}
underlayColor="transparent"
>
<View>
<View
style={null}
>
<Text>
SUBSCRIBERS
</Text>
......@@ -148,7 +160,7 @@ exports[`channel header component owner should render correctly 1`] = `
50
</Text>
</View>
</TouchableHighlight>
</View>
<View>
<Text>
VIEWS
......@@ -198,7 +210,9 @@ exports[`channel header component owner should render correctly 1`] = `
<View
accessibilityLabel="Subscribe to this channel"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -252,7 +266,9 @@ exports[`channel header component owner should render correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -32,7 +32,9 @@ exports[`channel subscribers component should render correctly 1`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -61,7 +63,9 @@ exports[`channel subscribers component should render correctly 1`] = `
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1538,7 +1542,9 @@ exports[`channel subscribers component should render correctly without data 1`]
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1567,7 +1573,9 @@ exports[`channel subscribers component should render correctly without data 1`]
</View>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -4,7 +4,6 @@ import { shallow } from 'enzyme';
import ExplicitOverlay from '../../../src/common/components/explicit/ExplicitOverlay';
import ActivityModel from '../../../src/newsfeed/ActivityModel';
import { activitiesServiceFaker } from '../../../__mocks__/fake/ActivitiesFaker';
jest.mock('TouchableOpacity', () => 'TouchableOpacity');
describe('Explicit overlay component', () => {
......
......@@ -3,7 +3,9 @@
exports[`renders correctly 1`] = `
<View
accessible={true}
focusable={false}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
import {
CameraRoll,
Platform,
} from 'react-native';
import service from '../../../src/common/services/download.service';
import session from '../../../src/common/services/session.service';
import RNFetchBlob from 'react-native-fetch-blob';
import CameraRoll from '@react-native-community/cameraroll';
import permissions from '../../../src/common/services/android-permissions.service';
CameraRoll.saveToCameraRoll = jest.fn();
jest.mock('../../../src/common/services/android-permissions.service');
jest.mock('../../../src/common/services/session.service');
jest.mock('react-native-fetch-blob');
/**
* Tests
*/
......@@ -27,12 +24,12 @@ describe('Download service', () => {
await service.downloadToGallery('url');
expect(CameraRoll.saveToCameraRoll).not.toHaveBeenCalled();
});
it('should call camera roll', async () => {
// call tested method
Platform.OS = 'ios';
await service.downloadToGallery('url');
expect(CameraRoll.saveToCameraRoll).toHaveBeenCalled();
});
});
});
\ No newline at end of file
......@@ -18,6 +18,8 @@ exports[`notification component renders correctly for every type 1`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -108,6 +110,8 @@ exports[`notification component renders correctly for every type 2`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -198,6 +202,8 @@ exports[`notification component renders correctly for every type 3`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -288,6 +294,8 @@ exports[`notification component renders correctly for every type 4`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -402,6 +410,8 @@ exports[`notification component renders correctly for every type 5`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -517,6 +527,8 @@ exports[`notification component renders correctly for every type 6`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -631,6 +643,8 @@ exports[`notification component renders correctly for every type 7`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -721,6 +735,8 @@ exports[`notification component renders correctly for every type 8`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -796,6 +812,8 @@ exports[`notification component renders correctly for every type 9`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -898,6 +916,8 @@ exports[`notification component renders correctly for every type 10`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -988,6 +1008,8 @@ exports[`notification component renders correctly for every type 11`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1019,7 +1041,9 @@ exports[`notification component renders correctly for every type 11`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1092,6 +1116,8 @@ exports[`notification component renders correctly for every type 12`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1165,6 +1191,8 @@ exports[`notification component renders correctly for every type 13`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1196,7 +1224,9 @@ exports[`notification component renders correctly for every type 13`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1269,6 +1299,8 @@ exports[`notification component renders correctly for every type 14`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1355,6 +1387,8 @@ exports[`notification component renders correctly for every type 15`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1436,6 +1470,8 @@ exports[`notification component renders correctly for every type 16`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1467,7 +1503,9 @@ exports[`notification component renders correctly for every type 16`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1542,6 +1580,8 @@ exports[`notification component renders correctly for every type 17`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1617,6 +1657,8 @@ exports[`notification component renders correctly for every type 18`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1692,6 +1734,8 @@ exports[`notification component renders correctly for every type 19`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1723,7 +1767,9 @@ exports[`notification component renders correctly for every type 19`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1796,6 +1842,8 @@ exports[`notification component renders correctly for every type 20`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1880,6 +1928,8 @@ exports[`notification component renders correctly for every type 21`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1961,6 +2011,8 @@ exports[`notification component renders correctly for every type 22`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -1992,7 +2044,9 @@ exports[`notification component renders correctly for every type 22`] = `
>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2045,6 +2099,8 @@ exports[`notification component renders correctly for every type 23`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2118,6 +2174,8 @@ exports[`notification component renders correctly for every type 24`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2191,6 +2249,8 @@ exports[`notification component renders correctly for every type 25`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2266,6 +2326,8 @@ exports[`notification component renders correctly for every type 26`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2350,6 +2412,8 @@ exports[`notification component renders correctly for every type 27`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -2431,6 +2495,8 @@ exports[`notification component renders correctly for every type 28`] = `
>
<Image
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly for activity 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -49,7 +51,9 @@ exports[`renders correctly for activity 1`] = `
exports[`renders correctly for comment 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -97,7 +101,9 @@ exports[`renders correctly for comment 1`] = `
exports[`renders correctly for object 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly for activity 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -49,7 +51,9 @@ exports[`renders correctly for activity 1`] = `
exports[`renders correctly for comment 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -97,7 +101,9 @@ exports[`renders correctly for comment 1`] = `
exports[`renders correctly for object 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -3,7 +3,9 @@
exports[`renders correctly activity 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......@@ -29,7 +31,9 @@ exports[`renders correctly activity 1`] = `
exports[`renders correctly comment 1`] = `
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -166,7 +166,9 @@ exports[`WithdrawScreen renders correctly 1`] = `
/>
<View
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
......
......@@ -75,11 +75,11 @@ import com.android.build.OutputFile
project.ext.react = [
bundleCommand: "ram-bundle",
entryFile: "index.js",
bundleAssetName: "app.bundle"
bundleAssetName: "app.bundle",
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
/**
* Set this to true to create two separate APKs instead of one:
......@@ -96,6 +96,28 @@ def enableSeparateBuildPerCPUArchitecture = false
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
......@@ -113,10 +135,15 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode Integer.parseInt(project.versionCode)
versionName project.versionName
renderscriptTargetApi 21
renderscriptSupportModeEnabled true
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60"
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
......@@ -126,7 +153,7 @@ android {
}
}
}
splits {
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
......@@ -135,6 +162,9 @@ android {
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
......@@ -146,8 +176,8 @@ android {
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
// if (abi != null) { // null for the universal-debug, universal-release variants
// output.versionCodeOverride =
......@@ -155,68 +185,57 @@ android {
// }
}
}
packagingOptions {
pickFirst '**/libjsc.so'
pickFirst '**/libc++_shared.so'
}
}
dependencies {
implementation project(':@sentry_react-native')
implementation project(':react-native-randombytes')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
// react-native-screens need both
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
implementation project(':tipsi-stripe')
implementation project(':react-native-svg')
implementation project(':react-native-device-info')
implementation project(':react-native-notifications')
implementation project(':@react-native-community_netinfo')
implementation project(':react-native-screens')
implementation project(':reactnativenotifications')
implementation project(':rn-apk')
implementation project(':react-native-localize')
implementation project(':react-native-webview')
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-cookies')
compile project(':react-native-exit-app')
compile project(':react-native-background-timer')
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-messaging:17.3.3' // IMPORTANT: fix the crash when the app receives a push notification
// I manually linked this package to fix the build errors ignoring the following packages
implementation(project(':react-native-jitsi-meet')) {
// solve issues with the packages shared with the jitsi bundle
exclude group: 'com.facebook.react', module:'react-native-community-async-storage'
exclude group: 'com.facebook.react', module:'react-native-community_netinfo'
exclude group: 'com.facebook.react', module:'react-native-webview'
exclude group: 'com.facebook.react', module:'react-native-vector-icons'
exclude group: 'com.facebook.react',module:'react-native-fetch-blob'
exclude group: 'com.facebook.react',module:'react-native-keep-awake'
exclude group: 'com.facebook.react',module:'react-native-fast-image'
exclude group: 'com.facebook.react',module:'react-native-background-timer'
// exclude group: 'com.facebook.react',module:'react-native-google-signin'
exclude group: 'com.facebook.react', module:'react-native-svg'
// exclude group: 'com.facebook.react', module:'react-native-gesture-handler'
exclude group: 'com.google.firebase'
}
implementation project(':react-native-sqlite-storage')
implementation project(':react-native-background-timer')
implementation project(':react-native-fs')
implementation project(':react-native-media-meta')
implementation project(':react-native-share-menu')
implementation project(':react-native-keep-awake')
implementation project(':react-native-share')
// implementation project(':react-native-udp')
implementation project(':react-native-tcp')
implementation project(':react-native-randombytes')
implementation project(':react-native-os')
implementation project(':react-native-minds-encryption')
implementation project(':react-native-video-exoplayer')
implementation project(':react-native-photo-view')
implementation project(':react-native-fast-image')
implementation project(':react-native-exception-handler')
implementation project(':react-native-image-picker')
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:0.59.10" // From node_modules
// implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
// implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0'
implementation 'com.facebook.fresco:animated-gif:1.10.0'
implementation 'com.facebook.fresco:animated-webp:1.10.0'
implementation 'com.facebook.fresco:webpsupport:1.10.0'
implementation 'com.facebook.fresco:fresco:1.10.0'
// implementation 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0'
// implementation 'com.facebook.fresco:animated-gif:1.10.0'
// implementation 'com.facebook.fresco:animated-webp:1.10.0'
// implementation 'com.facebook.fresco:webpsupport:1.10.0'
// implementation 'com.facebook.fresco:fresco:1.10.0'
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
// Glide
implementation("com.github.bumptech.glide:glide:${glideVersion}") {
......@@ -234,6 +253,8 @@ task copyDownloadableDepsToLibs(type: Copy) {
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply plugin: 'com.google.gms.google-services'
File added
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.minds.mobile"
android:versionCode="20180124001"
android:versionName="3.0.0">
>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
......@@ -72,14 +71,13 @@
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/mp4" />
<data android:mimeType="video/*" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.reactnativejitsimeet.JitsiMeetNavigatorActivity" />
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_stat_name" />
<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
......
......@@ -6,13 +6,17 @@ import com.facebook.react.ReactActivity;
import com.imagepicker.permissions.OnImagePickerPermissionsCallback;
import com.facebook.react.modules.core.PermissionListener;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
public class MainActivity extends ReactActivity implements OnImagePickerPermissionsCallback {
private PermissionListener listener;
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "Minds";
......@@ -29,6 +33,16 @@ public class MainActivity extends ReactActivity implements OnImagePickerPermissi
moveTaskToBack(true);
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
......
......@@ -2,108 +2,49 @@ package com.minds.mobile;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import io.sentry.RNSentryPackage;
import com.gettipsi.stripe.StripeReactPackage;
import com.horcrux.svg.SvgPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.reactnativejitsimeet.JitsiMeetPackage;
import com.wix.reactnativenotifications.RNNotificationsPackage;
import com.reactnativecommunity.netinfo.NetInfoPackage;
import com.swmansion.rnscreens.RNScreensPackage;
import be.skyzohlabs.rnapk.ReactNativeAPKPackage;
import com.reactcommunity.rnlocalize.RNLocalizePackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.psykar.cookiemanager.CookieManagerPackage;
import com.github.wumke.RNExitApp.RNExitAppPackage;
import com.peel.react.TcpSocketsModule;
import com.bitgo.randombytes.RandomBytesPackage;
import com.peel.react.rnos.RNOSModule;
import com.wix.reactnativenotifications.RNNotificationsPackage;
import com.minds.crypto.CryptoPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.masteratul.exceptionhandler.ReactNativeExceptionHandlerPackage;
import com.imagepicker.ImagePickerPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.reactnative.photoview.PhotoViewPackage;
import com.corbt.keepawake.KCKeepAwakePackage;
import cl.json.RNSharePackage;
import cl.json.ShareApplication;
import com.meedan.ShareMenuPackage;
import com.mybigday.rnmediameta.RNMediaMetaPackage;
import com.rnfs.RNFSPackage;
import com.reactnativejitsimeet.JitsiMeetPackage;
import com.ocetnik.timer.BackgroundTimerPackage;
import org.pgsqlite.SQLitePluginPackage;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
import java.lang.reflect.InvocationTargetException;
public class MainApplication extends Application implements ShareApplication, ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNSentryPackage(),
new StripeReactPackage(),
new SvgPackage(),
new RNDeviceInfo(),
new JitsiMeetPackage(),
new NetInfoPackage(),
new RNScreensPackage(),
new ReactNativeAPKPackage(),
new RNLocalizePackage(),
new RNCWebViewPackage(),
new AsyncStoragePackage(),
new RNGestureHandlerPackage(),
new CookieManagerPackage(),
new RNExitAppPackage(),
new TcpSocketsModule(),
new RandomBytesPackage(),
new RNOSModule(),
new CryptoPackage(),
new ReactVideoPackage(),
new FastImageViewPackage(),
new ReactNativeExceptionHandlerPackage(),
new ImagePickerPackage(),
new VectorIconsPackage(),
new PhotoViewPackage(),
new KCKeepAwakePackage(),
new RNNotificationsPackage(MainApplication.this),
new RNSharePackage(),
new ShareMenuPackage(),
new RNMediaMetaPackage(),
new RNFSPackage(),
new SQLitePluginPackage(),
new BackgroundTimerPackage()
);
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new RNNotificationsPackage(this.getApplication()));
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
protected @Nullable String getBundleAssetName() {
return "app.bundle";
}
@Override
protected @Nullable String getBundleAssetName() {
return "app.bundle";
}
};
@Override
......@@ -115,6 +56,33 @@ public class MainApplication extends Application implements ShareApplication, Re
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
}
/**
* Loads Flipper in React Native templates.
*
* @param context
*/
private static void initializeFlipper(Context context) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
@Override
......
......@@ -2,6 +2,7 @@
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">#000000</item>
<!-- Customize your theme here. -->
</style>
......
project.ext {
excludeAppGlideModule = true
}
buildscript {
ext {
......@@ -6,6 +9,7 @@ buildscript {
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
androidXCore = "1.0.2"
glideVersion = "4.7.1"
}
repositories {
......@@ -13,7 +17,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......@@ -24,17 +28,18 @@ allprojects {
repositories {
mavenLocal()
maven {
// url "$rootDir/../../jitsi-maven-repository/releases" // used for local dev of jitsi sdk
// url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases" // original
url "https://gitlab.com/minds/jitsi-maven-repository/raw/master/releases" // ours custom sdk
url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
}
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
maven { url "https://www.jitpack.io" }
}
configurations.all {
......@@ -44,17 +49,7 @@ allprojects {
subprojects {
// fix missing gradle versions in jcenter
if (project.name.contains('react-native-fast-image')
|| project.name.contains('react-native-image-picker')
|| project.name.contains('react-native-vector-icons')
) {
buildscript {
repositories {
maven { url = "https://dl.bintray.com/android/android-tools/" }
}
}
}
afterEvaluate {p ->
if (p.hasProperty("android")) {
......@@ -66,14 +61,6 @@ subprojects {
}
configurations.all {
// afterEvaluate {p ->
// if (p.hasProperty("android")) {
// android {
// compileSdkVersion rootProject.ext.compileSdkVersion
// buildToolsVersion rootProject.ext.supportLibVersion
// }
// }
// }
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
......
......@@ -31,6 +31,8 @@ platform :android do
build_type: "Release",
print_command: false,
properties: {
"android.enableJetifier" => "true",
"android.useAndroidX" => "true",
"android.injected.signing.store.file" => "minds.keystore",
"android.injected.signing.store.password" => ENV['KEYSTORE_PASSWORD'],
"android.injected.signing.key.alias" => "alias_name",
......
......@@ -16,6 +16,10 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true
#MYAPP_RELEASE_STORE_FILE=minds.keystore
#MYAPP_RELEASE_KEY_ALIAS=alias_name
org.gradle.jvmargs=-Xmx2048m
......
......@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
rootProject.name = 'Minds'
include ':@sentry_react-native'
project(':@sentry_react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@sentry/react-native/android')
include ':react-native-randombytes'
project(':react-native-randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
include ':tipsi-stripe'
project(':tipsi-stripe').projectDir = new File(rootProject.projectDir, '../node_modules/tipsi-stripe/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':react-native-jitsi-meet'
project(':react-native-jitsi-meet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-jitsi-meet/android')
include ':react-native-notifications'
project(':react-native-notifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/android/app')
include ':@react-native-community_netinfo'
project(':@react-native-community_netinfo').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/netinfo/android')
include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
include ':rn-apk'
project(':rn-apk').projectDir = new File(rootProject.projectDir, '../node_modules/rn-apk/android')
include ':react-native-localize'
project(':react-native-localize').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-localize/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-sqlite-storage'
project(':react-native-sqlite-storage').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sqlite-storage/src/android')
include ':react-native-cookies'
project(':react-native-cookies').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cookies/android')
include ':react-native-exit-app'
project(':react-native-exit-app').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exit-app/android')
include ':react-native-background-timer'
project(':react-native-background-timer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-background-timer/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-media-meta'
project(':react-native-media-meta').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-media-meta/android')
include ':react-native-share-menu'
project(':react-native-share-menu').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share-menu/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-tcp'
project(':react-native-tcp').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-tcp/android')
include ':react-native-randombytes'
project(':react-native-randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
include ':react-native-os'
project(':react-native-os').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-os/android')
include ':react-native-minds-encryption'
project(':react-native-minds-encryption').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-minds-encryption/android')
include ':react-native-video-exoplayer'
project(':react-native-video-exoplayer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
include ':react-native-photo-view'
project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')
include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
include ':react-native-exception-handler'
project(':react-native-exception-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exception-handler/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-keep-awake'
project(':react-native-keep-awake').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keep-awake/android')
include ':reactnativenotifications'
project(':reactnativenotifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/android/app')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
module.exports = function (api) {
api.cache(false);
return {
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
["@babel/plugin-proposal-decorators", {
"legacy": true
}]
]
}
}
// Inject node globals into React Native global scope.
global.Buffer = require('buffer').Buffer;
global.process = require('process');
if (typeof __dirname === 'undefined') global.__dirname = '/'
if (typeof __filename === 'undefined') global.__filename = ''
if (typeof process === 'undefined') {
global.process = require('process')
} else {
const bProcess = require('process')
for (var p in bProcess) {
if (!(p in process)) {
process[p] = bProcess[p]
}
}
}
if (typeof btoa === 'undefined') {
global.btoa = function (str) {
return new Buffer(str, 'binary').toString('base64')
}
}
if (typeof atob === 'undefined') {
global.atob = function (b64Encoded) {
return new Buffer(b64Encoded, 'base64').toString('binary')
}
}
process.browser = false
if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer
// global.location = global.location || { port: 80 }
const isDev = typeof __DEV__ === 'boolean' && __DEV__
process.env['NODE_ENV'] = isDev ? 'development' : 'production'
if (typeof localStorage !== 'undefined') {
localStorage.debug = isDev ? '*' : ''
}
// created this file because the bundler is not reading index for some reason
import 'react-native-gesture-handler'; // fix ongesture handler error
import "@hawkingnetwork/node-libs-react-native/globals";
import "./global";
import { AppRegistry } from 'react-native';
import App from './App';
import { useScreens } from 'react-native-screens';
useScreens();
// const modules = require.getModules();
// const moduleIds = Object.keys(modules);
// const loadedModuleNames = moduleIds
// .filter(moduleId => modules[moduleId].isInitialized)
// .map(moduleId => modules[moduleId].verboseName);
// const waitingModuleNames = moduleIds
// .filter(moduleId => !modules[moduleId].isInitialized)
// .map(moduleId => modules[moduleId].verboseName);
// // make sure that the modules you expect to be waiting are actually waiting
// console.log(
// 'loaded:',
// loadedModuleNames.length,
// 'waiting:',
// waitingModuleNames.length
// );
// // grab this text blob, and put it in a file named packager/modulePaths.js
// console.log(`module.exports = ${JSON.stringify(loadedModuleNames.sort())};`);
AppRegistry.registerComponent('Minds', () => App);
\ No newline at end of file
// created this file because the bundler is not reading index for some reason
import 'react-native-gesture-handler'; // fix ongesture handler error
import "@hawkingnetwork/node-libs-react-native/globals";
import "./global";
import { AppRegistry } from 'react-native';
import App from './App';
import { useScreens } from 'react-native-screens';
......
This diff is collapsed.
File deleted
This diff is collapsed.
......@@ -36,7 +36,7 @@
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
......@@ -80,9 +80,9 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
......
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Minds.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
......@@ -4,6 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
......
......@@ -4,6 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RNNotifications.h"
#import "AppDelegate.h"
......@@ -17,17 +18,16 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"Minds"
initialProperties:nil];
rootView.backgroundColor = [UIColor whiteColor];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:rootViewController];
navigationController.navigationBarHidden = YES;
rootViewController.view = rootView;
self.window.rootViewController = navigationController;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[RNNotifications startMonitorNotifications];
return YES;
......@@ -39,7 +39,6 @@ RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
// return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
......@@ -58,7 +57,6 @@ RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
restorationHandler:restorationHandler];
}
// Required to register for notifications
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[RNNotifications didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Minds</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key>
<string/>
<key>CFBundleIdentifier</key>
<string>com.minds.mobile</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.11.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>minds</string>
<key>CFBundleURLSchemes</key>
<array>
<string>minds</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>5</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
<string/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>dev.minds.io</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSCalendarsUsageDescription</key>
<string>$(PRODUCT_NAME) need access to the calendar to schedule your gatherings</string>
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to use your camera in order to upload images or videos</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your microphone in order to record videos </string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Photo Library in order to upload images</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) would like access to your photo gallery so that you can upload images</string>
<key>UIAppFonts</key>
<array>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>Octicons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
<string>Roboto-Black.ttf</string>
<string>Roboto-BlackItalic.ttf</string>
<string>Roboto-Bold.ttf</string>
<string>Roboto-BoldItalic.ttf</string>
<string>Roboto-Italic.ttf</string>
<string>Roboto-Light.ttf</string>
<string>Roboto-LightItalic.ttf</string>
<string>Roboto-Medium.ttf</string>
<string>Roboto-MediumItalic.ttf</string>
<string>Roboto-Regular.ttf</string>
<string>Roboto-Thin.ttf</string>
<string>Roboto-ThinItalic.ttf</string>
<string>AntDesign.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Minds</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key>
<string/>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.11.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>minds</string>
<key>CFBundleURLSchemes</key>
<array>
<string>minds</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>5</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
<string/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>dev.minds.io</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSCalendarsUsageDescription</key>
<string>$(PRODUCT_NAME) need access to the calendar to schedule your gatherings</string>
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to use your camera in order to upload images or videos</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your microphone in order to record videos </string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Photo Library in order to upload images</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) would like access to your photo gallery so that you can upload images</string>
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
<string>Roboto-Black.ttf</string>
<string>Roboto-BlackItalic.ttf</string>
<string>Roboto-Bold.ttf</string>
<string>Roboto-BoldItalic.ttf</string>
<string>Roboto-Italic.ttf</string>
<string>Roboto-Light.ttf</string>
<string>Roboto-LightItalic.ttf</string>
<string>Roboto-Medium.ttf</string>
<string>Roboto-MediumItalic.ttf</string>
<string>Roboto-Regular.ttf</string>
<string>Roboto-Thin.ttf</string>
<string>Roboto-ThinItalic.ttf</string>
<string>Fontisto.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'Minds' do
# Pods for RnDiffApp
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'MindsTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'Minds-tvOS' do
# Pods for Minds-tvOS
target 'Minds-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
......@@ -14,7 +14,7 @@ const config = {
],
"moduleNameMapper": {
"^image![a-zA-Z0-9$_-]+$": "GlobalImageStub",
"^[@./a-zA-Z0-9$_-]+\\.(png|gif)$": "RelativeImageStub"
// "^[@./a-zA-Z0-9$_-]+\\.(png|gif)$": "RelativeImageStub"
},
"snapshotSerializers": [
"./node_modules/enzyme-to-json/serializer"
......
......@@ -4,8 +4,15 @@
*
* @format
*/
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
resolver: {
extraNodeModules: require('@hawkingnetwork/node-libs-react-native'),
blacklistRE: blacklist([
/ios\/Pods\/JitsiMeetSDK\/Frameworks\/JitsiMeet.framework\/assets\/node_modules\/react-native\/.*/,
]),
},
transformer: {
getTransformOptions: async () => ({
transform: {
......
This diff is collapsed.
module.exports = {
dependencies: {
'react-native-notifications': {
platforms: {
android: null
},
},
'tipsi-stripe': {
platforms: {
ios: null, // disable ios platform, other platforms will still autolink if provided
},
},
},
project: {
ios: {},
android: {},
},
assets: ['./src/assets/fonts/'],
};
const extraNodeModules = require('node-libs-browser');
const blacklist = require('metro-config/src/defaults/blacklist')
module.exports = {
extraNodeModules,
resolver: {
blacklistRE: blacklist([/react-native\/local-cli\/core\/__fixtures__.*/])
},
};
if (typeof __dirname === 'undefined') global.__dirname = '/'
if (typeof __filename === 'undefined') global.__filename = ''
if (typeof process === 'undefined') {
global.process = require('process')
} else {
const bProcess = require('process')
for (var p in bProcess) {
if (!(p in process)) {
process[p] = bProcess[p]
}
}
}
process.browser = false
if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer
// global.location = global.location || { port: 80 }
const isDev = typeof __DEV__ === 'boolean' && __DEV__
process.env['NODE_ENV'] = isDev ? 'development' : 'production'
if (typeof localStorage !== 'undefined') {
localStorage.debug = isDev ? '*' : ''
}
No preview for this file type
import { Alert } from 'react-native';
import api from './../common/services/api.service';
import session from './../common/services/session.service';
import delay from '../common/helpers/delay';
import CookieManager from 'react-native-cookies';
import logService from '../common/services/log.service';
/**
......@@ -20,7 +18,7 @@ class AuthService {
};
const data = await api.post('api/v2/oauth/token', params);
await CookieManager.clearAll();
await api.clearCookies();
await delay(100);
await session.login(data);
return data;
......
......@@ -12,8 +12,6 @@ import {
Alert,
} from 'react-native';
import CookieManager from 'react-native-cookies';
import authService from '../auth/AuthService';
import { CommonStyle } from '../styles/Common';
import { ComponentsStyle } from '../styles/Components';
......@@ -28,6 +26,7 @@ import {
import i18n from '../common/services/i18n.service';
import sessionService from '../common/services/session.service';
import delay from '../common/helpers/delay';
import apiService from '../common/services/api.service';
/**
* Register Form
......@@ -207,7 +206,7 @@ export default class RegisterForm extends Component {
};
await authService.register(params);
sessionService.setInitialScreen('OnboardingScreen');
await CookieManager.clearAll();
await apiService.clearCookies();
await delay(100);
await authService.login(this.state.username ,this.state.password);
} catch (err) {
......
......@@ -49,32 +49,10 @@ export default class Register extends Component {
}
onPressBack = () => {
this._navigate('Login');
this.props.navigation.navigate('Login');
}
onRegister = guid => {
logService.info('[Register] new user registered '+guid);
}
/**
* Navigate to screen
* @param {string} destination
* @param {*} childRouterAction
*/
_navigate(destination, childRouterAction) {
const navigateAction = { routeName: destination };
if (childRouterAction) {
navigateAction.action = NavigationActions.navigate(childRouterAction);
}
const resetAction = StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate(navigateAction)
]
})
this.props.navigation.dispatch(resetAction);
}
}
......@@ -10,8 +10,6 @@ import {
KeyboardAvoidingView,
} from 'react-native';
import CookieManager from 'react-native-cookies';
import authService from './AuthService';
import { CommonStyle as CS } from '../styles/Common';
import { ComponentsStyle } from '../styles/Components';
......@@ -22,6 +20,7 @@ import i18n from '../common/services/i18n.service';
import navigation from '../navigation/NavigationService';
import delay from '../common/helpers/delay';
import logService from '../common/services/log.service';
import apiService from '../common/services/api.service';
/**
* Reset Password Form
......@@ -100,7 +99,7 @@ export default class ResetPassword extends PureComponent {
* On press back
*/
onPressBack = () => {
navigation.reset('Login');
navigation.navigate('Login');
}
/**
......@@ -121,7 +120,7 @@ export default class ResetPassword extends PureComponent {
try {
const data = await authService.reset(state.params.username, this.state.password, state.params.code);
// clear the cookies (fix future issues with calls)
await CookieManager.clearAll();
await apiService.clearCookies();;
if (data.status === 'success') {
await delay(100);
......
......@@ -11,8 +11,6 @@ import {
Platform,
} from 'react-native';
import { btoa } from 'abab';
import Share from 'react-native-share';
import QRCode from 'react-native-qrcode-svg';
......
......@@ -23,7 +23,7 @@ import {
import ActionSheet from 'react-native-actionsheet';
import { Header } from 'react-navigation';
import { Header } from 'react-navigation-stack';
import { inject, observer } from 'mobx-react/native';
......@@ -176,7 +176,7 @@ export default class BlogsViewScreen extends Component {
<CenteredLoading/>}
</View>
<View style={styles.moreInformation}>
{ blog.getLicenseText() &&
{ blog.getLicenseText() &&
<Icon color={colors.medium} size={18} name='public'/>
}
<Text style={[CS.fontXS, CS.paddingLeft, CS.colorMedium, CS.paddingRight2x]}>{blog.getLicenseText()}</Text>
......@@ -205,7 +205,7 @@ export default class BlogsViewScreen extends Component {
async showActionSheet() {
this.ActionSheet.show();
}
async handleActionSheetSelection(option) {
switch(option) {
case i18n.t('disableComments'):
......@@ -216,7 +216,7 @@ export default class BlogsViewScreen extends Component {
console.error(err);
this.showError();
}
}
}
......
import React, {
PureComponent
} from 'react';
import React, {PureComponent} from 'react';
import {
StyleSheet,
CameraRoll,
TouchableOpacity,
Image,
View,
FlatList,
Platform,
} from 'react-native';
import CameraRoll from '@react-native-community/cameraroll';
import Icon from 'react-native-vector-icons/Ionicons';
import { Button } from 'react-native-elements';
import CenteredLoading from '../common/components/CenteredLoading'
import CenteredLoading from '../common/components/CenteredLoading';
import androidPermissionsService from '../common/services/android-permissions.service';
import testID from '../common/helpers/testID';
import logService from '../common/services/log.service';
import { CommonStyle } from '../styles/Common';
import { View } from 'react-native-animatable';
/**
* Gallery View
......@@ -32,36 +31,37 @@ export default class CaptureGallery extends PureComponent {
imagesLoaded: false,
offset: '',
hasMore: true,
loading: false
}
loading: false,
};
static navigationOptions = {
header: null,
tabBarIcon: ({ tintColor }) => (
<Icon name="md-radio-button-on" size={24} color={tintColor} />
)
}
),
};
/**
* Load Photos
*/
async loadPhotos() {
let allowed = true;
if (Platform.OS != 'ios' ) {
if (Platform.OS !== 'ios') {
allowed = await androidPermissionsService.checkReadExternalStorage();
if(!allowed) {
if (!allowed) {
allowed = await androidPermissionsService.readExternalStorage();
}
}
if (allowed === true) this._loadPhotos();
if (allowed === true) {
this._loadPhotos();
}
}
/**
* Load photos
*/
_loadPhotos = async() => {
if (this.state.loading || !this.state.hasMore) {
return;
}
......@@ -69,12 +69,16 @@ export default class CaptureGallery extends PureComponent {
const params = {
first: 30,
assetType: 'All',
}
};
this.setState({loading: true});
if (Platform.OS === 'ios') params.groupTypes = 'All';
if (this.state.offset) params.after = this.state.offset;
if (Platform.OS === 'ios') {
params.groupTypes = 'All';
}
if (this.state.offset) {
params.after = this.state.offset;
}
try {
const result = await CameraRoll.getPhotos(params);
......@@ -90,12 +94,12 @@ export default class CaptureGallery extends PureComponent {
logService.exception('[CaptureGallery] loadPhotos', err)
this.setState({loading: false});
}
}
};
/**
* on component mount load photos
*/
componentWillMount() {
componentDidMount() {
setTimeout(() => {
this.loadPhotos();
}, 50);
......@@ -105,9 +109,8 @@ export default class CaptureGallery extends PureComponent {
* Render
*/
render() {
if (!this.state.imagesLoaded) {
return <CenteredLoading />
return <CenteredLoading />;
}
return (
......@@ -120,7 +123,7 @@ export default class CaptureGallery extends PureComponent {
ListFooterComponent={this.state.loading ? <CenteredLoading /> : null}
numColumns={3}
/>
)
);
}
/**
......@@ -133,18 +136,27 @@ export default class CaptureGallery extends PureComponent {
*/
renderTile = (item) => {
const node = item.item.node;
const icon = node.type.startsWith('video') ? (
<View style={[CommonStyle.positionAbsolute, CommonStyle.centered]}>
<Icon name="ios-play-circle" size={24} style={CommonStyle.colorWhite}/>
</View>
) : null;
return (
<TouchableOpacity
style={styles.tileImage}
key={item.index}
onPress={() => {
onPress={
() => {
this.onSelected({
uri: node.image.uri,
type: node.type,
fileName: node.image.filename,
duration: node.image.playableDuration,
width: node.image.width,
height: node.image.height
})
height: node.image.height,
});
}
}
{...testID(`Gallery ${node.type}`)}
......@@ -152,7 +164,9 @@ export default class CaptureGallery extends PureComponent {
<Image
source={{ uri : node.image.uri }}
style={styles.tileImage}
/>
>
</Image>
{icon}
</TouchableOpacity>
);
}
......@@ -170,48 +184,9 @@ export default class CaptureGallery extends PureComponent {
}
const styles = StyleSheet.create({
screenWrapper: {
flex: 1,
flexDirection: 'column',
backgroundColor: '#FFF'
},
row: {
flexDirection: 'row',
minHeight: 120,
flex:1,
},
preview: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center'
},
capture: {
flex: 0,
backgroundColor: '#fff',
borderRadius: 5,
color: '#000',
padding: 10,
margin: 40
},
tileImage: {
minHeight: 120,
flex: 1,
padding: 1,
},
listView: {
backgroundColor: '#FFF',
flex:1,
padding: 1,
},
selectedImage: {
flex:3,
borderWidth:1,
borderColor: 'white',
},
submitButton: {
position: 'absolute',
top:15,
right:30,
zIndex:100
}
});
\ No newline at end of file
......@@ -15,32 +15,42 @@ import testID from '../common/helpers/testID';
import i18n from '../common/services/i18n.service';
import connectivityService from '../common/services/connectivity.service';
export default
@inject('capture')
@observer
export default class CapturePostButton extends Component {
class CapturePostButton extends Component {
/**
* Render
*/
render() {
const attachment = this.props.capture.attachment;
const isPosting = this.props.capture.isPosting;
const text = connectivityService.isConnected ? (this.props.text || i18n.t('capture.post')) : i18n.t('offline');
return (
<View style={styles.posterActions} >
{
attachment.uploading ?
<Progress.Pie progress={attachment.progress} size={36} />
:
(isPosting || attachment.checkingVideoLength) ?
<ActivityIndicator size={'large'} />
:
<TouchableOpacity
onPress={this.props.onPress}
disabled={!connectivityService.isConnected}
style={[styles.button, CS.borderRadius10x, connectivityService.isConnected ? CS.borderPrimary : CS.borderGreyed, CS.border]}
{...testID('Capture Post Button')}
>
<Text style={[styles.buttonText, connectivityService.isConnected ? CS.colorPrimary : CS.colorGreyed]}>{text}</Text>
</TouchableOpacity>
<View style={styles.posterActions}>
{attachment.uploading ?
<Progress.Pie progress={attachment.progress} color={colors.primary} size={36} />
: isPosting ?
<ActivityIndicator size={'large'} />
:
<TouchableOpacity
onPress={this.props.onPress}
disabled={!connectivityService.isConnected}
style={[
styles.button,
CS.borderRadius10x,
connectivityService.isConnected
? CS.borderPrimary
: CS.borderGreyed,
CS.border,
]}
{...testID('Capture Post Button')}
>
<Text style={[styles.buttonText, connectivityService.isConnected ? CS.colorPrimary : CS.colorGreyed]}>{text}</Text>
</TouchableOpacity>
}
</View>
)
......@@ -54,6 +64,7 @@ const styles = StyleSheet.create({
alignItems: 'flex-end',
justifyContent: 'center',
alignContent: 'center',
paddingRight: 10,
},
buttonText: {
fontSize: 16,
......
import React, { PureComponent } from 'react';
import { StyleSheet, View, Image } from 'react-native';
import { StyleSheet, View, Image, Platform } from 'react-native';
import MindsVideo from '../media/MindsVideo';
......@@ -15,25 +15,29 @@ export default class CapturePreview extends PureComponent {
switch (this.props.type) {
case 'image/gif':
case 'image/jpeg':
case 'image':
default:
body = <Image
resizeMode='contain'
source={{ uri: this.props.uri }}
style={styles.preview}
/>
body = (
<Image
resizeMode="contain"
source={{uri: this.props.uri}}
style={styles.preview}
/>
);
break;
case 'video/mp4':
body = <View style={styles.preview}>
<MindsVideo video={{ 'uri': this.props.uri }} />
</View>
case 'video/quicktime':
case 'video/x-m4v':
case 'video':
body = (
<View style={styles.preview}>
<MindsVideo video={{uri: this.props.uri}} />
</View>
);
break;
}
return (
<View style={styles.wrapper}>
{body}
</View>
);
return <View style={styles.wrapper}>{body}</View>;
}
}
......@@ -43,7 +47,7 @@ const styles = StyleSheet.create({
flex: 1,
flexDirection: 'row',
alignItems: 'stretch',
backgroundColor: 'black'
backgroundColor: 'black',
},
preview: {
flex: 1,
......
......@@ -2,24 +2,17 @@
Component,
} from 'react';
import {
TabNavigator
} from 'react-navigation';
import {
StyleSheet,
CameraRoll,
View,
Text,
TouchableHighlight,
Platform
Platform,
} from 'react-native';
import ActionSheet from 'react-native-actionsheet';
import { Button } from 'react-native-elements';
import Icon from 'react-native-vector-icons/Ionicons';
import Topbar from '../topbar/Topbar';
import { CommonStyle } from '../styles/Common';
import colors from '../styles/Colors';
import attachmentService from '../common/services/attachment.service';
......
......@@ -6,7 +6,7 @@ import { Icon } from 'react-native-elements'
import { observer, inject } from 'mobx-react/native';
import entities from 'entities';
import * as entities from 'entities';
import {
Text,
......
This diff is collapsed.
......@@ -307,7 +307,7 @@ export default class MediaView extends Component {
this.openLink();
} else {
const source = this.props.entity.getThumbSource('xlarge');
this.props.navigation.push('ViewImage', { source });
this.props.navigation.push('ViewImage', { source, entity: this.props.entity });
}
}
......
......@@ -11,7 +11,7 @@ import {
import { observer } from "mobx-react/native";
import entities from 'entities';
import * as entities from 'entities';
import { Icon } from 'react-native-elements'
import { CommonStyle } from '../../styles/Common';
......
......@@ -3,7 +3,6 @@ import React, {
} from 'react';
import { observer } from 'mobx-react/native';
import Placeholder from 'rn-placeholder';
import {
findNodeHandle,
......@@ -61,23 +60,6 @@ export default class ExplicitImage extends Component {
style={[CommonStyle.positionAbsolute, this.props.imageStyle]}
/>
);
case 'placeholder':
return (
<View style={[CommonStyle.positionAbsolute, this.props.imageStyle]}>
<FastImage
source={this.props.source}
onError={this.imageError}
onLoadEnd={this.setActive}
style={[CommonStyle.positionAbsolute, this.props.imageStyle]}
/>
{!this.state.ready && <Placeholder.Box
height="100%"
width="100%"
animate="fade"
color="grey"
/>}
</View>
);
case 'progress':
return (
<ProgressFastImage
......
......@@ -3,7 +3,7 @@ import React, {
} from 'react';
import {observer} from "mobx-react/native";
import entities from 'entities';
import * as entities from 'entities';
import {
Text,
StyleSheet,
......
import CreditCardType from 'credit-card-type';
export default function creditCardType(number, single = true) {
if (!number) {
return null;
}
const cards = CreditCardType(number);
if (!cards || typeof cards[0] === 'undefined' || (single && cards.length > 1)) {
return null;
}
if (single) {
return cards[0];
}
return cards;
}
......@@ -3,5 +3,6 @@ export default {
get: jest.fn(),
put: jest.fn(),
upload: jest.fn(),
delete: jest.fn()
}
\ No newline at end of file
delete: jest.fn(),
clearCookies: jest.fn(),
};
const feedService = function() {
this.getEntities = jest.fn();
this.prepend = jest.fn();
this.setPaginated =jest.fn().mockImplementation(() => this);
this.setInjectBoost = jest.fn().mockImplementation(() => this);
this.setLimit = jest.fn().mockImplementation(() => this);
this.setOffset = jest.fn().mockImplementation(() => this);
......
import Cancelable from 'promise-cancelable';
import { NativeModules } from 'react-native';
import session from './session.service';
import { MINDS_API_URI, MINDS_URI_SETTINGS, NETWORK_TIMEOUT } from '../../config/Config';
import { btoa } from 'abab';
import abortableFetch from '../helpers/abortableFetch';
import { Version } from '../../config/Version';
......@@ -13,35 +13,49 @@ import logService from './log.service';
*/
export class ApiError extends Error {
constructor(...args) {
super(...args)
super(...args);
}
}
export const isApiError = function(err) {
return err instanceof ApiError;
}
};
/**
* Api service
*/
class ApiService {
/**
* Clear cookies
*/
clearCookies() {
return new Promise(success => {
NativeModules.Networking.clearCookies(success);
});
}
/**
* Build headers
*/
buildHeaders() {
const basicAuth = MINDS_URI_SETTINGS && MINDS_URI_SETTINGS.basicAuth,
accessToken = session.token,
headers = {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'App-Version': Version.VERSION
};
if (session.token) {
headers.Authorization = 'Bearer ' + session.token;
}
const headers = {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'App-Version': Version.VERSION
};
if (session.token) {
headers.Authorization = 'Bearer ' + session.token;
}
return headers;
}
/**
* Build url
* @param {string} url
* @param {any} params
*/
buildUrl(url, params = {}) {
if (!params) {
params = {};
......@@ -55,6 +69,7 @@ class ApiService {
return `${url}${sep}${paramsString}`
}
getParamsString(params) {
return Object.keys(params).map(k => {
return encodeURIComponent(k) + "=" + encodeURIComponent(params[k]);
......
......@@ -24,6 +24,7 @@ class BoostedContentService {
await this.feedsService
.setLimit(12)
.setOffset(0)
.setPaginated(false)
.setEndpoint('api/v2/boost/feed')
.fetchRemoteOrLocal();
......
import {
CameraRoll,
Platform,
} from 'react-native';
import CameraRoll from "@react-native-community/cameraroll";
import session from './session.service';
import RNFS from 'react-native-fs';
import permissions from './android-permissions.service';
......@@ -49,7 +51,7 @@ class DownloadService {
/**
* Check if entity has gif flag
* @param {object} entity
* @param {object} entity
*/
isGif(entity){
let isGif = false;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.