Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile app for expetiza - WIP #2

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { ConfigureStore } from './redux/configureStore';
const store = ConfigureStore();
export default class App extends React.Component {



render() {
render() {
return (
<Provider store={store}>
<Main />
Expand Down
5 changes: 4 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"platforms": ["ios", "android"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/logo.png",
"icon": "./assets/images/square.png",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
Expand All @@ -20,6 +20,9 @@
"assetBundlePatterns": [
"**/*"
],
"android": {
"package": "com.expertiza.expertiza"
},
"ios": {
"supportsTablet": true
}
Expand Down
Binary file added assets/images/square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions axios-instance.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import axios from 'axios';
import { SecureStore } from 'expo';
import { SecureStore } from 'expo';


const instance = axios.create({
baseURL : 'http://192.168.1.122:3000/api/v1/'
baseURL : 'http://152.46.17.203:3001/api/v1/'
});


export default instance;
4 changes: 0 additions & 4 deletions components/.expo/packager-info.json

This file was deleted.

7 changes: 0 additions & 7 deletions components/.expo/settings.json

This file was deleted.

1 change: 1 addition & 0 deletions components/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<uses-permission android:name="android.permission.VIBRATE"/>
110 changes: 37 additions & 73 deletions components/AssignmentComponent/AssignmentComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ class Assignment extends Component {

}
}

componentDidMount(){
this.props.fetchStudentTasks(this.props.jwt);
this.props.fetchStudentsTeamedWith(this.props.jwt);
}


create_cards = () => {

let flags = []
Expand All @@ -41,42 +38,28 @@ class Assignment extends Component {
let list_array = []
{
this.props.studentTasks.map((studentTask1) => {

if(flags.indexOf(studentTask1.course_name) < 0){
flags.push(studentTask1.course_name);
count++;
}
}
);
if(flags.indexOf(studentTask1.course_name) < 0){
flags.push(studentTask1.course_name);
count++;
}
});
}

for(i=0; i < flags.length; i++)
{
let f
f = flags[i];


{
this.props.studentTasks.map((studentTask2) => {

{
let f
f = flags[i];
{this.props.studentTasks.map((studentTask2) => {
let deadline = studentTask2.stage_deadline.split(".",1).toString();

var q = new Date();
var m = q.getMonth();
var d = q.getDay();
var y = q.getFullYear();

var date = new Date(y,m,d);

deadline = deadline.split("T",1).toString();

mydate=new Date(deadline);

if(date>mydate)
{
if(date>mydate){
deadline = "Finished";
}

if(studentTask2.course_name == f){
list_array.push(
<ListItem
Expand All @@ -95,60 +78,41 @@ class Assignment extends Component {

/>)
}
}
)
}
card_array.push(
<Card
title = {f}
key = {i}
containerStyle={{

borderWidth: 1,
borderColor: 'gray',
marginRight:20,
marginLeft:20,
marginTop:10,
paddingTop:10,
paddingBottom:10,
paddingRight:1,
borderRadius:10,

}}

>

{list_array}

</Card>
);
}


})}
card_array.push(
<Card
title = {f}
key = {i}
containerStyle={{

borderWidth: 1,
borderColor: 'gray',
marginRight:20,
marginLeft:20,
marginTop:10,
paddingTop:10,
paddingBottom:10,
paddingRight:1,
borderRadius:10,
}}>{list_array}
</Card>);
}
return card_array;
}


static navigationOptions = ({ navigation, navigationOptions }) => {
return{
title: 'Assignments',
headerLeft: <Icon name='menu' size={24}
iconStyle={{ color: 'white' }}
onPress={ () => navigation.toggleDrawer() } />
};
title: 'Assignments',
headerLeft: <Icon name='menu' size={24}
iconStyle={{ color: 'white' }}
onPress={ () => navigation.toggleDrawer() } />
}
};

render(){

return(

<ScrollView>

<View style = {styles.container}>

{this.create_cards()}

</View>
<View style = {styles.container}>
{this.create_cards()}
</View>
</ScrollView>
);
}
Expand Down
Loading