Skip to content

Commit 0100d18

Browse files
authored
Merge pull request #1 from timjam/feature/simpleSignInFunctionality
Feature/simple sign in functionality. Not finished yet. Merging to master for presentation
2 parents c772551 + 22fa49b commit 0100d18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10611
-126
lines changed

.eslintrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"parser": "babel-eslint",
3+
"env": {
4+
"browser": true
5+
},
6+
"plugins": [
7+
"react"
8+
],
9+
"extends": [
10+
"airbnb"
11+
],
12+
"rules": {
13+
"arrow-body-style": "off",
14+
"react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx"] }],
15+
"react/forbid-prop-types": [0],
16+
"react/require-default-props": [0],
17+
"arrow-parens": [0],
18+
"no-underscore-dangle": [0],
19+
"react/prefer-stateless-function": [0]
20+
}
21+
}

App.js

Lines changed: 0 additions & 114 deletions
This file was deleted.

RosterRN_WS.code-workspace

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
]
7+
}

android/app/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,11 @@ android {
188188
}
189189

190190
dependencies {
191+
implementation project(':react-native-vector-icons')
191192
implementation fileTree(dir: "libs", include: ["*.jar"])
192193
implementation "com.facebook.react:react-native:+" // From node_modules
194+
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
195+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
193196

194197
if (enableHermes) {
195198
def hermesPath = "../../node_modules/hermesvm/android/";
68.7 KB
Binary file not shown.
64 KB
Binary file not shown.
13.1 KB
Binary file not shown.
56.9 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
306 KB
Binary file not shown.
55.6 KB
Binary file not shown.
110 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
27.7 KB
Binary file not shown.
Binary file not shown.
25 KB
Binary file not shown.

android/app/src/main/java/com/rosterrn/MainApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
88
import com.facebook.react.bridge.JavaScriptExecutorFactory;
99
import com.facebook.react.ReactApplication;
10+
import com.oblador.vectoricons.VectorIconsPackage;
1011
import com.facebook.react.ReactNativeHost;
1112
import com.facebook.react.ReactPackage;
1213
import com.facebook.soloader.SoLoader;

android/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
rootProject.name = 'RosterRN'
2+
include ':react-native-vector-icons'
3+
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
24
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
35
include ':app'

app/components/Alert/AlertProvider.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
3+
import { View } from 'react-native';
4+
import DropDownAlert from 'react-native-dropdownalert';
5+
6+
class AlertProvider extends Component {
7+
static childContextTypes = {
8+
alertWithType: PropTypes.func,
9+
alert: PropTypes.func,
10+
}
11+
12+
static propTypes = {
13+
children: PropTypes.any,
14+
}
15+
16+
getChildContext() {
17+
return {
18+
alert: (...args) => this.dropdown.alert(...args),
19+
alertWithType: (...args) => this.dropdown.alertWithType(...args),
20+
};
21+
}
22+
23+
render() {
24+
return (
25+
<View style={{ flex: 1 }}>
26+
{React.Children.only(this.props.children)}
27+
<DropDownAlert
28+
ref={(ref) => { this.dropdown = ref; }}
29+
/>
30+
</View>
31+
);
32+
}
33+
}
34+
35+
export default AlertProvider;

app/components/Alert/connectAlert.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import PropTypes from 'prop-types';
2+
import React, { Component } from 'react';
3+
import hoistNonReactStatic from 'hoist-non-react-statics';
4+
5+
const connectAlert = (WrappedComponent) => {
6+
class ConnectedAlert extends Component {
7+
render() {
8+
return (
9+
<WrappedComponent
10+
{...this.props}
11+
alertWithType={this.context.alertWithType}
12+
alert={this.context.alert}
13+
/>
14+
);
15+
}
16+
}
17+
18+
ConnectedAlert.contextTypes = {
19+
alertWithType: PropTypes.func,
20+
alert: PropTypes.func,
21+
};
22+
23+
return hoistNonReactStatic(ConnectedAlert, WrappedComponent);
24+
};
25+
26+
export default connectAlert;

app/components/Alert/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import AlertProvider from './AlertProvider';
2+
import connectAlert from './connectAlert';
3+
4+
export {
5+
AlertProvider,
6+
connectAlert,
7+
};

app/components/Container/Container.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from 'react';
2+
import { PropTypes } from 'prop-types';
3+
import { View, ScrollView } from 'react-native';
4+
import styles from './styles';
5+
6+
const Container = ({ scroll, children, passProps }) => {
7+
if (scroll === true) {
8+
return (
9+
<ScrollView style={styles.scrollView} {...passProps}>
10+
{children}
11+
</ScrollView>
12+
);
13+
}
14+
15+
return (
16+
<View style={styles.view} {...passProps}>
17+
{children}
18+
</View>
19+
);
20+
};
21+
22+
Container.propTypes = {
23+
scroll: PropTypes.bool,
24+
children: PropTypes.any,
25+
passProps: PropTypes.object,
26+
};
27+
28+
export default Container;

app/components/Container/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Container from './Container';
2+
3+
export default Container;

app/components/Container/styles.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { create } from 'react-native-platform-stylesheet';
2+
import colors from '../../config/colors';
3+
4+
export default create({
5+
view: {
6+
flex: 1,
7+
justifyContent: 'center',
8+
backgroundColor: colors.background,
9+
},
10+
scrollView: {
11+
backgroundColor: colors.background,
12+
},
13+
});

app/components/Form/Input.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React, { Component } from 'react';
2+
import { PropTypes } from 'prop-types';
3+
import { View } from 'react-native';
4+
import { FormLabel, FormInput, FormValidationMessage } from 'react-native-elements';
5+
import styles from '../Container/styles';
6+
7+
// Might not need this component yet at all
8+
9+
class Input extends Component {
10+
render() {
11+
return (
12+
<View>
13+
<FormLabel>{this.props.label}</FormLabel>
14+
<FormInput
15+
autoCapitalize="none"
16+
autoCorrect={false}
17+
inputStyle={styles.input}
18+
{...this.props}
19+
/>
20+
<FormValidationMessage>{this.props.validationMessage}</FormValidationMessage>
21+
</View>
22+
);
23+
}
24+
}
25+
26+
Input.propTypes = {
27+
label: PropTypes.string,
28+
validationMessage: PropTypes.string,
29+
};
30+
31+
export default Input;

app/components/Text/LinkText.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { Text } from 'react-native';
4+
import styles from './styles';
5+
6+
const LinkText = (props) => (
7+
<Text
8+
style={styles.linkText}
9+
onPress={props.onPress}
10+
>
11+
{props.children}
12+
</Text>
13+
);
14+
15+
LinkText.propTypes = {
16+
children: PropTypes.string,
17+
onPress: PropTypes.func,
18+
};
19+
20+
export default LinkText;

app/components/Text/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* eslint-disable import/prefer-default-export */
2+
import LinkText from './LinkText';
3+
4+
export { LinkText };

app/components/Text/styles.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { StyleSheet } from 'react-native';
2+
import colors from '../../config/colors';
3+
4+
export default StyleSheet.create({
5+
linkText: {
6+
fontSize: 14,
7+
color: colors.linkText,
8+
marginVertical: 10,
9+
},
10+
});

app/config/colors.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
primary: '#3B5998',
3+
background: '#f7f7f7',
4+
defaultText: '#181818',
5+
iconSubtle: '#a2a2a2',
6+
textSubtle: '#848484',
7+
red: '#F44336',
8+
linkText: '#3792cb',
9+
};

app/config/connection.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
// This is currently localhost at home. Android
3+
// requires the whole IP address instead of just
4+
// localhost
5+
SERVER_URL: 'http://192.168.1.101',
6+
};

0 commit comments

Comments
 (0)