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

Feat/recycle center #16

Open
wants to merge 5 commits into
base: develop
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
78 changes: 52 additions & 26 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@ import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import BottomTabNavigation from "./navigation/BottomTabNavigation";
import RCBottomNavBar from "./navigation/RCBottomNavBar";
import { Cart, Profile, RecycleRequest, RecycleRequests, RecycleCenterHome, RecyclersMap, MapTest, CollectionRequests, CollectionRoutes, RecycleCenterProfile } from "./screens";
import {
Cart,
Profile,
RecycleRequest,
RecycleRequests,
RecycleCenterHome,
RecyclersMap,
MapTest,
CollectionRequests,
CollectionRoutes,
RecycleCenterProfile,
RecycleCenterSignUp,
} from "./screens";
import Test from "./screens/Test";
import Recycle from "./screens/recycle/Recycle";
import ViewRecycleRequest from "./components/recycle/ViewRecycleRequest"
import ViewRecycleRequest from "./components/recycle/ViewRecycleRequest";
import Reuse from "./screens/GiveAway";
import Repair from "./screens/Repair";
import ViewProduct from "./screens/ViewProduct";
Expand All @@ -21,9 +33,9 @@ import LoginScreen from "./screens/LoginScreen";
import RegisterScreen from "./screens/RegisterScreen";
import RecycleCompanies from "./screens/recycle/RecycleCompanies";
import ViewRecycleCompany from "./components/recycle/ViewRecycleCompany";
import DropOff from "./screens/recycle/DropOff";
import DropOff from "./screens/recycle/DropOff";
import ViewMyProduct from "./screens/ViewMyProduct";
import { LogBox } from 'react-native';
import { LogBox } from "react-native";
import PickUp from "./screens/recycle/PickUp";

