Skip to content

Commit

Permalink
Merge pull request #168 from AmericaSCORESBayArea/refactor/teamSeason…
Browse files Browse the repository at this point in the history
…List

Refactor/team season list
  • Loading branch information
Ignacioals authored Sep 9, 2021
2 parents 9738c77 + 85373e6 commit 7e2ac6d
Show file tree
Hide file tree
Showing 14 changed files with 1,751 additions and 11,277 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ android {
applicationId "com.americaScoresAttendance.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 18
versionName '1.9a'
versionCode 23
versionName '1.91a'

missingDimensionStrategy 'react-native-camera', 'general'
manifestPlaceholders = [appAuthRedirectScheme: 'com.redirectScheme.comm']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.reactnativedocumentpicker.DocumentPickerPackage;

import co.apptailor.googlesignin.RNGoogleSigninPackage;

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 29
supportLibVersion = "28.0.0"
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'AmericanScoresApp'
include ':react-native-document-picker'
project(':react-native-document-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-document-picker/android')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':@react-native-community_google-signin'
Expand Down
Binary file added assets/error_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ target 'AmericanScoresApp' do
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"

pod 'react-native-document-picker', :path => '../node_modules/react-native-document-picker'

post_install do |installer|
flipper_post_install(installer)
end
Expand Down
2,550 changes: 1,530 additions & 1,020 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
"lodash": "^4.17.21",
"moment": "^2.29.1",
"node-notifier": "^9.0.0",
"path-parse": "^1.0.7",
"plist": "^3.0.2",
"react": "16.13.1",
"react-dom": "~16.11.0",
"react-native": "0.63.3",
"react-native": "0.64.1",
"react-native-camera": "^3.40.0",
"react-native-document-picker": "^6.0.4",
"react-native-gesture-handler": "^1.8.0",
"react-native-permissions": "^2.2.2",
"react-native-qrcode-scanner": "^1.4.1",
Expand All @@ -54,6 +56,7 @@
"react-native-web": "~0.11.7",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"tar": "^6.1.11",
"ua-parser-js": "^0.7.28",
"url-parse": "^1.5.1",
"xmldom": "^0.5.0",
Expand Down
21 changes: 19 additions & 2 deletions src/Attendance.Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,14 +650,31 @@ class AttendanceScreen extends Component {
/>
</Layout>
);
const UnsuccessHeader = (props) => (
<Layout {...props}>
<ImageBackground
resizeMode="contain"
style={{height:100, width:100, alignSelf:"center"}}
source={require('../assets/error_icon.png')}
/>
</Layout>
);
const updateSuccessCard = (status, text) => (
<Card disabled={true} header={SuccessHeader}>
<Text style={styles.modalText} status={status}>{text}</Text>
<Button appearance='outline' size={'small'} onPress={() => this.toggleNotificationOff()} status={status}>
OK
</Button>
</Card>
)
);
const updateUnSuccessCard = (status, text) => (
<Card disabled={true} header={UnsuccessHeader}>
<Text style={styles.modalText} status={status}>{text}</Text>
<Button appearance='outline' size={'small'} onPress={() => this.toggleNotificationOff()} status={status}>
OK
</Button>
</Card>
);

const updateModal = () => (
<Modal
Expand All @@ -666,7 +683,7 @@ class AttendanceScreen extends Component {
onBackdropPress={() => this.toggleNotificationOff()}>
{ (this.state.responseSuccess) ?
updateSuccessCard("success", "Attendance updated successfuly") :
updateSuccessCard("danger", "Something went wrong. Please, try again.")
updateUnSuccessCard("danger", "Something went wrong. Please, try again.")
}
</Modal>)

Expand Down
15 changes: 8 additions & 7 deletions src/Auth/LogInMain.Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ class LogInScreen_Google extends Component {

async _syncUserSessions(user) {
Axios.get(`${ApiConfig.dataApi}/coach/${user.ContactId}/all`, {
params: {
date: moment("20190821", "YYYYMMDD").format("YYYY-MM-DD")
}
})
.then(res => res.data)
.catch(e => console.log(e));
params: {
firstDate: moment("20210416", "YYYYMMDD").format("YYYY-MM-DD"),
secondDate: moment("20210426", "YYYYMMDD").format("YYYY-MM-DD"),
}
})
.then(res => res.data)
.catch(e => console.log(e));
}

render() {
Expand Down Expand Up @@ -273,4 +274,4 @@ class LogInScreen_Google extends Component {
loginTittle: {
margin: '5%',
}
});
});
14 changes: 11 additions & 3 deletions src/TeamsScreen.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, {Component} from "react";
import { connect } from 'react-redux';
import { syncSessions } from "./Redux/actions/Session.actions";
import { bindActionCreators } from 'redux';
import { ImageBackground, View, StyleSheet, Image } from "react-native";
import { ImageBackground, View, StyleSheet, Image, KeyboardAvoidingView } from "react-native";

import { Layout, Divider, List, ListItem, Icon, AutocompleteItem, Autocomplete, Card, Text, IndexPath, Select, SelectItem, Modal } from '@ui-kitten/components';
import BottomSheet from 'react-native-simple-bottom-sheet';
Expand Down Expand Up @@ -36,7 +36,11 @@ class TeamsScreen extends Component {
date: moment().format("YYYY-MM-DD")
}
})
.then(response => {this.setState({data: response.data, selectedData: response.data}),this.regionFiltering(response.data)})
.then(response => {response.data.sort((a, b) => (a.TeamSeasonName.toLowerCase() > b.TeamSeasonName.toLowerCase()));
this.setState({data: response.data, selectedData: response.data}),
this.regionFiltering(response.data),
console.log(response);
})
.catch(e => console.log(e));
this.setState({displayedValue:this.state.regions[0]})//setting "basic" region filter with All
if (this.props.sessionScreen.region === 'IFC'){
Expand Down Expand Up @@ -266,6 +270,9 @@ class TeamsScreen extends Component {
/>
</ImageBackground>
<BottomSheet isOpen sliderMinHeight={28} lineStyle={{marginTop:"3%"}}>
<KeyboardAvoidingView
behavior="padding"
>
<Autocomplete style={{margin:"2%"}}
label="Search a Team"
placeholder='Search by Team name'
Expand All @@ -276,7 +283,8 @@ class TeamsScreen extends Component {
onChangeText={this.onChangeText} >
</Autocomplete>
{selectBox()}
</BottomSheet>
</KeyboardAvoidingView>
</BottomSheet>
</Layout>
);
};
Expand Down
Loading

0 comments on commit 7e2ac6d

Please sign in to comment.