diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..334d4cc0b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,41 @@
+matrix:
+ include:
+ - os: linux
+ dist: trusty
+ sudo: false
+ language: android
+ before_install:
+ - openssl aes-256-cbc -K $encrypted_985c748be78d_key -iv $encrypted_985c748be78d_iv -in key.keystore.enc -out android/app/key.keystore -d
+
+ - mkdir -p ~/.gradle
+ - echo -e "ROCKETCHAT_RN_RELEASE_STORE_FILE=$ROCKETCHAT_RN_RELEASE_STORE_FILE" > ~/.gradle/gradle.properties
+ - echo -e "ROCKETCHAT_RN_RELEASE_STORE_PASSWORD=$ROCKETCHAT_RN_RELEASE_STORE_PASSWORD" >> ~/.gradle/gradle.properties
+ - echo -e "ROCKETCHAT_RN_RELEASE_KEY_ALIAS=$ROCKETCHAT_RN_RELEASE_KEY_ALIAS" >> ~/.gradle/gradle.properties
+ - echo -e "ROCKETCHAT_RN_RELEASE_KEY_PASSWORD=$ROCKETCHAT_RN_RELEASE_KEY_PASSWORD" >> ~/.gradle/gradle.properties
+ - nvm install 8
+ - node --version
+ install:
+ - npm install
+ android:
+ components:
+ - tools
+ - build-tools-23.0.1
+ - build-tools-25.0.1
+ - build-tools-26.0.1
+ - android-23
+ - android-25
+ - android-26
+ - extra-android-m2repository
+ - extra-google-google_play_services
+ - extra-google-m2repository
+ - addon-google_apis-google-16
+ script:
+ - npm run ci
+ - cd android && ./gradlew assembleRelease
+
+ - os: osx
+ osx_image: xcode8.3
+ language: node_js
+ node_js: 8
+ script:
+ - npm run ci
diff --git a/Logo.png b/Logo.png
index c8da5de4b..d3da13231 100644
Binary files a/Logo.png and b/Logo.png differ
diff --git a/README.md b/README.md
index 12f6202a7..b7d1096e4 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,9 @@
# Rocket.Chat React Native Mobile
+[![Build Status](https://img.shields.io/travis/RocketChat/Rocket.Chat.ReactNative/master.svg)](https://travis-ci.org/RocketChat/Rocket.Chat.ReactNative)
+[![Project Dependencies](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative.svg)](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative)
+[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bb15e2392a71473ea59d3f634f35c54e)](https://www.codacy.com/app/RocketChat/Rocket.Chat.ReactNative?utm_source=github.com&utm_medium=referral&utm_content=RocketChat/Rocket.Chat.ReactNative&utm_campaign=badger)
+
**Supported Server Versions:** 0.58.0+ (We are working to support earlier versions)
# Installing Dependencies
diff --git a/app/components/message/card.js b/app/components/message/card.js
index b97cd8e57..6caecdd42 100644
--- a/app/components/message/card.js
+++ b/app/components/message/card.js
@@ -23,7 +23,12 @@ const CustomButton = ({ text }) => (
);
+CustomButton.propTypes = {
+ text: PropTypes.string
+};
+
Navigation.registerComponent('CustomButton', () => CustomButton);
+
export default class Cards extends React.PureComponent {
static propTypes = {
data: PropTypes.object.isRequired
diff --git a/app/utils/throttle.js b/app/utils/throttle.js
index 58afcbffd..adf492a56 100644
--- a/app/utils/throttle.js
+++ b/app/utils/throttle.js
@@ -1,11 +1,12 @@
export default function throttle(fn, threshhold = 250, scope) {
- let last,
- deferTimer;
- return function() {
+ let last;
+ let deferTimer;
+
+ return (...args) => {
const context = scope || this;
- let now = +new Date(),
- args = arguments;
+ const now = +new Date();
+
if (last && now < last + threshhold) {
// hold on to it
clearTimeout(deferTimer);
diff --git a/key.keystore.enc b/key.keystore.enc
new file mode 100644
index 000000000..4428983cb
Binary files /dev/null and b/key.keystore.enc differ
diff --git a/package.json b/package.json
index 6d4b86455..56e5c87e1 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,12 @@
{
- "name": "rocket-chat-rn",
+ "name": "rocket-chat-reactnative",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint .",
+ "ci": "eslint .",
"ios": "react-native run-ios",
"log-android": "react-native log-android",
"android": "react-native run-android",
diff --git a/storybook/stories/Button/index.android.js b/storybook/stories/Button/index.android.js
deleted file mode 100644
index 7a285bc65..000000000
--- a/storybook/stories/Button/index.android.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
-
-import React, { PropTypes } from 'react';
-import { TouchableNativeFeedback } from 'react-native';
-
-export default function Button(props) {
- return (
-
- {props.children}
-
- );
-}
-
-Button.defaultProps = {
- children: null,
- onPress: () => {},
-};
-
-Button.propTypes = {
- children: PropTypes.node,
- onPress: PropTypes.func,
-};
diff --git a/storybook/stories/Button/index.ios.js b/storybook/stories/Button/index.ios.js
deleted file mode 100644
index 035cacc61..000000000
--- a/storybook/stories/Button/index.ios.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
-
-import React, { PropTypes } from 'react';
-import { TouchableHighlight } from 'react-native';
-
-export default function Button(props) {
- return (
-
- {props.children}
-
- );
-}
-
-Button.defaultProps = {
- children: null,
- onPress: () => {},
-};
-
-Button.propTypes = {
- children: PropTypes.node,
- onPress: PropTypes.func,
-};
diff --git a/storybook/stories/CenterView/index.js b/storybook/stories/CenterView/index.js
deleted file mode 100644
index e6c8fc60e..000000000
--- a/storybook/stories/CenterView/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
-
-import React, { PropTypes } from 'react';
-import { View } from 'react-native';
-import style from './style';
-
-export default function CenterView(props) {
- return (
-
- {props.children}
-
- );
-}
-
-CenterView.defaultProps = {
- children: null,
-};
-
-CenterView.propTypes = {
- children: PropTypes.node,
-};
diff --git a/storybook/stories/CenterView/style.js b/storybook/stories/CenterView/style.js
deleted file mode 100644
index ff347fd98..000000000
--- a/storybook/stories/CenterView/style.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default {
- main: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: '#F5FCFF',
- },
-};
diff --git a/storybook/stories/Welcome/index.js b/storybook/stories/Welcome/index.js
deleted file mode 100644
index 47d0976f5..000000000
--- a/storybook/stories/Welcome/index.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
-
-import React, { PropTypes } from 'react';
-import { View, Text, Button } from 'react-native';
-
-export default class Welcome extends React.Component {
- styles = {
- wrapper: {
- flex: 1,
- padding: 24,
- justifyContent: 'center'
- },
- header: {
- fontSize: 18,
- marginBottom: 18
- },
- content: {
- fontSize: 12,
- marginBottom: 10,
- lineHeight: 18
- }
- };
-
- showApp(event) {
- event.preventDefault();
- if (this.props.showApp) { this.props.showApp(); }
- }
-
- render() {
- return (
-
- Welcome to React Native Storybook
-
- This is a UI Component development environment for your React Native app. Here you can
- display and interact with your UI components as stories. A story is a single state of one
- or more UI components. You can have as many stories as you want. In other words a story is
- like a visual test case.
-
-
- We have added some stories inside the "storybook/stories" directory for examples. Try
- editing the "storybook/stories/Welcome.js" file to edit this message.
-
-
- );
- }
-}
-
-Welcome.defaultProps = {
- showApp: null
-};
-
-Welcome.propTypes = {
- showApp: PropTypes.func
-};