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

Map Filter #22

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a599bd9
map filter
atan9611 Mar 1, 2023
b00242d
map filter
atan9611 Mar 9, 2023
43fc4f7
separate screen basic functionality of map filter
atan9611 Apr 6, 2023
214fb94
removed unnecessary comments
atan9611 Apr 6, 2023
1668403
basic styling of map filter
atan9611 Apr 13, 2023
609fe0c
pulled from main and resolved conflicts
atan9611 Apr 20, 2023
be02af3
more merge changes
atan9611 Apr 20, 2023
566c861
moved filter button to map and started stack screen
atan9611 Apr 20, 2023
f7de7e9
shortened filter code, added filter button on map, working on renderi…
atan9611 Apr 26, 2023
af5f50c
moved map filter to map screen, created temporary categories and data…
atan9611 May 10, 2023
b806efc
moved map filter to map screen so that events and resources render
atan9611 May 11, 2023
4136b52
made button styling responsive
May 17, 2023
62b77c7
map filter styling
May 18, 2023
c851047
fixed linting bugs
May 18, 2023
bd7f92a
Remove map filter from nav bar
May 21, 2023
7a3d95c
finish merge
May 21, 2023
e836531
finish merge app nav
May 21, 2023
e6eeb1f
added import
siddharthnandy May 21, 2023
b0f2929
Merge branch 'main' into map-filter
zhangjuliet May 21, 2023
219c271
Fix art filtering navigation bug
zhangjuliet May 21, 2023
23f2f64
Move map filter button into header
zhangjuliet May 22, 2023
8192d8f
package lock json
May 21, 2023
f304108
fixed css issue
May 22, 2023
fd83be4
app navigator
May 23, 2023
10ecad2
added filter button to tab and cleaned filter code
May 25, 2023
3d0003d
Merge branch 'main' into map-filter
zhangjuliet May 31, 2023
49fa880
Fix merge conflict
zhangjuliet May 31, 2023
d63a3ce
Merge branch 'main' of https://github.com/lablueprint/skid-row-arts-a…
zhangjuliet May 31, 2023
a89b039
Update aws-sdk in package-lock.json
zhangjuliet May 31, 2023
38c4a2a
Delete .gitignore
zhangjuliet May 31, 2023
53fdc82
Delete modules.xml
zhangjuliet May 31, 2023
88f29ce
Delete skid-row-arts-alliance.iml
zhangjuliet May 31, 2023
6e9c7d0
Delete vcs.xml
zhangjuliet May 31, 2023
ff294b5
styling of map-filter done
Jun 1, 2023
3322c7c
changed eventCategories to an array of strings instead of array of ob…
Jun 7, 2023
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
Binary file modified .DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion mobile/Components/AppNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import EventDetailScreen from '../Screen/EventDetailScreen';
import EventScreen from '../Screen/EventScreen';
import ResourceDetailScreen from '../Screen/ResourceDetailScreen';
import OrganizationDetailScreen from '../Screen/OrganizationDetailScreen';
import MapFilter from '../Screen/MapFilter';
import ArtworkFilterScreen from '../Screen/ArtworkFilterScreen';
import { isTokenExpired } from '../redux/sliceAuth';

