Skip to content

Commit

Permalink
Merge pull request #1 from tenusha/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
tenusha authored Oct 26, 2019
2 parents 33e5248 + 3fb97da commit 115919d
Show file tree
Hide file tree
Showing 115 changed files with 23,780 additions and 303 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ typings/

*.lock
/services/node/package-lock.json
/DMT/.idea/
.idea/
.scannerwork/
2 changes: 2 additions & 0 deletions DMT/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ npm-debug.*
web-build/
web-report/
/*.lock

.idea/
12 changes: 0 additions & 12 deletions DMT/.idea/DMT.iml

This file was deleted.

4 changes: 0 additions & 4 deletions DMT/.idea/encodings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions DMT/.idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions DMT/.idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions DMT/.idea/vcs.xml

This file was deleted.

30 changes: 25 additions & 5 deletions DMT/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ import RevenueLicense from './components/RevenueLicense'
import MyVehicles from './components/MyVehicles'
import Logout from './components/actions/Logout'
import Reload from './components/commons/Reload'
import {ScrollView} from 'react-native';
import {ScrollView, View} from 'react-native';
import {Image} from "react-native-elements";
import {createAppContainer, createDrawerNavigator, createSwitchNavigator, DrawerItems} from 'react-navigation'
import configs from "./config.json"
import FineManagement from "./components/FineManagement";

import SignInScreen from "./components/SignInScreen";
import PaymentGateway from "./components/PaymentGateway";


export default class App extends React.Component {
Expand All @@ -23,10 +28,12 @@ export default class App extends React.Component {

const customDrawerContent = (props) => (
<ScrollView>
<Image
source={require('./assets/drawer_image.png')}
style={{width: "100%", height: 150}}
/>
<View style={{backgroundColor: configs.theme}}>
<Image
source={require('./assets/drawer_image.png')}
style={{width: "100%", height: 150}}
/>
</View>
<DrawerItems {...props}/>
</ScrollView>
)
Expand All @@ -44,6 +51,11 @@ const DrawerNavigator = createDrawerNavigator({
headerVisible: false,
},
initialRouteName: 'Home',
contentOptions: {
activeLabelStyle: {
color: configs.theme
}
},
contentComponent: customDrawerContent,
}
);
Expand All @@ -54,6 +66,7 @@ const DrawerNavigatorLoginUsers = createDrawerNavigator({
VehicleDetails: {screen: VehicleDetails},
RevenueLicense: {screen: RevenueLicense},
MyVehicles: {screen: MyVehicles},
FineManagement: {screen: FineManagement},
Logout: {screen: Logout}
},
{
Expand All @@ -62,12 +75,19 @@ const DrawerNavigatorLoginUsers = createDrawerNavigator({
headerVisible: false,
},
initialRouteName: 'Home',
contentOptions: {
activeLabelStyle: {
color: configs.theme
}
},
contentComponent: customDrawerContent,
}
);

const SwitchNavigator = createSwitchNavigator({
Reload: {screen: Reload},
SignIn: SignInScreen,
PaymentGateway: PaymentGateway,
App: DrawerNavigator,
UserApp: DrawerNavigatorLoginUsers
},
Expand Down
9 changes: 7 additions & 2 deletions DMT/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"expo": {
"name": "DMT",
"slug": "first-rn-app",
"slug": "dmt",
"privacy": "public",
"sdkVersion": "33.0.0",
"platforms": [
Expand All @@ -27,7 +27,12 @@
"supportsTablet": true
},
"android": {
"package": "com.tmg"
"package": "com.tmg",
"permissions": [
"CAMERA",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE"
]
}
}
}
Binary file added DMT/assets/OngoingNumberIcons/bigTruckIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/buldozerIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/busIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/carIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/cementIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/commercialIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/excavatorIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/forkLiftIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/lorryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/panzerIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/primeMoverIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/singleCabIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/OngoingNumberIcons/trailerIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified DMT/assets/drawer_image - Copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified DMT/assets/drawer_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/home_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed DMT/assets/icon - Copy.png
Binary file not shown.
Binary file added DMT/assets/icon-copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified DMT/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/icons/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/icons/fine_management.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/icons/firstName.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified DMT/assets/icons/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMT/assets/icons/left_arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified DMT/assets/icons/logged_user.png
Binary file modified DMT/assets/icons/login.png
Binary file modified DMT/assets/icons/login_black.png
Binary file added DMT/assets/icons/login_logo.png
Binary file modified DMT/assets/icons/logout.png
Binary file modified DMT/assets/icons/my_vehicle.png
Binary file modified DMT/assets/icons/ongoing_numbers.png
Binary file added DMT/assets/icons/password.png
Binary file modified DMT/assets/icons/revenue_license.png
Binary file added DMT/assets/icons/user_reg.png
Binary file added DMT/assets/icons/user_reg2.png
Binary file added DMT/assets/icons/user_reg3.png
Binary file added DMT/assets/icons/username.png
Binary file modified DMT/assets/icons/vehicle_info.png
Binary file modified DMT/assets/ongoing_numbers.jpg
Binary file modified DMT/assets/vehicle_details.jpg
175 changes: 175 additions & 0 deletions DMT/components/FineManagement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import React from "react"
import {AsyncStorage, Image, ScrollView, Text, View, StyleSheet} from "react-native";
import AppHeader from "./commons/AppHeader";
import {Button, Card, Icon, Avatar} from "react-native-elements";
import configs from "../config";


export default class HomeScreen extends React.Component {
static navigationOptions = {
title: "Fine Management",
drawerIcon: (
<Image source={require('../assets/icons/fine_management.png')} style={{width: 24, height: 24}}/>
)
};

state = {
fineDetails: [],
name: "Ranmal Dewage",
licenseDetails: "B54356789",
loading: false
}

componentDidMount() {
const PUSH_ENDPOINT = configs.dmtUrl + "/fines/"
fetch(PUSH_ENDPOINT).then(res => res.json()).then(res => {
this.setState({
fineDetails: res
})
});
}

render() {
const {navigate} = this.props.navigation;
return (
<>
<AppHeader {...this.props} title={'Fine Management'}/>
<ScrollView>
<View style={{flex: 1, flexDirection: 'row', margin: 18}}>
<Avatar
rounded
style={{width: 80, height: 80}}
source={{uri: 'https://i.ibb.co/FBb2h5k/RAN-PRO-11.jpg'}}
showEditButton
/>
<View style={{flex: 1, flexDirection: 'column'}}>
<Text style={styles.profileText1}>Name : <Text
style={styles.profileText2}>{this.state.name}</Text></Text>
<Text style={styles.profileText1}>License No : <Text
style={styles.profileText2}>{this.state.licenseDetails}</Text></Text>
</View>
</View>
{this.state.fineDetails.length != 0 && this.state.fineDetails.map((fine) => {
const ref = "REF : " + fine.ref
return <Card
key={fine._id}
title={ref}
titleStyle={{fontSize: 18}}>
<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
<View style={{flex: 1, alignSelf: 'stretch'}}><Text>Vehicle Number</Text></View>
<View style={{
flex: 1,
alignSelf: 'stretch'
}}><Text
style={{
fontWeight: "bold"
}}>: {fine.vehicleNumber}</Text></View>
</View>
<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
<View style={{flex: 1, alignSelf: 'stretch'}}><Text>Fined Date</Text></View>
<View style={{
flex: 1,
alignSelf: 'stretch'
}}><Text
style={{
fontWeight: "bold"
}}>: {fine.finedDate}</Text></View>
</View>
<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
<View style={{flex: 1, alignSelf: 'stretch'}}><Text>Fined Place</Text></View>
<View style={{
flex: 1,
alignSelf: 'stretch'
}}><Text
style={{
fontWeight: "bold"
}}>: {fine.finedPlace}</Text></View>
</View>
<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
<View style={{flex: 1, alignSelf: 'stretch'}}><Text>Fine Due Date</Text></View>
<View style={{
flex: 1,
alignSelf: 'stretch'
}}><Text
style={{
fontWeight: "bold"
}}>: {fine.fineDueDate}</Text></View>
</View>
<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
<View style={{flex: 1, alignSelf: 'stretch'}}><Text>Reason</Text></View>
<View style={{
flex: 1,
alignSelf: 'stretch'
}}><Text
style={{
fontWeight: "bold"
}}>: {fine.reason}</Text></View>
</View>
<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
<View style={{flex: 1, alignSelf: 'stretch'}}><Text>Amount</Text></View>
<View style={{
flex: 1,
alignSelf: 'stretch'
}}><Text
style={{
fontWeight: "bold",
color: fine.status === 'PAID' ? "#15B867" : "#E0494C"
}}>: Rs.{fine.amount}</Text></View>
</View>
<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
<View style={{flex: 1, alignSelf: 'stretch'}}><Text>Status</Text></View>
<View style={{
flex: 1,
alignSelf: 'stretch'
}}><Text
style={{
fontWeight: "bold",
color: fine.status === 'PAID' ? "#15B867" : "#E0494C"
}}>: {fine.status}</Text></View>
</View>
<View>
{fine.status === "NOT PAID" && <Button
icon={<Icon type='ionicon' name='ios-card' color='#FFFFFF'/>}
buttonStyle={{
backgroundColor: '#15B867',
borderRadius: 15,
marginLeft: 0,
marginRight: 0,
marginBottom: 0,
borderWidth: 0
}}
onPress={() => navigate('PaymentGateway', {
name: this.state.name,
licenseNumber: this.state.licenseDetails,
ref: fine.ref,
vno: fine.vehicleNumber,
amount: fine.amount
})}
title=' PAY NOW'/>}
</View>
</Card>

})}

<View style={{flex: 1, alignSelf: 'stretch', flexDirection: 'row', marginBottom: 25}}>
</View>

</ScrollView>
</>
);
}
}

const styles = StyleSheet.create({
profileText1: {
margin: 8,
fontSize: 20,
textAlign: "left"
},
profileText2: {
margin: 8,
fontSize: 20,
textAlign: "left",
color: "rgb(0,102,102)"
}
});
Loading

0 comments on commit 115919d

Please sign in to comment.