From 4b36b0e17fa5e70bc02b7b8c9f67fcdb9b3c63e5 Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 15 Apr 2020 10:44:21 -0400 Subject: [PATCH 01/11] Initial Commit structure setup --- assets/jsicons/detailAboutUs/Branch.js | 10 ++++ assets/jsicons/detailAboutUs/Handshake.js | 12 +++++ assets/jsicons/detailAboutUs/Rocket.js | 10 ++++ components/Profile/tabs/Details.js | 58 +++++++++++++++++++++-- constants/Profile/tabs/Details.js | 39 +++++++++++---- yarn.lock | 2 +- 6 files changed, 117 insertions(+), 14 deletions(-) create mode 100644 assets/jsicons/detailAboutUs/Branch.js create mode 100644 assets/jsicons/detailAboutUs/Handshake.js create mode 100644 assets/jsicons/detailAboutUs/Rocket.js diff --git a/assets/jsicons/detailAboutUs/Branch.js b/assets/jsicons/detailAboutUs/Branch.js new file mode 100644 index 00000000..3f468bf6 --- /dev/null +++ b/assets/jsicons/detailAboutUs/Branch.js @@ -0,0 +1,10 @@ +import React from 'react'; +import { SvgXml } from 'react-native-svg'; + +export default function BranchIcon() { + const branchicon = ` + `; + const BranchIcon = () => ; + + return ; +} diff --git a/assets/jsicons/detailAboutUs/Handshake.js b/assets/jsicons/detailAboutUs/Handshake.js new file mode 100644 index 00000000..d3cb7db8 --- /dev/null +++ b/assets/jsicons/detailAboutUs/Handshake.js @@ -0,0 +1,12 @@ +import React from 'react'; +import { SvgXml } from 'react-native-svg'; + +export default function HandshakeIcon() { + const handshakeicon = ` + `; + const HandshakeIcon = () => ( + + ); + + return ; +} diff --git a/assets/jsicons/detailAboutUs/Rocket.js b/assets/jsicons/detailAboutUs/Rocket.js new file mode 100644 index 00000000..a95f6f49 --- /dev/null +++ b/assets/jsicons/detailAboutUs/Rocket.js @@ -0,0 +1,10 @@ +import React from 'react'; +import { SvgXml } from 'react-native-svg'; + +export default function RocketIcon() { + const rocketicon = ` + `; + const RocketIcon = () => ; + + return ; +} diff --git a/components/Profile/tabs/Details.js b/components/Profile/tabs/Details.js index 0e70bb0c..c14775a0 100644 --- a/components/Profile/tabs/Details.js +++ b/components/Profile/tabs/Details.js @@ -1,12 +1,19 @@ import React from 'react'; import { View, Text } from 'react-native'; - +import { TouchableOpacity } from 'react-native'; import styles from '../../../constants/Profile/tabs/Details'; import FileIcon from '../../../assets/jsicons/detailAboutUs/File'; import ConnectFurther from '../ConnectFurther'; +import HandshakeIcon from '../../../assets/jsicons/detailAboutUs/Handshake'; +import RocketIcon from '../../../assets/jsicons/detailAboutUs/Rocket'; +import BranchIcon from '../../../assets/jsicons/detailAboutUs/Branch'; +import PlusSignCircle from '../../../assets/jsicons/PlusSignCircle'; + +// For connecting Partners +import { getConnections } from '../../../store/actions'; -const Details = props => { +const Details = (props) => { const { profile } = props; return ( @@ -19,8 +26,53 @@ const Details = props => { {'About Us'} {profile.about_us} - + + + {'Support Our Mission'} + + + Donate funds to go towards the overall mission of our conservation + organization. Your donation will be used to support our team, our + daily activities and research. + + + Donate + + + + + {'Projects Within Our Organization'} + + + + These projects are directly supported by us and are within our + organization. They have their own organization pages so the team + on the ground can better share the work they are doing in the + field. + + + + + Add a Project + + + + + {'Our Partners'} + + + These are the organizations that we are currently collaborating + with in order to spread awareness and raise the resources needed + to achieve our mission. + + + + + Add a Partner + + + {/* Species and Habitats is a feature not yet in place */} {/* diff --git a/constants/Profile/tabs/Details.js b/constants/Profile/tabs/Details.js index 5e91c465..3437fcbf 100644 --- a/constants/Profile/tabs/Details.js +++ b/constants/Profile/tabs/Details.js @@ -4,7 +4,7 @@ export default StyleSheet.create({ container: { flex: 1, backgroundColor: '#F2F2FB', - paddingHorizontal: 8 + paddingHorizontal: 8, }, sections: { marginTop: 8, @@ -12,7 +12,7 @@ export default StyleSheet.create({ width: '100%', padding: 16, borderRadius: 5, - fontSize: 15 + fontSize: 15, }, SocialContainer: { flexDirection: 'row', @@ -22,7 +22,7 @@ export default StyleSheet.create({ paddingBottom: 10, justifyContent: 'space-around', position: 'absolute', - bottom: 0 + bottom: 0, }, iconWrap: { flexWrap: 'wrap', @@ -31,14 +31,14 @@ export default StyleSheet.create({ borderBottomColor: '#eee', borderBottomWidth: 1, marginBottom: 2, - paddingBottom: 20 + paddingBottom: 20, }, title: { fontSize: 18, color: '#3B3B3B', alignSelf: 'center', paddingLeft: 10, - fontFamily: 'Lato-Bold' + fontFamily: 'Lato-Bold', }, body: { marginTop: 10, @@ -60,23 +60,42 @@ export default StyleSheet.create({ justifyContent: 'center', fontSize: 15, marginTop: 8, - marginBottom: 8 + marginBottom: 8, }, donateTitle: { fontSize: 18, textAlign: 'center', marginLeft: 10, - fontFamily: 'Lato-Bold' + fontFamily: 'Lato-Bold', }, donateButton: { alignItems: 'center', width: '100%', - marginTop: 24 + marginTop: 24, }, donateText: { marginTop: 10, fontSize: 15, textAlign: 'center', - fontFamily: 'Lato-Bold' - } + fontFamily: 'Lato-Bold', + }, + addProjectsButton: { + flexDirection: 'column', + alignItems: 'center', + justifyContent: 'center', + backgroundColor: '#f5f5f5', + borderRadius: 5, + padding: 10, + marginBottom: 20, + }, + buttonText: { + fontFamily: 'Lato-Bold', + color: '#3b3b3b', + marginTop: 15, + }, + ProjectPartnerSection: { + flexDirection: 'row', + justifyContent: 'center', + flexWrap: 'wrap', + }, }); diff --git a/yarn.lock b/yarn.lock index b3278688..44c5baba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11024,7 +11024,7 @@ minimist@^1.1.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minimist@^1.2.5: +minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== From f0b3c0dc0a1807473bafe143a3197e4793147479 Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 15 Apr 2020 17:11:43 -0400 Subject: [PATCH 02/11] Partner modal with search setup --- components/Animals/AnimalModal.js | 2 +- components/Partners/PartnersModal.js | 49 ++++++++++++++++++++++++++++ components/Partners/SearchBar.js | 16 +++++++++ components/Profile/tabs/Details.js | 27 ++++++++++++--- constants/Partners/SearchBar.js | 10 ++++++ constants/Profile/tabs/Details.js | 12 +++++-- 6 files changed, 107 insertions(+), 9 deletions(-) create mode 100644 components/Partners/PartnersModal.js create mode 100644 components/Partners/SearchBar.js create mode 100644 constants/Partners/SearchBar.js diff --git a/components/Animals/AnimalModal.js b/components/Animals/AnimalModal.js index 4d97d7de..d9a219af 100644 --- a/components/Animals/AnimalModal.js +++ b/components/Animals/AnimalModal.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Component } from 'react'; import { Modal, View, TouchableOpacity, Text } from 'react-native'; //import icons diff --git a/components/Partners/PartnersModal.js b/components/Partners/PartnersModal.js new file mode 100644 index 00000000..439d03e0 --- /dev/null +++ b/components/Partners/PartnersModal.js @@ -0,0 +1,49 @@ +import React, { useState, useEffect } from 'react'; +import { Modal, View, TouchableOpacity } from 'react-native'; +import BackArrow from '../../assets/jsicons/miscIcons/BackArrow'; + +import SearchBar from '../../components/Partners/SearchBar'; + +// For connecting Partners +import { getConnections } from '../../store/actions'; + +const PartnersModal = (props) => { + // const [partners, setPartners] = useState([]); + + // const getConnections = async () => { + // try { + // const partner = await props.getConnections(props.currentUserProfile.id); + // if (Array.isArray(partner)) setPartners(partner); + // else throw new Error(partner); + // } catch (error) { + // Alert.alert('Failed to get your partners'); + // } + // }; + + // useEffect(() => { + // getConnections(); + // }, []); + + return ( + props.setIsModalVisible(!props.isModalVisable)} + > + + + {/* {props.currentUserProfile.roles === 'conservationists'} */} + + props.setIsModalVisible(!props.isModalVisible)} + > + + + + + + ); +}; + +export default PartnersModal; diff --git a/components/Partners/SearchBar.js b/components/Partners/SearchBar.js new file mode 100644 index 00000000..33b03645 --- /dev/null +++ b/components/Partners/SearchBar.js @@ -0,0 +1,16 @@ +import React from 'react'; +import { View, TextInput } from 'react-native'; + +import Search from '../../assets/jsicons/SearchIcon'; +import styles from '../../constants/Partners/SearchBar'; + +const SearchBar = () => { + return ( + + + Search + + ); +}; + +export default SearchBar; diff --git a/components/Profile/tabs/Details.js b/components/Profile/tabs/Details.js index c14775a0..d9a624e1 100644 --- a/components/Profile/tabs/Details.js +++ b/components/Profile/tabs/Details.js @@ -1,6 +1,6 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { View, Text } from 'react-native'; -import { TouchableOpacity } from 'react-native'; +import { TouchableWithoutFeedback, TouchableOpacity } from 'react-native'; import styles from '../../../constants/Profile/tabs/Details'; import FileIcon from '../../../assets/jsicons/detailAboutUs/File'; @@ -10,12 +10,15 @@ import RocketIcon from '../../../assets/jsicons/detailAboutUs/Rocket'; import BranchIcon from '../../../assets/jsicons/detailAboutUs/Branch'; import PlusSignCircle from '../../../assets/jsicons/PlusSignCircle'; -// For connecting Partners -import { getConnections } from '../../../store/actions'; +import PartnersModal from '../../Partners/PartnersModal'; + +import SearchBar from '../../Partners/SearchBar'; const Details = (props) => { const { profile } = props; + const [isModalVisible, setIsModalVisible] = useState(false); + return ( {profile.roles !== 'supporter' && ( @@ -67,8 +70,22 @@ const Details = (props) => { to achieve our mission. - + {/* */} + { + setIsModalVisible(true); + }} + > + {/* */} + Add a Partner diff --git a/constants/Partners/SearchBar.js b/constants/Partners/SearchBar.js new file mode 100644 index 00000000..960697bc --- /dev/null +++ b/constants/Partners/SearchBar.js @@ -0,0 +1,10 @@ +import { StyleSheet } from 'react-native'; + +export default StyleSheet.create({ + background: { + backgroundColor: '#F0EEEE', + height: 50, + borderRadius: 5, + marginHorizontal: 15, + }, +}); diff --git a/constants/Profile/tabs/Details.js b/constants/Profile/tabs/Details.js index 3437fcbf..174bfb16 100644 --- a/constants/Profile/tabs/Details.js +++ b/constants/Profile/tabs/Details.js @@ -42,6 +42,7 @@ export default StyleSheet.create({ }, body: { marginTop: 10, + marginBottom: 30, flexDirection: 'column', flexWrap: 'nowrap', fontSize: 17, @@ -71,13 +72,18 @@ export default StyleSheet.create({ donateButton: { alignItems: 'center', width: '100%', - marginTop: 24, + marginTop: 10, + marginBottom: 50, + backgroundColor: 'limegreen', + padding: 10, + borderRadius: 5, }, donateText: { - marginTop: 10, - fontSize: 15, + fontSize: 25, textAlign: 'center', fontFamily: 'Lato-Bold', + textTransform: 'uppercase', + color: '#3b3b3b' }, addProjectsButton: { flexDirection: 'column', From 6326e5b5903887c679e4615d201e2f1683ae08b9 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 20 Apr 2020 12:03:42 -0400 Subject: [PATCH 03/11] Partner modal displaying --- components/Partners/PartnersModal.js | 4 +++- components/Profile/tabs/Details.js | 9 +++++++-- constants/Partners/PartnerModal.js | 12 ++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 constants/Partners/PartnerModal.js diff --git a/components/Partners/PartnersModal.js b/components/Partners/PartnersModal.js index 439d03e0..996163a7 100644 --- a/components/Partners/PartnersModal.js +++ b/components/Partners/PartnersModal.js @@ -7,6 +7,7 @@ import SearchBar from '../../components/Partners/SearchBar'; // For connecting Partners import { getConnections } from '../../store/actions'; +import styles from '../../constants/Partners/PartnerModal'; const PartnersModal = (props) => { // const [partners, setPartners] = useState([]); @@ -31,7 +32,8 @@ const PartnersModal = (props) => { visible={props.isModalVisable} onRequestClose={() => props.setIsModalVisible(!props.isModalVisable)} > - + + {/* {props.currentUserProfile.roles === 'conservationists'} */} diff --git a/components/Profile/tabs/Details.js b/components/Profile/tabs/Details.js index d9a624e1..8f21d048 100644 --- a/components/Profile/tabs/Details.js +++ b/components/Profile/tabs/Details.js @@ -21,6 +21,7 @@ const Details = (props) => { return ( + {profile.roles !== 'supporter' && ( @@ -70,10 +71,10 @@ const Details = (props) => { to achieve our mission. - {/* */} + /> { @@ -81,6 +82,10 @@ const Details = (props) => { }} > + {/* */} {/* Date: Mon, 20 Apr 2020 16:49:57 -0400 Subject: [PATCH 04/11] Modal displaying, not getting connections --- components/Animals/AnimalModal.js | 4 +-- components/Partners/PartnersModal.js | 44 +++++++++++++++------------- components/Partners/SearchBar.js | 2 +- components/Profile/tabs/Details.js | 20 +++++-------- constants/Partners/PartnerModal.js | 17 ++++++----- constants/Partners/SearchBar.js | 11 +++++-- 6 files changed, 52 insertions(+), 46 deletions(-) diff --git a/components/Animals/AnimalModal.js b/components/Animals/AnimalModal.js index d9a219af..a81f35c1 100644 --- a/components/Animals/AnimalModal.js +++ b/components/Animals/AnimalModal.js @@ -11,10 +11,10 @@ import Animals from '../Animals/Animals'; //import styles import styles from '../../constants/Animals/AnimalModal'; -const AnimalModal = props => { +const AnimalModal = (props) => { return ( props.setIsModalVisible(!props.isModalVisible)} diff --git a/components/Partners/PartnersModal.js b/components/Partners/PartnersModal.js index 996163a7..6efad103 100644 --- a/components/Partners/PartnersModal.js +++ b/components/Partners/PartnersModal.js @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { Modal, View, TouchableOpacity } from 'react-native'; +import { Alert, Modal, View, TouchableOpacity, Text } from 'react-native'; import BackArrow from '../../assets/jsicons/miscIcons/BackArrow'; import SearchBar from '../../components/Partners/SearchBar'; @@ -9,40 +9,44 @@ import { getConnections } from '../../store/actions'; import styles from '../../constants/Partners/PartnerModal'; const PartnersModal = (props) => { - // const [partners, setPartners] = useState([]); + const [partners, setPartners] = useState([]); - // const getConnections = async () => { - // try { - // const partner = await props.getConnections(props.currentUserProfile.id); - // if (Array.isArray(partner)) setPartners(partner); - // else throw new Error(partner); - // } catch (error) { - // Alert.alert('Failed to get your partners'); - // } - // }; + const getConnections = async () => { + try { + const partner = await props.getConnections(props.currentUserProfile.id); + if (Array.isArray(partner)) setPartners(partner); + else throw new Error(partner); + } catch (error) { + Alert.alert('Failed to get your partners'); + } + }; - // useEffect(() => { - // getConnections(); - // }, []); + useEffect(() => { + getConnections(); + }, []); return ( props.setIsModalVisible(!props.isModalVisable)} + visible={props.isPartnersModalVisable} + onRequestClose={() => + props.setIsPartnersModalVisible(!props.isPartnersModalVisable) + } > - - - {/* {props.currentUserProfile.roles === 'conservationists'} */} + props.setIsModalVisible(!props.isModalVisible)} + onPress={() => + props.setIsPartnersModalVisible(!props.isPartnersModalVisible) + } > + + {/* {props.currentUserProfile.roles === 'conservationists'} */} ); diff --git a/components/Partners/SearchBar.js b/components/Partners/SearchBar.js index 33b03645..29d22110 100644 --- a/components/Partners/SearchBar.js +++ b/components/Partners/SearchBar.js @@ -8,7 +8,7 @@ const SearchBar = () => { return ( - Search + ); }; diff --git a/components/Profile/tabs/Details.js b/components/Profile/tabs/Details.js index 8f21d048..22b42f78 100644 --- a/components/Profile/tabs/Details.js +++ b/components/Profile/tabs/Details.js @@ -12,16 +12,13 @@ import PlusSignCircle from '../../../assets/jsicons/PlusSignCircle'; import PartnersModal from '../../Partners/PartnersModal'; -import SearchBar from '../../Partners/SearchBar'; - const Details = (props) => { const { profile } = props; - const [isModalVisible, setIsModalVisible] = useState(false); + const [isPartnersModalVisible, setIsPartnersModalVisible] = useState(false); return ( - {profile.roles !== 'supporter' && ( @@ -71,14 +68,15 @@ const Details = (props) => { to achieve our mission. - + {/* */} { - setIsModalVisible(true); + setIsPartnersModalVisible(true); + console.log('plus clicked'); }} > @@ -86,10 +84,6 @@ const Details = (props) => { setIsModalVisible={setIsModalVisible} isModalVisible={isModalVisible} /> */} - {/* */} Add a Partner diff --git a/constants/Partners/PartnerModal.js b/constants/Partners/PartnerModal.js index ce917303..db0340a1 100644 --- a/constants/Partners/PartnerModal.js +++ b/constants/Partners/PartnerModal.js @@ -2,11 +2,12 @@ import { StyleSheet, Dimensions } from 'react-native'; import { responsiveFontSize } from 'react-native-responsive-dimensions'; const styles = StyleSheet.create({ - modalContainer: { - justifyContent: 'center', - alignItems: 'center', - flex: 1, - backgroundColor: 'blue' - } -}) - export default styles; \ No newline at end of file + modalContainer: { + justifyContent: 'center', + alignItems: 'center', + flex: 1, + backgroundColor: 'lightgrey', + flexDirection: 'row', + }, +}); +export default styles; diff --git a/constants/Partners/SearchBar.js b/constants/Partners/SearchBar.js index 960697bc..8f5b8435 100644 --- a/constants/Partners/SearchBar.js +++ b/constants/Partners/SearchBar.js @@ -1,10 +1,17 @@ import { StyleSheet } from 'react-native'; -export default StyleSheet.create({ +const styles = StyleSheet.create({ background: { - backgroundColor: '#F0EEEE', + // backgroundColor: '#F0EEEE', + backgroundColor: 'darkgrey', height: 50, borderRadius: 5, marginHorizontal: 15, + width: '80%', + flexDirection: 'row', + alignItems: 'center', + paddingLeft: 10 }, }); + +export default styles; From 3e2e256a752232583e24250e1cf81ee54c5e9162 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 23 Apr 2020 14:50:58 -0400 Subject: [PATCH 05/11] Saved tab added to Profiles and Partners feature updated --- components/Profile/ProfileBody.js | 23 ++++++++++++++--------- components/Profile/tabs/Details.js | 7 ++++--- components/Profile/tabs/Saved.js | 16 ++++++++++++++++ constants/Profile/ProfileBody.js | 9 +++++---- constants/Profile/tabs/Saved.js | 15 +++++++++++++++ 5 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 components/Profile/tabs/Saved.js create mode 100644 constants/Profile/tabs/Saved.js diff --git a/components/Profile/ProfileBody.js b/components/Profile/ProfileBody.js index cc111d11..2cc785ea 100644 --- a/components/Profile/ProfileBody.js +++ b/components/Profile/ProfileBody.js @@ -7,19 +7,23 @@ import styles from '../../constants/Profile/ProfileBody'; import Details from './tabs/Details'; import Campaigns from './tabs/Campaigns'; import Location from './tabs/Location'; +import Saved from './tabs/Saved'; export default React.forwardRef((props, ref) => { const routes = props.profile.roles === 'supporter' ? [ { key: 'campaigns', title: 'Profile' }, - { key: 'details', title: 'Details' } + { key: 'details', title: 'Details' }, ] : [ { key: 'campaigns', title: 'Campaigns' }, - { key: 'details', title: 'Details' } + { key: 'details', title: 'Details' }, + { key: 'saved', title: 'Saved' }, ]; + // [ { key: 'saved', title: 'Saved' }] + // If the profile in questions is an organization and has a location, // insert a tab in index 1 (in the middle as per designs) if (props.profile.roles === 'conservationist' && props.profile.location) { @@ -28,12 +32,12 @@ export default React.forwardRef((props, ref) => { const [state, setState] = useState({ index: 0, - routes + routes, }); - const handleIndexChange = index => { + const handleIndexChange = (index) => { props.scrollToMaximizeContent(index === state.index); - setState(prevState => ({ ...prevState, index })); + setState((prevState) => ({ ...prevState, index })); }; const renderTabBar = ({ navigationState }) => { @@ -42,7 +46,7 @@ export default React.forwardRef((props, ref) => { const translateY = props.contentPaddingTop ? props.scrollY.interpolate({ inputRange: [0, distance, distance * 2], - outputRange: [0, 0, distance] + outputRange: [0, 0, distance], }) : 0; @@ -59,7 +63,7 @@ export default React.forwardRef((props, ref) => { backgroundColor: 'white', borderBottomColor: `rgba(0, 255, 157, ${ state.index === i ? 1 : 0 - })` + })`, }} onPress={() => handleIndexChange(i)} > @@ -76,14 +80,15 @@ export default React.forwardRef((props, ref) => { const renderScene = SceneMap({ campaigns: () => , location: () => , - details: () =>
+ details: () =>
, + saved: () => , }); return ( { }} > + {/* */} + setIsPartnersModalVisible={setIsPartnersModalVisible} + isPartnersModalVisible={isPartnersModalVisible} + /> */} Add a Partner diff --git a/components/Profile/tabs/Saved.js b/components/Profile/tabs/Saved.js new file mode 100644 index 00000000..9877da39 --- /dev/null +++ b/components/Profile/tabs/Saved.js @@ -0,0 +1,16 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +import styles from '../../../constants/Profile/tabs/Saved'; + +const Saved = (props) => { + const { profile } = props; + + return ( + + Saved Campaigns + + ); +}; + +export default Saved; \ No newline at end of file diff --git a/constants/Profile/ProfileBody.js b/constants/Profile/ProfileBody.js index b03df190..ba7c74ee 100644 --- a/constants/Profile/ProfileBody.js +++ b/constants/Profile/ProfileBody.js @@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native'; export default StyleSheet.create({ container: { - flex: 1 + flex: 1, }, tabBar: { left: 0, @@ -10,7 +10,7 @@ export default StyleSheet.create({ zIndex: 100, flexDirection: 'row', position: 'absolute', - backgroundColor: 'white' + backgroundColor: 'white', }, tabItem: { flex: 1, @@ -18,6 +18,7 @@ export default StyleSheet.create({ color: 'black', borderBottomWidth: 3, borderBottomColor: 'white', - padding: 12 - } + paddingHorizontal: 5, // Changed from padding: 12 until get subnav setup + paddingVertical: 12, + }, }); diff --git a/constants/Profile/tabs/Saved.js b/constants/Profile/tabs/Saved.js new file mode 100644 index 00000000..3fb37b98 --- /dev/null +++ b/constants/Profile/tabs/Saved.js @@ -0,0 +1,15 @@ +import { StyleSheet } from 'react-native'; + +const styles = StyleSheet.create({ + container: { + flexDirection: 'row', + justifyContent: 'center' + }, + title: { + fontFamily: 'Lato-Bold', + fontSize: 20, + marginTop: 20 + } +}) + +export default styles; \ No newline at end of file From cce6039fcc3f106c556d3b1f4291971adbdaf822 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 23 Apr 2020 17:21:48 -0400 Subject: [PATCH 06/11] Saved tab added to supporter profile --- components/Profile/ProfileBody.js | 1 + components/Profile/tabs/Details.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Profile/ProfileBody.js b/components/Profile/ProfileBody.js index 2cc785ea..3d2d977e 100644 --- a/components/Profile/ProfileBody.js +++ b/components/Profile/ProfileBody.js @@ -15,6 +15,7 @@ export default React.forwardRef((props, ref) => { ? [ { key: 'campaigns', title: 'Profile' }, { key: 'details', title: 'Details' }, + { key: 'saved', title: 'Saved' }, ] : [ { key: 'campaigns', title: 'Campaigns' }, diff --git a/components/Profile/tabs/Details.js b/components/Profile/tabs/Details.js index 7869b47f..112322fb 100644 --- a/components/Profile/tabs/Details.js +++ b/components/Profile/tabs/Details.js @@ -68,6 +68,9 @@ const Details = (props) => { to achieve our mission. + {/* Code below commented out because by default the modal displays + for some reason...working on it. */} + {/* { }} > - + {/* Date: Thu, 23 Apr 2020 18:21:55 -0400 Subject: [PATCH 07/11] Requested changes made --- components/Profile/ProfileBody.js | 6 +++--- components/Profile/tabs/Details.js | 5 ----- components/Profile/tabs/Saved.js | 16 ---------------- constants/Profile/tabs/Saved.js | 15 --------------- 4 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 components/Profile/tabs/Saved.js delete mode 100644 constants/Profile/tabs/Saved.js diff --git a/components/Profile/ProfileBody.js b/components/Profile/ProfileBody.js index 3d2d977e..d9601fc5 100644 --- a/components/Profile/ProfileBody.js +++ b/components/Profile/ProfileBody.js @@ -15,12 +15,12 @@ export default React.forwardRef((props, ref) => { ? [ { key: 'campaigns', title: 'Profile' }, { key: 'details', title: 'Details' }, - { key: 'saved', title: 'Saved' }, + ] : [ { key: 'campaigns', title: 'Campaigns' }, { key: 'details', title: 'Details' }, - { key: 'saved', title: 'Saved' }, + ]; // [ { key: 'saved', title: 'Saved' }] @@ -82,7 +82,7 @@ export default React.forwardRef((props, ref) => { campaigns: () => , location: () => , details: () =>
, - saved: () => , + }); return ( diff --git a/components/Profile/tabs/Details.js b/components/Profile/tabs/Details.js index 112322fb..936a9925 100644 --- a/components/Profile/tabs/Details.js +++ b/components/Profile/tabs/Details.js @@ -84,11 +84,6 @@ const Details = (props) => { > - {/* */} - Add a Partner diff --git a/components/Profile/tabs/Saved.js b/components/Profile/tabs/Saved.js deleted file mode 100644 index 9877da39..00000000 --- a/components/Profile/tabs/Saved.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import { View, Text } from 'react-native'; - -import styles from '../../../constants/Profile/tabs/Saved'; - -const Saved = (props) => { - const { profile } = props; - - return ( - - Saved Campaigns - - ); -}; - -export default Saved; \ No newline at end of file diff --git a/constants/Profile/tabs/Saved.js b/constants/Profile/tabs/Saved.js deleted file mode 100644 index 3fb37b98..00000000 --- a/constants/Profile/tabs/Saved.js +++ /dev/null @@ -1,15 +0,0 @@ -import { StyleSheet } from 'react-native'; - -const styles = StyleSheet.create({ - container: { - flexDirection: 'row', - justifyContent: 'center' - }, - title: { - fontFamily: 'Lato-Bold', - fontSize: 20, - marginTop: 20 - } -}) - -export default styles; \ No newline at end of file From 01f5e6cad453b6d792cfed5dc650a145b2ec4a26 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 23 Apr 2020 18:30:25 -0400 Subject: [PATCH 08/11] Changed Profile to My Campaigns --- components/Profile/ProfileBody.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/components/Profile/ProfileBody.js b/components/Profile/ProfileBody.js index d9601fc5..6bc8f219 100644 --- a/components/Profile/ProfileBody.js +++ b/components/Profile/ProfileBody.js @@ -7,23 +7,21 @@ import styles from '../../constants/Profile/ProfileBody'; import Details from './tabs/Details'; import Campaigns from './tabs/Campaigns'; import Location from './tabs/Location'; -import Saved from './tabs/Saved'; + export default React.forwardRef((props, ref) => { const routes = props.profile.roles === 'supporter' ? [ - { key: 'campaigns', title: 'Profile' }, + { key: 'campaigns', title: 'My Campaigns' }, { key: 'details', title: 'Details' }, - ] : [ { key: 'campaigns', title: 'Campaigns' }, { key: 'details', title: 'Details' }, - ]; - // [ { key: 'saved', title: 'Saved' }] + // If the profile in questions is an organization and has a location, // insert a tab in index 1 (in the middle as per designs) @@ -82,7 +80,6 @@ export default React.forwardRef((props, ref) => { campaigns: () => , location: () => , details: () =>
, - }); return ( From 0c3a1fa32e691e021a03f4e31c5a9adcaaea210f Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 24 Apr 2020 11:41:03 -0400 Subject: [PATCH 09/11] changed text in my campaigns --- components/Profile/ComingSoon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Profile/ComingSoon.js b/components/Profile/ComingSoon.js index 65b83493..2e434be1 100644 --- a/components/Profile/ComingSoon.js +++ b/components/Profile/ComingSoon.js @@ -7,7 +7,7 @@ const ComingSoon = () => { return ( - More exciting features to come! + This user has not saved any campaigns yet. ); }; From e597f94fe7dc89cfd0c8fd1704ff2faaaf686fc2 Mon Sep 17 00:00:00 2001 From: Katie Rose Felten Date: Tue, 28 Apr 2020 00:53:05 -0400 Subject: [PATCH 10/11] :zap: imported take action button --- components/Profile/tabs/Details.js | 21 +++++++++---- constants/Profile/tabs/Details.js | 49 +++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/components/Profile/tabs/Details.js b/components/Profile/tabs/Details.js index 936a9925..582e748a 100644 --- a/components/Profile/tabs/Details.js +++ b/components/Profile/tabs/Details.js @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import { View, Text } from 'react-native'; import { TouchableWithoutFeedback, TouchableOpacity } from 'react-native'; +import { connect } from 'react-redux'; import styles from '../../../constants/Profile/tabs/Details'; import FileIcon from '../../../assets/jsicons/detailAboutUs/File'; @@ -9,10 +10,12 @@ import HandshakeIcon from '../../../assets/jsicons/detailAboutUs/Handshake'; import RocketIcon from '../../../assets/jsicons/detailAboutUs/Rocket'; import BranchIcon from '../../../assets/jsicons/detailAboutUs/Branch'; import PlusSignCircle from '../../../assets/jsicons/PlusSignCircle'; +import TakeAction from '../../../components/TakeAction/TakeActionCallToAction'; import PartnersModal from '../../Partners/PartnersModal'; const Details = (props) => { + const { data } = props; const { profile } = props; const [isPartnersModalVisible, setIsPartnersModalVisible] = useState(false); @@ -37,10 +40,12 @@ const Details = (props) => { organization. Your donation will be used to support our team, our daily activities and research. - - Donate - - + {/* // April 2020: Props needs to pass properly for donate button */} + {/* + + */} + {/* // April 2020: Projects will be added at a later time */} + {/* {'Projects Within Our Organization'} @@ -57,7 +62,7 @@ const Details = (props) => { Add a Project - + */} {'Our Partners'} @@ -111,4 +116,8 @@ const Details = (props) => { ); }; -export default Details; +const mapStateToProps = (state) => ({ + currentUserProfile: state.currentUserProfile, +}); + +export default connect(mapStateToProps, {})(Details); diff --git a/constants/Profile/tabs/Details.js b/constants/Profile/tabs/Details.js index 174bfb16..45e3500d 100644 --- a/constants/Profile/tabs/Details.js +++ b/constants/Profile/tabs/Details.js @@ -70,21 +70,54 @@ export default StyleSheet.create({ fontFamily: 'Lato-Bold', }, donateButton: { - alignItems: 'center', + flex: 1, + padding: 15, width: '100%', - marginTop: 10, - marginBottom: 50, - backgroundColor: 'limegreen', - padding: 10, + flexWrap: 'wrap', + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + fontSize: 18, + }, + buttonTouch: { + width: '95%', + height: 48, + backgroundColor: '#F5F5F5', + alignItems: 'center', + justifyContent: 'center', borderRadius: 5, + textAlign: 'center', + shadowColor: 'rgba(0, 0, 0, 0.15)', + shadowOffset: { + height: 4, + }, + shadowRadius: 5, + shadowOpacity: 10, }, donateText: { - fontSize: 25, + color: '#323339', + textTransform: 'uppercase', + letterSpacing: 1.8, + fontSize: 17, textAlign: 'center', fontFamily: 'Lato-Bold', - textTransform: 'uppercase', - color: '#3b3b3b' }, + // donateButton: { + // alignItems: 'center', + // width: '100%', + // marginTop: 10, + // marginBottom: 50, + // backgroundColor: 'limegreen', + // padding: 10, + // borderRadius: 5, + // }, + // donateText: { + // fontSize: 25, + // textAlign: 'center', + // fontFamily: 'Lato-Bold', + // textTransform: 'uppercase', + // color: '#3b3b3b' + // }, addProjectsButton: { flexDirection: 'column', alignItems: 'center', From 01fd2ccb0eb97a3cd1c3defc006122af9b28c71c Mon Sep 17 00:00:00 2001 From: Katie Rose Felten Date: Tue, 28 Apr 2020 00:54:18 -0400 Subject: [PATCH 11/11] :zap: updated styles --- constants/Profile/tabs/Details.js | 1 - 1 file changed, 1 deletion(-) diff --git a/constants/Profile/tabs/Details.js b/constants/Profile/tabs/Details.js index 45e3500d..e22f316e 100644 --- a/constants/Profile/tabs/Details.js +++ b/constants/Profile/tabs/Details.js @@ -122,7 +122,6 @@ export default StyleSheet.create({ flexDirection: 'column', alignItems: 'center', justifyContent: 'center', - backgroundColor: '#f5f5f5', borderRadius: 5, padding: 10, marginBottom: 20,