diff --git a/MobileApp/App.js b/MobileApp/App.js
index 245642c..4a824b4 100644
--- a/MobileApp/App.js
+++ b/MobileApp/App.js
@@ -1,25 +1,37 @@
import React from 'react';
-import { StyleSheet, View, Image } from 'react-native';
-//import SignIn from './src/components/sign-in'
+import {StyleSheet, View, Image, NavigatorIOS} from 'react-native';
+import SignIn from './src/components/sign-in'
//import HelloWorld from './src/hello-world'
import EventList from './src/components/event-list'
import fixtures from './fixtures.json'
import img from './assets/images/logo.png'
-
+import EventScreen from './src/components/event-screen-1'
const events = Object.entries(fixtures.events).map(([uid, event]) => ({...event, uid}))
+/*export default class App extends React.Component {
+ render() {
+ return (
+
+
+ );
+ }
+}*/
+
export default class App extends React.Component {
render() {
return (
-
-
+
+ {/**/}
- );
+ )
}
}
@@ -32,9 +44,9 @@ const styles = StyleSheet.create({
paddingTop: 30,
paddingBottom: 30,
},
- image: {
- width: '100%',
- height: 100
- }
+ image: {
+ width: '100%',
+ height: 100
+ }
});
diff --git a/MobileApp/package.json b/MobileApp/package.json
index bb23e24..fff8191 100644
--- a/MobileApp/package.json
+++ b/MobileApp/package.json
@@ -23,4 +23,4 @@
"react": "16.3.1",
"react-native": "~0.55.2"
}
-}
\ No newline at end of file
+}
diff --git a/MobileApp/src/components/event-list.js b/MobileApp/src/components/event-list.js
index 7156d55..725da84 100644
--- a/MobileApp/src/components/event-list.js
+++ b/MobileApp/src/components/event-list.js
@@ -1,26 +1,74 @@
-import React, { Component } from 'react'
-import {ScrollView, StyleSheet, Text} from 'react-native'
+import React, {Component} from 'react'
+import {Button, View, StyleSheet, Text, SectionList, NavigatorIOS} from 'react-native'
import Card from './common/card'
+import EventScreen from './event-screen-1'
+
+
class EventList extends Component {
- static propTypes = {
-
- };
-
- render() {
- return (
-
- {this.props.events.map(event =>
-
- {event.title}
-
- )}
-
- )
- }
+ static propTypes = {};
+
+ render() {
+ const sections = Object
+ .entries(this.props.events
+ .reduce((acc, event) => {
+ const firstLetter = event.title[0].toUpperCase()
+ acc[firstLetter] = [...acc[firstLetter] || [], event.title]
+ return acc;
+ }, {}))
+ .map(([firstLetter, data]) => ({firstLetter, data}))
+ .sort((a, b) => a.firstLetter > b.firstLetter)
+
+ return (
+
+ alert(item)}
+ style = {styles.item}
+ >{item}
+
+ }
+ renderSectionHeader={({section: {firstLetter}}) =>
+
+ {firstLetter}
+
+ }
+ sections={sections}
+ keyExtractor={(item, index) => item + index}
+ />
+ /*
+
+ {this.props.events.map(event =>
+
+ {event.title}
+
+ )}
+ */
+
+
+ )
+ }
+
}
const styles = StyleSheet.create({
+ firstLetter: {
+ textAlign: 'center',
+ margin: 5,
+ fontSize: 20,
+ fontFamily: 'HelveticaNeue-Bold',
+ },
+ firstLetterView: {
+ backgroundColor: '#fff'
+ },
+ item : {
+ margin: 5,
+ fontSize: 15,
+ paddingLeft: 10,
+ paddingRight: 10,
+ fontFamily: 'HelveticaNeue-Light',
+ }
})
+
export default EventList
\ No newline at end of file
diff --git a/MobileApp/src/components/event-screen-1.js b/MobileApp/src/components/event-screen-1.js
new file mode 100644
index 0000000..661c1d1
--- /dev/null
+++ b/MobileApp/src/components/event-screen-1.js
@@ -0,0 +1,89 @@
+import React, {Component} from 'react'
+import {View, StyleSheet, Text, ImageBackground, Linking, TouchableOpacity, Button, AlertIOS} from 'react-native'
+
+class EventScreen extends Component {
+ static propTypes = {};
+
+ render() {
+ const {title, url, when, where, uid} = this.props.event
+ return (
+
+ Linking.openURL(url)}>
+
+
+
+ {title.toUpperCase()}
+
+
+ {when}
+
+
+ {where}
+
+
+
+
+
+ )
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ },
+ image: {
+ height: 700,
+ width: 350,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ paragraph: {
+ textAlign: 'left',
+ margin: 5,
+ fontSize: 20,
+ color: '#fff',
+ fontFamily: 'HelveticaNeue-Thin'
+ },
+ title: {
+ textAlign: 'left',
+ margin: 5,
+ fontSize: 20,
+ color: '#fff',
+ fontFamily: 'HelveticaNeue-Light'
+ },
+ text: {
+ backgroundColor: '#000',
+ opacity: .5,
+ width: 350,
+ height: 200,
+ position: 'absolute'
+
+ }
+});
+
+export default EventScreen
\ No newline at end of file
diff --git a/MobileApp/src/components/sign-in.js b/MobileApp/src/components/sign-in.js
index 7a0a54d..383ebb9 100644
--- a/MobileApp/src/components/sign-in.js
+++ b/MobileApp/src/components/sign-in.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
-import {View, Text, TextInput, Platform} from 'react-native'
+import {View, Text, TextInput, Platform, Button, Alert} from 'react-native'
class SignIn extends Component {
static propTypes = {
@@ -27,12 +27,28 @@ class SignIn extends Component {
onChangeText = {this.handlePasswordChange}
secureTextEntry
/>
+
)
}
handleEmailChange = email => this.setState({ email })
handlePasswordChange = password => this.setState({ password })
+ handleSubmit = () => Alert.alert(
+ 'Alert Title',
+ 'My Alert Msg',
+ [
+ {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
+ {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
+ {text: 'OK', onPress: () => console.log('OK Pressed')},
+ ],
+ { cancelable: false }
+ )
+
}
const styles = {
@@ -43,7 +59,7 @@ const styles = {
borderBottomColor: '#000'
},
android: {
-
+ elevation: 2
}
})
}
diff --git a/admin/src/config.js b/admin/src/config.js
index aa22b3b..f110418 100644
--- a/admin/src/config.js
+++ b/admin/src/config.js
@@ -2,15 +2,15 @@ import firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/database'
-export const appName = 'advreact-10-05'
+export const appName = 'advancedreactcourse'
export const config = {
- apiKey: 'AIzaSyCbMQM0eQUSQ0SuLVAu9ZNPUcm4rdbiB8U',
+ apiKey: 'AIzaSyCCtMGA9FTNVds_QTkB1oRTlqF2u07MHuk',
authDomain: `${appName}.firebaseapp.com`,
databaseURL: `https://${appName}.firebaseio.com`,
projectId: appName,
storageBucket: '',
- messagingSenderId: '1094825197832'
+ messagingSenderId: '649150663252'
}
firebase.initializeApp(config)
diff --git a/admin/src/routes/auth.js b/admin/src/routes/auth.js
index f3b3e3d..2a1f463 100644
--- a/admin/src/routes/auth.js
+++ b/admin/src/routes/auth.js
@@ -34,4 +34,7 @@ class AuthPage extends Component {
signIn = ({ email, password }) => this.props.signIn(email, password)
}
-export default connect(null, { signUp, signIn })(AuthPage)
+export default connect(
+ null,
+ { signUp, signIn }
+)(AuthPage)
diff --git a/admin/src/routes/person-page.js b/admin/src/routes/person-page.js
index 496bb25..85224df 100644
--- a/admin/src/routes/person-page.js
+++ b/admin/src/routes/person-page.js
@@ -18,4 +18,7 @@ class PersonPage extends Component {
}
}
-export default connect(null, { addPerson })(PersonPage)
+export default connect(
+ null,
+ { addPerson }
+)(PersonPage)