diff --git a/App.js b/App.js index d0c5f6d..89aedf5 100644 --- a/App.js +++ b/App.js @@ -8,8 +8,12 @@ import Login from "./Screens/Auth/Login"; import ClientProfile from "./Screens/Profile/ClientProfile"; import LawyerProfile from "./Screens/Profile/LawyerProfile"; import SetupLawyerProfile from "./Screens/Profile/SetupLawyerProfile"; +import AdminProfile from "./Screens/Profile/AdminProfile"; +import ChatEntry from "./Screens/Chat/ChatEntry"; +import ChatImpl from "./Screens/Chat/ChatImpl"; import Fire from './Fire'; import CaseSearch from "./Screens/Cases/CaseSearch"; +import LawyerAuth from "./Screens/Admin/LawyerAuth"; //import CaseList from "./Screens/Cases/CaseList"; import ClientCases from "./Screens/Cases/ClientCases"; import EditClientProfile from "./Screens/Profile/EditClientProfile"; @@ -61,6 +65,12 @@ const MainStack = createStackNavigator({ SignUp: { screen: SignUp }, + AdminTabNav: { + screen: AdminProfile + }, + LawyerAuth: { + screen: LawyerAuth + }, SetupLawyerProfile: { screen: SetupLawyerProfile }, diff --git a/Screens/Admin/LawyerAuth.js b/Screens/Admin/LawyerAuth.js new file mode 100644 index 0000000..ac8d2a3 --- /dev/null +++ b/Screens/Admin/LawyerAuth.js @@ -0,0 +1,322 @@ +import React, { Component } from 'react'; +import { + View, Text, Button, TextInput, TouchableOpacity, + Image, Dimensions, Alert, FlatList, Keyboard, TouchableWithoutFeedback, Linking +} from 'react-native'; +import Modal from "react-native-modal"; +import * as firebase from 'firebase'; + +const { width, height } = Dimensions.get('window'); +export default class LawyerAuth extends Component { + + constructor(props) { + super(props); + this.state = { + isModalVisible: false, + lawyerName: '', + lawyerId: '', + avail: '', + bar: '', + email: '', + experience: '', + firm: '', + location: '', + phoneNumber: '', + radius: '', + lawyersLoaded: false, + lawyers: [] + }; + this.fetchLawyers(); + } + + + _toggleModal = () => { + this.setState({isModalVisible: !this.state.isModalVisible}); + }; + + _authorize = () => { + const {lawyerId} = this.state; + firebase.database().ref('lawyerProfiles/' + lawyerId + '/authorized').set(true); + this.fetchLawyers(); + this._toggleModal(); + } + + _deny = () => { + const {lawyerId} = this.state; + firebase.database().ref('lawyerProfiles/' + lawyerId).remove(); + this.fetchLawyers(); + this._toggleModal(); + } + + render() { + const {isModalVisible, lawyerName, lawyerId, avail, bar, email, experience, firm, location, phoneNumber, radius, lawyersLoaded, lawyers} = this.state; + if (lawyersLoaded) + return ( + + + + + + + + {this.mainScreen()} + + + + + + Lawyer Name: + {lawyerName} + + Email: + {email} + + Phone Number: + {phoneNumber} + + Firm: + {firm} + + Bar: + {bar} + + Experience: + {experience} + + Location: + {location} + + Radius: + {radius} + + Availability: + {avail} + + + +