merge master (remote) > master (local)

This commit is contained in:
Filipe Pinho 2019-03-07 23:18:09 +00:00
commit ea8398cd13
61 changed files with 4247 additions and 544 deletions

3
.gitignore vendored
View File

@ -84,4 +84,5 @@ typings/
bin/
obj/
.vscode/
.vscode/
*.cache

View File

@ -149,6 +149,7 @@ android {
}
dependencies {
compile project(':react-native-device-info')
compile project(':react-native-material-shadows')
compile project(':react-native-linear-gradient')
compile project(':react-native-camera')

View File

@ -3,6 +3,7 @@ package com.app;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import ui.materialshadows.RNMaterialShadowsPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import org.reactnative.camera.RNCameraPackage;
@ -28,6 +29,7 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNDeviceInfo(),
new RNMaterialShadowsPackage(),
new LinearGradientPackage(),
new RNCameraPackage(),

View File

@ -1,4 +1,6 @@
rootProject.name = 'app'
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':react-native-material-shadows'
project(':react-native-material-shadows').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-material-shadows/android')
include ':react-native-linear-gradient'

View File

@ -40,12 +40,16 @@ const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import Swiper from 'react-native-swiper';
var TimerMixin = require('react-timer-mixin');
function handleConnectivityChange() {
console.log("asdasd");
}
class App extends Component {
handleConnectivityChange = isConnected => {
this.setState({ isConnected });
}
_activate=()=>{
this.setState({ isModalVisible: !this.state.isModalVisible});
@ -84,8 +88,9 @@ class App extends Component {
username:'QR code',
failedAttempt: false,
push:4,
UI_loginScannerActive:false
UI_loginScannerActive:false,
userDetails:{username:'', password:''},
isConnected: true
};
}
@ -102,19 +107,19 @@ class App extends Component {
componentDidMount() {
NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
this.props.hold();
NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
this.setState({isModalVisible: false})
//verifica se o utilizador tem token guardado
this.props.checkUser();
this.props.checkUser(this.props.userDetails);
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
}
componentWillUnmount() {
NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange);
NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange);
}
_keyboardDidShow () {
@ -130,9 +135,9 @@ class App extends Component {
}
onSuccess = (e) => {
// this.setState({ isModalVisible: !this.state.isModalVisible });
// this.props.login(e.data, 'f8908cc0');
this.props.closeLoginQRScan();
// this.setState({ isModalVisible: !this.state.isModalVisible });
// this.props.login(e.data, 'f8908cc0');
this.props.closeLoginQRScan();
this.setState({username:e.data})
console.log("QR code lido");
@ -142,8 +147,14 @@ class App extends Component {
};
render() {
if (!this.props.logged) {
if (!this.state.isConnected) {
return (
<View>
<Text>cenas da vida</Text>
</View>
);
}
if (!this.props.logged && this.props.onHold) {
return (
@ -530,7 +541,8 @@ mapStateToProps = (state, props) => {
onHold: state.apiReducer.onHold,
logged: state.apiReducer.logged,
failedAttempt:state.apiReducer.failedAttempt,
UI_loginScannerActive: state.uiReducer.UI_loginScannerActive
UI_loginScannerActive: state.uiReducer.UI_loginScannerActive,
userDetails: state.apiReducer.userDetails,
}
};

View File

@ -2,7 +2,8 @@ import React from 'react';
import {
TouchableOpacity,
Text,
View
View,
Image
} from 'react-native';
import {
createStackNavigator,
@ -17,7 +18,7 @@ import AuthLoadingScreen from './screens/AuthLoading'
import Eventos from './screens/Eventos'
import Social from './screens/Social'
import Jogo from './screens/Jogo'
import Scan from './screens/Scan'
import Calendar from './screens/Calendar'
@ -37,7 +38,7 @@ import calendarDetail from './screens/calendarDetail';
const AppStack = createBottomTabNavigator(
{
Calendar: {
Calendário: {
screen: Calendar,
navigationOptions: {
@ -48,13 +49,14 @@ const AppStack = createBottomTabNavigator(
},
},
Social: {
screen: Social,
'Jogo do...': {
screen: Jogo,
navigationOptions: {
tabBarIcon: ({tintColor}) => (
<Icon name="ios-mail" color={tintColor} size={30}/>
<Image style={{width:30, height:30}}source={require('./assets/img/logo2.png')}></Image>
)
},
},
@ -100,7 +102,7 @@ const AppStack = createBottomTabNavigator(
tabBarOptions: {
showLabel: true, // hide labels
activeTintColor: '#CC1A17', // active icon color
inactiveTintColor: '#d8d6c9', // inactive icon color
inactiveTintColor: 'black', // inactive icon color
style: {
backgroundColor: '#fff' // TabBar background
}
@ -127,7 +129,25 @@ const Stack = createStackNavigator({
)
}
}
else if(navigation.state.routes[index].routeName == 'Calendar'){
else if(navigation.state.routes[index].routeName == 'Calendário'){
return {
headerTitle: 'Calendário',
headerRight: (
<View style={{flex:1, flexDirection:'row'}}>
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('Edit')}>
<Text>FAQ</Text>
</TouchableOpacity>
<TouchableOpacity style={{marginRight: 20, flex:1, flexDirection:'row'}} onPress={() => navigation.navigate('choosePath')}>
<Text>Escolher</Text>
<IconFA name="user-edit" size={22}/>
</TouchableOpacity></View>
)
}
}
else if(navigation.state.routes[index].routeName == 'choosePath'){
return {
headerTitle: 'Calendário',
headerRight: (
@ -145,7 +165,6 @@ const Stack = createStackNavigator({
)
}
}
else {
return {
header: null

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

BIN
App/app/assets/altice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
App/app/assets/img/bg-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1130px" height="350px" viewBox="0 0 1130 350" enable-background="new 0 0 1130 350" xml:space="preserve">
<g>
<path d="M234.08,65.945c-14.86-48.87-72.639-65.136-124.304-49.464c-51.652,15.67-77.705,65.582-62.822,114.453
c9.492,31.225,43.003,56.425,78.502,64.342l-11.714,78.736l-65.354-85.776H20.08v139.327h30.276v-88.576l67.899,99.774
l36.408-11.387l3.704-130.144c8.84-1.008,17.395-3.239,25.242-7.168C239.878,161.901,248.935,114.823,234.08,65.945z
M151.49,169.298c-37.983,0-76.66-30.117-76.66-65.855c0-35.754,24.019-69.244,61.993-69.244c37.978,0,67.65,28.148,75.54,69.244
C219.094,138.548,189.469,169.298,151.49,169.298z"/>
<path fill="#FF0000" d="M185.817,102.266c-9.019,24.76-31.073,42.792-54.108,42.792c-23.049,0-36.071-19.144-29.307-42.792
c6.488-22.723,19.313-37.402,41.701-42.783C172.28,52.743,193.908,80.071,185.817,102.266"/>
<g>
<g>
<path fill="#FF0000" d="M662.173,323.944l2.399-3.375c3.442,2.574,7.238,4.051,10.988,4.051c3.816,0,6.571-1.964,6.571-5.035
v-0.127c0-3.188-3.749-4.414-7.927-5.582c-4.973-1.411-10.499-3.133-10.499-8.967v-0.123c0-5.461,4.552-9.08,10.809-9.08
c3.868,0,8.171,1.346,11.415,3.497l-2.139,3.563c-2.947-1.908-6.323-3.076-9.388-3.076c-3.75,0-6.146,1.964-6.146,4.607v0.123
c0,3.009,3.928,4.173,8.166,5.461c4.907,1.477,10.189,3.384,10.189,9.089v0.122c0,6.02-4.974,9.517-11.296,9.517
C670.766,328.609,665.745,326.831,662.173,323.944z"/>
<path fill="#FF0000" d="M690.266,284.094h5.399v5.219h-5.399V284.094z M690.561,296.25h4.726v31.744h-4.726V296.25z"/>
<path fill="#FF0000" d="M701.062,296.25h4.724v5.35c2.092-3.136,4.909-6.024,10.243-6.024c5.165,0,8.474,2.766,10.19,6.329
c2.282-3.502,5.658-6.329,11.186-6.329c7.302,0,11.783,4.917,11.783,12.773v19.646h-4.725V309.46c0-6.15-3.066-9.581-8.235-9.581
c-4.778,0-8.706,3.554-8.706,9.825v18.29h-4.729v-18.661c0-5.957-3.131-9.454-8.166-9.454c-5.04,0-8.842,4.177-8.842,10.003
v18.112h-4.724V296.25z"/>
<path fill="#FF0000" d="M754.148,296.25h4.725v6.394c2.579-3.806,6.309-7.068,12.146-7.068c7.617,0,15.165,6.024,15.165,16.459
v0.121c0,10.378-7.481,16.519-15.165,16.519c-5.884,0-9.698-3.196-12.146-6.76v15.905h-4.725V296.25z M781.34,312.212v-0.123
c0-7.481-5.166-12.276-11.186-12.276c-5.887,0-11.474,4.974-11.474,12.222v0.121c0,7.369,5.587,12.276,11.474,12.276
C776.3,324.431,781.34,319.893,781.34,312.212z"/>
<path fill="#FF0000" d="M790.064,283.177h4.729v44.817h-4.729V283.177z"/>
<path fill="#FF0000" d="M798.59,312.212v-0.123c0-9.144,6.44-16.514,15.211-16.514c9.408,0,14.804,7.491,14.804,16.768
c0,0.614,0,0.979-0.066,1.533h-25.172c0.685,6.871,5.527,10.744,11.185,10.744c4.354,0,7.421-1.786,9.993-4.481l2.953,2.639
c-3.195,3.562-7.059,5.953-13.078,5.953C805.697,328.73,798.59,322.036,798.59,312.212z M823.815,310.379
c-0.494-5.771-3.804-10.81-10.125-10.81c-5.527,0-9.705,4.607-10.323,10.81H823.815z"/>
<path fill="#FF0000" d="M831.637,296.25h4.729v8.293c2.329-5.283,6.929-9.089,12.942-8.837v5.096h-0.374
c-6.93,0-12.568,4.968-12.568,14.551v12.642h-4.729V296.25z"/>
<path fill="#FF0000" d="M889.485,321.914c-3.932,4.239-8.479,6.695-14.057,6.695c-7.744,0-13.514-4.853-13.514-12.034v-0.121
c0-5.711,3.815-9.826,10.387-12.398c-2.953-3.44-4.308-6.084-4.308-9.46v-0.121c0-5.648,4.552-10.191,11.366-10.191
c6.015,0,10.437,4.354,10.437,9.704v0.121c0,5.461-3.868,8.958-10.145,11.166l9.833,10.012c1.909-2.76,3.62-6.015,5.152-9.576
l3.994,1.843c-1.907,4.049-3.861,7.733-6.196,10.808l7.486,7.67l-3.685,2.821L889.485,321.914z M886.532,318.905l-11.479-11.845
c-5.705,2.085-8.232,5.587-8.232,9.21v0.122c0,4.599,3.686,8.104,8.968,8.104C879.849,324.497,883.401,322.344,886.532,318.905z
M885.243,294.351v-0.122c0-3.439-2.572-5.957-6.079-5.957c-3.863,0-6.507,2.705-6.507,6.202v0.121
c0,2.522,1.046,4.42,4.308,7.927C882.426,300.679,885.243,298.036,885.243,294.351z"/>
<path fill="#FF0000" d="M915.079,283.177h4.73v18.601c2.086-3.437,5.395-6.202,10.855-6.202c7.684,0,12.165,5.161,12.165,12.707
v19.712h-4.73V309.46c0-5.896-3.192-9.581-8.784-9.581c-5.466,0-9.506,3.989-9.506,9.946v18.169h-4.73V283.177z"/>
<path fill="#FF0000" d="M945.244,318.783v-0.121c0-6.694,5.525-10.247,13.565-10.247c4.041,0,6.928,0.548,9.765,1.344v-1.101
c0-5.713-3.507-8.658-9.455-8.658c-3.75,0-6.703,0.979-9.638,2.335l-1.415-3.871c3.502-1.59,6.928-2.636,11.54-2.636
c4.486,0,7.921,1.167,10.256,3.497c2.151,2.151,3.245,5.218,3.245,9.269v19.4h-4.533v-4.786
c-2.219,2.889-5.901,5.466-11.495,5.466C951.198,328.674,945.244,325.3,945.244,318.783z M968.626,316.332v-3.066
c-2.335-0.68-5.466-1.354-9.329-1.354c-5.953,0-9.276,2.579-9.276,6.572v0.122c0,3.984,3.685,6.318,7.987,6.318
C963.843,324.924,968.626,321.365,968.626,316.332z"/>
<path fill="#FF0000" d="M977.915,296.25h4.731v6.394c2.572-3.806,6.323-7.068,12.158-7.068c7.617,0,15.165,6.024,15.165,16.459
v0.121c0,10.378-7.501,16.519-15.165,16.519c-5.901,0-9.698-3.196-12.158-6.76v15.905h-4.731V296.25z M1005.113,312.212v-0.123
c0-7.481-5.151-12.276-11.169-12.276c-5.903,0-11.476,4.974-11.476,12.222v0.121c0,7.369,5.572,12.276,11.476,12.276
C1000.074,324.431,1005.113,319.893,1005.113,312.212z"/>
<path fill="#FF0000" d="M1013.41,296.25h4.729v6.394c2.574-3.806,6.324-7.068,12.16-7.068c7.617,0,15.164,6.024,15.164,16.459
v0.121c0,10.378-7.5,16.519-15.164,16.519c-5.901,0-9.699-3.196-12.16-6.76v15.905h-4.729V296.25z M1040.608,312.212v-0.123
c0-7.481-5.156-12.276-11.171-12.276c-5.901,0-11.48,4.974-11.48,12.222v0.121c0,7.369,5.579,12.276,11.48,12.276
C1035.568,324.431,1040.608,319.893,1040.608,312.212z"/>
<path fill="#FF0000" d="M1049.035,284.094h5.395v5.219h-5.395V284.094z M1049.345,296.25h4.729v31.744h-4.729V296.25z"/>
<path fill="#FF0000" d="M1057.858,312.212v-0.123c0-9.144,6.436-16.514,15.225-16.514c9.389,0,14.79,7.491,14.79,16.768
c0,0.614,0,0.979-0.052,1.533h-25.172c0.665,6.871,5.525,10.744,11.166,10.744c4.372,0,7.434-1.786,10.012-4.481l2.953,2.639
c-3.198,3.562-7.06,5.953-13.078,5.953C1064.978,328.73,1057.858,322.036,1057.858,312.212z M1083.094,310.379
c-0.492-5.771-3.814-10.81-10.143-10.81c-5.508,0-9.699,4.607-10.303,10.81H1083.094z"/>
<path fill="#FF0000" d="M1090.905,296.25h4.726v8.293c2.333-5.283,6.945-9.089,12.96-8.837v5.096h-0.374
c-6.942,0-12.586,4.968-12.586,14.551v12.642h-4.726V296.25z"/>
</g>
<polygon points="377.608,138.481 395.687,138.481 395.687,242.92 380.299,242.92 322.628,168.622 322.628,242.92 304.552,242.92
304.552,138.481 321.577,138.481 377.608,210.698 "/>
<g>
<path d="M465.826,153.552c-20.77,0-35.25,16.566-35.25,37.004c0,20.442,14.79,37.299,35.555,37.299
c20.757,0,35.25-16.561,35.25-36.993C501.381,170.413,486.596,153.552,465.826,153.552 M465.826,244.711
c-32.119,0-54.525-24.31-54.525-53.85c0-29.551,22.698-54.17,54.83-54.17c32.124,0,54.525,24.329,54.525,53.864
C520.656,220.101,497.96,244.711,465.826,244.711"/>
</g>
<polygon points="603.297,138.481 623.174,138.481 579.687,243.661 563.557,243.661 520.075,138.481 540.392,138.481
571.91,218.756 "/>
<path d="M663.509,159.67l-17.93,41.775h35.996L663.509,159.67z M718.329,242.92h-19.425l-10.603-25.209h-49.453l-10.763,25.209
h-18.821l46.028-105.183h17.023L718.329,242.92z"/>
<g>
<path d="M797.169,212.188c0-8.953-7.021-14.175-21.515-14.175h-29.139v28.65H777
C789.552,226.664,797.169,221.732,797.169,212.188 M791.334,168.173c0-8.503-6.568-13.43-18.357-13.43h-26.461v27.764h25.103
C783.42,182.507,791.334,177.885,791.334,168.173 M809.718,165.196c0,12.825-7.167,19.388-14.948,23.419
c12.271,4.177,20.784,11.199,20.784,25.515c0,18.797-15.397,28.79-38.7,28.79h-48.412V138.481h46.922
C796.424,138.481,809.718,148.78,809.718,165.196"/>
</g>
<path d="M872.385,159.67l-17.934,41.775h36.015L872.385,159.67z M927.205,242.92h-19.409l-10.618-25.209h-49.453l-10.748,25.209
h-18.826l46.014-105.183h17.038L927.205,242.92z"/>
<g>
<path d="M978.412,182.348c22.117,5.367,33.615,13.279,33.615,30.731c0,19.696-15.391,31.326-37.354,31.326
c-15.989,0-31.083-5.513-43.632-16.692l11.058-13.144c10.017,8.662,20.021,13.584,33.009,13.584
c11.367,0,18.549-5.221,18.549-13.279c0-7.604-4.187-11.635-23.605-16.115c-22.262-5.368-34.825-11.93-34.825-31.327
c0-18.197,14.931-30.441,35.715-30.441c15.239,0,27.339,4.622,37.941,13.135l-9.858,13.871
c-9.408-7.008-18.82-10.74-28.387-10.74c-10.754,0-17.025,5.518-17.025,12.53C953.612,173.999,958.377,177.571,978.412,182.348"
/>
</g>
<polygon points="1104.559,154.897 1045.398,154.897 1045.398,182.052 1097.832,182.052 1097.832,198.459 1045.398,198.459
1045.398,226.514 1105.319,226.514 1105.319,242.92 1027.028,242.92 1027.028,138.491 1104.559,138.491 "/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -11,7 +11,8 @@ import {
StyleSheet,
Image,
ImageBackground,
NetInfo
NetInfo,
AppState
} from 'react-native';
import {Shadow} from 'react-native-shadow'
@ -38,10 +39,14 @@ const SCREEN_WIDTH = Dimensions.get("window").width;
import {Card, Divider} from 'react-native-elements'
import RNMaterialShadows from 'react-native-material-shadows';
class Home extends Component {
_handleConnectionChange = (isConnected) => {
// this.props.dispatch(connectionState({ status: isConnected }));
console.log("fck that")
};
_refresh() {
return new Promise((resolve) => {
setTimeout(()=>{resolve()}, 2000)
@ -60,21 +65,27 @@ class Home extends Component {
token: {valid: false},
logged: true,
onHold: true,
user: {Name: ''}
user: {Name: ''},
userDetails:{},
appState: AppState.currentState,
};
}
handleConnectivityChange = () => {
handleConnectivityChange = () => {
console.log("asdasdasdasdasd");
}
componentDidMount() {
NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
this.props.hold();
componentDidMount() {
// NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
// this.props.hold();
console.log("hold"+ this.props.onHold)
//this.props.logoutUser();
//console.log(this.props.token);
this.props.getUserInfo(this.props.token);
this.props.getUserInfo(this.props.userDetails.token);
//console.log('logged:'+this.props.logged);
@ -85,7 +96,7 @@ class Home extends Component {
}
componentWillUnmount() {
NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange);
}
bClick() {
@ -101,8 +112,8 @@ class Home extends Component {
//var navigate = this.props.navigation.navigate
}
_update=()=>{
if(this.props.token!= undefined)
this.props.getUserInfo(this.props.token);
this.props.getUserInfo(this.props.userDetails.token);
}
@ -173,36 +184,6 @@ _update=()=>{
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Icon name="ios-laptop" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Job}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-mail" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Email}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-phone-portrait" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Mobile}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioText}>{this.props.user.Address}, {this.props.user.City}</Text>
</View>
<Divider style={{ backgroundColor: 'black' }} />
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<TouchableOpacity><Text style={styles.userCurriculum}>O meu Curriculo</Text></TouchableOpacity>
</View>
</View>
@ -342,7 +323,9 @@ function mapStateToProps(state, props) {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged
logged: state.apiReducer.logged,
userDetails: state.apiReducer.userDetails,
onHold: state.apiReducer.onHold
}
}

722
App/app/screens/Jogo.js Normal file
View File

@ -0,0 +1,722 @@
import React from 'react';
import {
StyleSheet,
Text,
View,
ImageBackground,
Dimensions,
Button,
TouchableOpacity
} from 'react-native';
import ProgressBarAnimated from 'react-native-progress-bar-animated';
import Modal from "react-native-modal";
import IconF from "react-native-vector-icons/Foundation"
import IconFA from "react-native-vector-icons/FontAwesome5"
import { ScrollView, ViewPagerAndroid } from 'react-native-gesture-handler';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import FitImage from 'react-native-fit-image';
export default class Jogo extends React.Component {
state = {
progress: 20,
progressWithOnComplete: 0,
progressCustomized: 0,
isModalVisible: false,
} ;
increase = (key, value) => {
this.setState({
[key]: this.state[key] + value,
});
}
_toggleModal = () =>{
this.setState({ isModalVisible: !this.state.isModalVisible });
console.log("assd")
}
render() {
const { navigate } = this.props.navigation;
const progressCustomStyles = {
backgroundColor: 'red',
borderRadius: 0,
borderColor: 'orange',
};
const barWidth = Dimensions.get('screen').width - 30;
return (
<View style={styles.container}>
<Modal
isVisible={this.state.isModalVisible}
animationInTiming={1000}
animationOutTiming={800}
>
<View style={{
flex:1,
alignContent:'center',
margin :SCREEN_WIDTH*0.1,
backgroundColor:'white',
marginBottom:SCREEN_HEIGHT*0.1,
marginTop:SCREEN_HEIGHT*0.1,
maxHeight:400
}}>
<ImageBackground
opacity={0.5}
source={require('../assets/img/bg_3.jpg')}
style={{
width:'96%',
height:'97.5%',
margin:10
}}
>
<View style={{width:'100%' ,margin:-10}}>
<View style={{width:30}}><Button
onPress={this._toggleModal}
title="X"
color="#CC1A17"
accessibilityLabel="Learn more about this purple button"
/>
</View>
</View>
<View style={{flex:1, alignContent:'center', width:'96%', alignItems:'center'}}>
<View style={{paddingTop:25,width:'40%',}}>
<FitImage
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/8/8a/CSW_Gradiente_rgb.png' }}
style={styles.fitImage}
/>
</View>
<View style={{backgroundColor:'rgba(255,255,255,0.6)', width:'100%', marginTop:35}}>
<Text style={{padding:10}}>A CRITICAL Software fornece sistemas e serviços de software para segurança e
aplicações essenciais aos negócios, ajudando a garantir que os clientes atendam aos requisitos mais exigentes de qualidade - padrões de segurança, desempenho e fiabilidade</Text>
</View>
<View style={{width:'100%', marginTop:10}}><TouchableOpacity><Text style={{textAlign:'center', fontWeight:'bold', fontSize:18, color:'#CC1A17'}}>website</Text></TouchableOpacity></View>
</View>
</ImageBackground>
</View>
</Modal>
<View style={styles.header}>
<View style={styles.titleContainer}>
<Text style={styles.title}>Jogo do ENEI'19</Text>
</View>
</View>
<View style={{ height:50, backgroundColor:'white'}}>
<View style={{flex:1, justifyContent:'space-around', flexDirection:'row'}}>
<View style={{width:SCREEN_WIDTH*0.7, flex:1, flexDirection:'row',margin:10, marginLeft:SCREEN_WIDTH*0.10}}>
<IconFA name="trophy" size={30}/>
<Text style={{fontWeight:'bold', fontSize:20,marginLeft:10}}>45</Text>
<Text style={{margin:5}}>pontos</Text>
</View>
<View style={{width:SCREEN_WIDTH*0.3, marginTop:8, marginRight:SCREEN_WIDTH*0.1}}>
<Button
onPress={this._toggleModal}
title="Prémios"
color="#CC1A17"
accessibilityLabel="Learn more about this purple button"
/>
</View>
</View>
</View>
<View style={styles.progress}>
<View style={{ alignItems:'center'}}>
</View>
<View style={{backgroundColor:'#FDFDFD', shadowColor:"#000", shadowOffset:{height:2, width:0, shadowRadius:1}, elevation:3,}}>
<View style={{flex:1,margin: 20, alignItems:'center',flexDirection:'row', justifyContent: 'space-around',}}>
<Text style={{fontWeight:'bold'}} > 1 </Text>
<ProgressBarAnimated
width={barWidth*0.7}
value={this.state.progress}
backgroundColorOnComplete="#CC2A17"
/>
<Text style={{fontWeight:'bold'}}> 2 </Text>
</View>
</View>
</View>
<ScrollView style={{backgroundColor:'#eeeeee',marginTop:10}} horizontal={true}>
<ScrollView>
<View style={styles.cromosContainer}>
<TouchableOpacity onPress={this._toggleModal}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/critical.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>0</Text>
</ImageBackground>
</View>
</TouchableOpacity>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/novabase.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>1</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>2</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>3</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>4</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>5</Text>
</ImageBackground>
</View>
</View>
<View style={styles.cromosContainer}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>6</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/ubiwhere.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>7</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>8</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>9</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>10</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>11</Text>
</ImageBackground>
</View>
</View>
<View style={styles.cromosContainer}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>12</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>13</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>14</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>15</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>16</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>17</Text>
</ImageBackground>
</View>
</View>
<View style={styles.cromosContainer}>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>18</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>19</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>20</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>21</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>22</Text>
</ImageBackground>
</View>
<View style={styles.cromo}>
<ImageBackground
source={require('../assets/img/jogo/enei_black_2.png')}
style={styles.imageBg}
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>15</Text>
<View style={[styles.triangleNumber, this.props.style]} />
<Text style={styles.number}>23</Text>
</ImageBackground>
</View>
</View>
</ScrollView>
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
fitImage:{
},
points:{
marginTop:-25,
marginLeft:10,
fontWeight:'bold',
color:'#CC1A17'
},
cromosContainer:{
flex:1,
flexDirection:'row',
flexWrap: 'wrap',
justifyContent: 'space-around',
marginLeft:10,
marginRight:10,
},
cromo:
{
backgroundColor:'white',
margin:3,
height:200,
width:130,
borderRadius:0}
,
imageBg:{
height:190,
margin:5
},
label:{
margin:10
},
progress:{
backgroundColor:'#eeeeee',
shadowColor:'#000',
shadowOffset:{width:0, height:2},
shadowRadius:1,
elevation:1,
},
title:{
fontWeight:'bold',
fontSize:25,
color:'white',
textAlign:'center'
},
titleContainer:{
margin:10,
},
header:{
backgroundColor:'#CC2A17',
//alignItems:'center',
shadowColor:'#000',
shadowOffset:{width:0, height:2},
shadowRadius:1,
elevation:5,
},
container: {
flex: 1,
backgroundColor: '#eeeeee',
// alignItems: 'center',
//justifyContent: 'space-around',
},
triangle: {
width: 0,
height: 0,
backgroundColor: 'transparent',
borderStyle: 'solid',
borderLeftWidth:67,
borderRightWidth: 0,
borderBottomWidth: 20,
transform: [{ rotate: '180deg'}],
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'white'
},
triangleNumber: {
width: 0,
height: 0,
backgroundColor: 'transparent',
borderStyle: 'solid',
borderLeftWidth:67,
borderRightWidth: 0,
borderBottomWidth: 20,
transform: [{ rotate: '0deg'}],
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'white',
marginLeft:54,
marginTop:156
},
number:{
marginTop:-18,
marginLeft:103,
textAlign: 'center'
}
});

View File

@ -1,155 +1,374 @@
import React, {Component} from 'react'
import {Card, Divider} from 'react-native-elements'
import {
Image,
ImageBackground,
Linking,
ListView,
Platform,
ScrollView,
StyleSheet,
Text,
View,
TouchableOpacity,
Dimensions,
TextInput,
Button
} from 'react-native'
import PropTypes from 'prop-types';
import {connect, Provider} from "react-redux";
import {bindActionCreators} from "redux";
import * as Actions from "../store/actions";
import {createStore} from 'redux';
import Email from '../components/Email';
import Separator from '../components/Separator';
import Tel from '../components/Telephone';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import Icon from "react-native-vector-icons/Ionicons"
class Profile extends Component {
constructor(props) {
super(props);
this.state = {
token: false,
tokenData: '',
loggedIn: false,
onHold: true,
user: {},
cenas:{Name:'as'},
text:'',
};
}
_logout = () => {
// this.props.navigation.navigate('scan');
// this.props.logout();
this.props.logoutUser();
}
render() {
return (
<ScrollView>
<View style={styles.container}>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Icon name="ios-laptop" style={styles.userBioLogo} size={25}/>
<TextInput
onFocus={this._print}
maxLength={50}
blurOnSubmit ={true}
onChangeText={(text) => this.setState({text})}
value={this.props.user.Job}
/>
</View>