const Stack = createNativeStackNavigator();
Expand All @@ -37,7 +49,7 @@ export default function App() {
extrabold: require("./assets/fonts/Poppins-ExtraBold.ttf"),
semibold: require("./assets/fonts/Poppins-SemiBold.ttf"),
});
LogBox.ignoreLogs(['@firebase/auth']);
LogBox.ignoreLogs(["@firebase/auth"]);
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) await SplashScreen.hideAsync();
}, [fontsLoaded]);
Expand Down Expand Up @@ -135,39 +147,48 @@ export default function App() {
options={{ headerShown: false }}
/>
<Stack.Screen
name="RecycleCenterBottomNavBar"
component={RCBottomNavBar}
options={{headerShown: false}}
name="RecycleCenterBottomNavBar"
component={RCBottomNavBar}
options={{ headerShown: false }}
/>
<Stack.Screen
name="RecycleCenterHome"
component={RecycleCenterHome}
options={{headerShown: true}}
name="RecycleCenterHome"
component={RecycleCenterHome}
options={{ headerShown: true }}
/>
<Stack.Screen
name="RecyclersMap"
component={RecyclersMap}
options={{headerShown: true}}
name="RecyclersMap"
component={RecyclersMap}
options={{
headerShown: true,
}}
/>
<Stack.Screen
name="MapTest"
component={MapTest}
options={{headerShown: true}}
name="MapTest"
component={MapTest}
options={{
headerShown: true,
topBar: {
backButton: {
popStackOnPress: false,
},
},
}}
/>
<Stack.Screen
name="RecycleCollectionRequests"
component={CollectionRequests}
options={{headerShown: true}}
name="RecycleCollectionRequests"
component={CollectionRequests}
options={{ headerShown: true }}
/>
<Stack.Screen
name="RecycleCollectionRoutes"
component={CollectionRoutes}
options={{headerShown: true}}
name="RecycleCollectionRoutes"
component={CollectionRoutes}
options={{ headerShown: true }}
/>
<Stack.Screen
name="RecycleCenterProfile"
component={RecycleCenterProfile}
options={{headerShown: true}}
name="RecycleCenterProfile"
component={RecycleCenterProfile}
options={{ headerShown: true }}
/>
<Stack.Screen
name="RecycleCompanies"
Expand All @@ -189,6 +210,11 @@ export default function App() {
component={PickUp}
options={{ headerShown: false }}
/>
<Stack.Screen
name="RecylceCenterSignup"
component={RecycleCenterSignUp}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
);
Expand Down
Binary file added assets/images/recycle-company.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 5 additions & 7 deletions components/home/MapGlimpse.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { StyleSheet, Text, View } from "react-native";
import React, { useState } from "react";
import MapView, { Marker, PROVIDER_GOOGLE } from "react-native-maps";
import { COLORS, SIZES } from "../../constants";

const MapGlimpse = () => {
const [mapRegion, setmapRegion] = useState({
latitude: 7.25184587048,
longitude: 80.3456412507,
latitude: 6.914933,
longitude: 79.972918,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
});
Expand All @@ -18,8 +17,8 @@ const MapGlimpse = () => {
>
<Marker
coordinate={{
latitude: 7.25184587048,
longitude: 80.3456412507,
latitude: 6.914933,
longitude: 79.972918,
}}
title={`Pick up request`}
></Marker>
Expand Down Expand Up @@ -54,8 +53,7 @@ export default MapGlimpse;
const styles = StyleSheet.create({
container: {
borderRadius: 30,
height: "40%",
margin: 30,
height: "30%",
marginTop: 10,
},
});
7 changes: 3 additions & 4 deletions components/home/SchedulesCarousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const SchedulesCarousel = () => {

const slides = [
"https://firebasestorage.googleapis.com/v0/b/scrapie-85d87.appspot.com/o/Group%20289323.jpg?alt=media&token=31116a4c-0897-47e8-afe3-3f80b21684fe",
"https://firebasestorage.googleapis.com/v0/b/scrapie-85d87.appspot.com/o/Group%20289328.jpg?alt=media&token=7a8edd1b-cb10-4a03-8d2b-989044302955",
"https://firebasestorage.googleapis.com/v0/b/scrapie-85d87.appspot.com/o/PCT-031%201.jpg?alt=media&token=a31aab7b-ba90-48a2-b2f8-429fbe0410a8"
"https://firebasestorage.googleapis.com/v0/b/scrapie-85d87.appspot.com/o/PCT-031%201.jpg?alt=media&token=a31aab7b-ba90-48a2-b2f8-429fbe0410a8",
"https://www.bezner.com/wp-content/uploads/2017/07/PET-Recycling-Plant-2.jpg"
];

return (
Expand All @@ -28,8 +28,7 @@ export default SchedulesCarousel

const styles = StyleSheet.create({
carouselContainer: {
flex: 1,
alignItems: "center",
marginTop: SIZES.xLarge
height: 500,
}
})
2 changes: 1 addition & 1 deletion components/home/Welcome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Welcome = () => {
<View>
<View style={styles.container}>
<Text style={styles.welcomeText(COLORS.black, 2)}>
Good Morning, {name.charAt(0).toUpperCase() + name.slice(1)}
Good Day, {name.charAt(0).toUpperCase() + name.slice(1)}
</Text>
</View>

Expand Down
37 changes: 37 additions & 0 deletions components/recycle-center/Button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react';
import { TouchableOpacity, Text } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { COLORS } from '../../constants';
const Button = ({ text, onPress, status }) => {

let buttonColor = COLORS.primary;

if (status === 'success') {
buttonColor = COLORS.primary;
} else if (status === 'fail') {
buttonColor = COLORS.red;
}

return (
<TouchableOpacity
style={{
height: 50,
backgroundColor: buttonColor,
borderRadius: 50,
marginLeft: 10,
marginRight: 10,
paddingHorizontal: 20,
paddingVertical: 10,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
}}
onPress={onPress}
>
<Text style={{ color: COLORS.white, marginRight: 10 }}>{text}</Text>
<Icon name="chevron-right" size={20} color={COLORS.white} />
</TouchableOpacity>
);
};

export default Button;
87 changes: 87 additions & 0 deletions components/recycle-center/Card.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import React from 'react';
import { View, Image, Text, StyleSheet, TouchableOpacity, Linking } from 'react-native';
import { COLORS } from '../constants';

const PendingRequestCard = ({ imageSource, name, address, phoneNumber, budget, requestedAt }) => {
return (
<View style={styles.card}>
<View style={styles.leftSide}>
<Image source={{ uri: imageSource }} style={styles.image} />
</View>
<View style={styles.rightSide}>
<Text style={styles.name}>{name}</Text>
<Text style={styles.details}>Location: {address}</Text>
<Text style={styles.details}>Budget: {budget}</Text>
<Text style={styles.details}>Requested At: {requestedAt}</Text>
<View style={styles.buttonContainer}>
<TouchableOpacity
style={[styles.button, { backgroundColor: COLORS.primary }]}
onPress={() => Linking.openURL(`tel:${phoneNumber}`)}
>
<Text style={{ color: COLORS.white, fontSize: 15 }}>Approve</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.button, { backgroundColor: COLORS.red }]}
onPress={() => Linking.openURL(`tel:${phoneNumber}`)}
>
<Text style={{ color: COLORS.white, fontSize: 15 }}>Reject</Text>
</TouchableOpacity>
</View>
</View>
</View>
);
};

const styles = StyleSheet.create({
card: {
flexDirection: 'row',
width: '90%',
height: 200,
backgroundColor: 'white',
borderWidth: 0.5,
borderColor: COLORS.primary,
borderRadius: 10,
marginLeft: 20,
marginBottom: 20
},
leftSide: {
flex: 2,
justifyContent: 'center',
alignItems: 'center',
width: 100,
},
rightSide: {
flex: 3,
justifyContent: 'center',
paddingHorizontal: 10,
marginTop: -20,
},
image: {
marginLeft: 10,
width: 120,
height: 150,
borderRadius: 5,
},
name: {
fontSize: 18,
fontWeight: 'bold',
},
details: {
fontSize: 14,
color: 'gray',
},
buttonContainer: {
flexDirection: 'row',
marginTop: 10,
},
button: {
flex: 1,
height: 30,
borderRadius: 50,
alignItems: 'center',
justifyContent: 'center',
marginHorizontal: 5,
},
});

export default PendingRequestCard;
4 changes: 4 additions & 0 deletions helpers/descriptionValidator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function descriptionValidator(name) {
if (!name) return "Description can't be empty."
return ''
}
2 changes: 1 addition & 1 deletion navigation/RCBottomNavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const RCBottomNavBar = () => {
}}
/>
<Tab.Screen
name="MapTest3"
name="CollectionRoutes"
component={CollectionRoutes}
options={{
tabBarIcon: ({ focused }) => {
Expand Down
Loading