Expand Down Expand Up @@ -141,6 +142,7 @@ function HomeStackScreen({ navigation }) {
component={MapScreen}
options={{
tabBarIcon: MapIcon,
headerShown: false,
}}
/>
<Tab.Screen
Expand Down Expand Up @@ -189,6 +191,7 @@ function AppNavigator() {
<Stack.Screen name="Artwork Details" component={ArtworkDetailScreen} />
<Stack.Screen name="Resource Details" component={ResourceDetailScreen} />
<Stack.Screen name="Organization Details" component={OrganizationDetailScreen} />
<Stack.Screen name="Filter" component={MapFilter} />
<Stack.Screen name="Artwork Filter" component={ArtworkFilterScreen} />
</Stack.Navigator>
</NavigationContainer>
Expand All @@ -204,4 +207,4 @@ function AppNavigator() {
);
}

export default AppNavigator;
export default AppNavigator;
8 changes: 7 additions & 1 deletion mobile/Components/EventCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function EventCard({
number,
email,
website,
tag,
}) {
const onPressEvent = () => {
navigation.navigate('Event Details', {
Expand Down Expand Up @@ -70,11 +71,15 @@ function EventCard({
{' '}
{description}
</Paragraph>
<Paragraph>
{' '}
{tag}
zhangjuliet marked this conversation as resolved.
Show resolved Hide resolved
</Paragraph>
<Paragraph>Tag0 | Tag1 | Tag2</Paragraph>
zhangjuliet marked this conversation as resolved.
Show resolved Hide resolved
</Card.Content>
<Card.Cover source={{ uri: url }} />
<Card.Actions>
<Button onPress={onPressEvent}>Details</Button>
<Button onPress={() => onPressEvent}>Details</Button>
zhangjuliet marked this conversation as resolved.
Show resolved Hide resolved
<Button>I&apos;m interested!</Button>
</Card.Actions>
</Card>
Expand All @@ -95,6 +100,7 @@ EventCard.propTypes = {
description: PropTypes.string.isRequired,
summary: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
tag: PropTypes.string.isRequired,
navigation: PropTypes.shape({
navigate: PropTypes.func,
}).isRequired,
Expand Down
6 changes: 5 additions & 1 deletion mobile/Components/ResourceCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import PropTypes from 'prop-types';

function ResourceCard({
navigation, title, day, time, location, summary, url, number, email, website,
navigation, title, day, time, location, summary, url, number, email, website, tag,
}) {
const onPressEvent = () => {
navigation.navigate('Resource Details', {
Expand Down Expand Up @@ -35,6 +35,9 @@ function ResourceCard({
<Paragraph>
{location}
</Paragraph>
<Paragraph>
{tag}
</Paragraph>
</Card.Content>
<Card.Cover source={{ uri: url }} />
<Card.Actions>
Expand All @@ -54,6 +57,7 @@ ResourceCard.propTypes = {
number: PropTypes.string.isRequired,
email: PropTypes.string.isRequired,
website: PropTypes.string.isRequired,
tag: PropTypes.string.isRequired,
navigation: PropTypes.shape({
navigate: PropTypes.func,
}).isRequired,
Expand Down
8 changes: 8 additions & 0 deletions mobile/Screen/EventScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const events = [{
email: '[email protected]',
website: 'studio526.com',
url: 'https:/upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1024px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg',
tags: 'Workshop',
},
{
id: 2,
Expand All @@ -52,6 +53,7 @@ const events = [{
email: '[email protected]',
website: 'studio526.com',
url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1024px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg',
tags: 'Workshop',
},
{
id: 3,
Expand All @@ -67,6 +69,7 @@ const events = [{
email: '[email protected]',
website: 'studio526.com',
url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1024px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg',
tags: 'Workshop',
}];

const resources = [
Expand All @@ -81,6 +84,7 @@ const resources = [
email: '[email protected]',
website: 'studio526.com',
url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1024px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg',
tags: 'Food',
},
{
id: 2,
Expand All @@ -93,6 +97,7 @@ const resources = [
email: '[email protected]',
website: 'studio526.com',
url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1024px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg',
tags: 'Shelter',
},
{
id: 3,
Expand All @@ -105,6 +110,7 @@ const resources = [
email: '[email protected]',
website: 'studio526.com',
url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1024px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg',
tags: 'Mission',
},

];
Expand Down Expand Up @@ -166,6 +172,7 @@ function EventScreen({ navigation }) {
summary={event.summary}
url={event.url}
navigation={navigation}
tag={event.tag}
/>
))}
{resources.map((resource) => (
Expand All @@ -181,6 +188,7 @@ function EventScreen({ navigation }) {
number={resource.number}
email={resource.email}
website={resource.website}
tag={resource.tag}
/>
))}
</ScrollView>
Expand Down
206 changes: 206 additions & 0 deletions mobile/Screen/MapFilter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
import React, { useState } from 'react';
import {
View, TouchableOpacity, ScrollView, Text, StyleSheet,
} from 'react-native';
import PropTypes from 'prop-types';

const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
flexWrap: 'wrap',
paddingHorizontal: 20,
},
text: {
fontSize: 16,
marginTop: 10,
marginLeft: 10,
color: 'grey',
},
header: {
color: 'dimgrey',
fontSize: 16,
marginTop: 25,
marginBottom: 10,
fontWeight: 'bold',
marginLeft: 10,
},
applyButton: {
marginTop: 20,
marginBottom: 50,
width: '95%',
borderRadius: 4,
height: 45,
backgroundColor: '#424288',
borderWidth: 2,
borderColor: '#424288',
justifyContent: 'center',
alignItems: 'center',
margin: 7,
},
});

function MapFilter({ route, navigation }) {
const {
categories, setCategories,
} = route.params;

const eventCategories = [
{
title: 'visual art',
length: 10,
atan9611 marked this conversation as resolved.
Show resolved Hide resolved
},
{
title: 'film',
length: 4,
},
{
title: 'music',
length: 5,
},
{
title: 'art-related community event',
length: 27,
},
{
title: 'performance/theater',
length: 19,
},
{
title: 'spoken word',
length: 11,
},
{
title: 'miscellaneous',
length: 14,
},
];

const resourceCategories = [
{
title: 'food',
length: 4,
},
{
title: 'shelter',
length: 7,
},
{
title: 'health',
length: 6,
},
{
title: 'legal services',
length: 14,
},
{
title: 'shower',
length: 6,
},
{
title: 'mission',
length: 7,
},
{
title: 'social services',
length: 15,
},
];

const getButtonColor = (category) => {
if (category) {
return '#DFDFEF';
}
return '#F8F8F8';
};

const getBorderColor = (category) => {
if (category) {
return '#4C4C9B';
} return '#D0D0E8';
};

const getButtonStyle = (object, category) => ({
width: ((object.length) + 5) * 9,
atan9611 marked this conversation as resolved.
Show resolved Hide resolved
height: 50,
backgroundColor: getButtonColor(category),
borderWidth: 2,
borderRadius: 10,
borderColor: getBorderColor(category),
justifyContent: 'center',
alignItems: 'center',
margin: 7,
});

const getTextColor = (category) => {
if (category) {
return '#424288';
} return '#6666A9';
};

const getTextStyle = (category) => ({
color: getTextColor(category),
fontSize: 16,
});

// MAKE THIS USE_EFFECT
const [tempCategories, setTempCategories] = useState({ ...categories });

const onPressCategories = (property) => {
const objectCopy = { ...tempCategories };
objectCopy[property] = !objectCopy[property];
setTempCategories(objectCopy);
};

const onPressApply = () => {
setCategories(tempCategories);
navigation.goBack();
};

return (
<ScrollView>
<Text style={styles.text}>Select Multiple Filtering Options.</Text>
<Text style={styles.header}>Events</Text>
<View style={styles.container}>
{eventCategories.map((category) => (
atan9611 marked this conversation as resolved.
Show resolved Hide resolved
<TouchableOpacity
style={getButtonStyle(category, tempCategories[category.title])}
onPress={() => onPressCategories(category.title)}
>
<Text style={getTextStyle(tempCategories[category.title])}>{category.title}</Text>
</TouchableOpacity>
))}
</View>
<Text style={styles.header}>Resources</Text>
<View style={styles.container}>
{resourceCategories.map((category) => (
atan9611 marked this conversation as resolved.
Show resolved Hide resolved
<TouchableOpacity
style={getButtonStyle(category, tempCategories[category.title])}
onPress={() => onPressCategories(category.title)}
>
<Text style={getTextStyle(tempCategories[category.title])}>{category.title}</Text>
</TouchableOpacity>
))}
<TouchableOpacity style={styles.applyButton} title="apply" onPress={() => onPressApply()}>
<Text style={[styles.title, { color: 'white' }, { fontWeight: '600' }]}>
Apply Filter
</Text>
</TouchableOpacity>
</View>
</ScrollView>
);
}

MapFilter.propTypes = {
route: PropTypes.shape({
params: PropTypes.shape({
categories: PropTypes.func.isRequired,
setCategories: PropTypes.func.isRequired,
}).isRequired,
}).isRequired,
navigation: PropTypes.shape({
goBack: PropTypes.func.isRequired,
}).isRequired,
};

export default MapFilter;
Loading