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

App linking #183

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
731d4cb
Reinstalled pods
May 21, 2020
f5a75f9
Added Linking functionality to the social media and mail button in th…
May 22, 2020
1344ba0
From previous commit to issue #136 did some clean up and code style t…
May 22, 2020
6b3a728
Rewrote openApp and openEmail into one component. Also, Haniel change…
May 28, 2020
82eb1f3
re-write of app linking.
Jun 3, 2020
6cba53b
rename in dashboard the buttonlinks to socialmedialink.
Jun 5, 2020
03d6a23
resolving merge
Jun 5, 2020
bccf67c
Added Linking functionality to the social media and mail button in th…
May 22, 2020
d6150ae
From previous commit to issue #136 did some clean up and code style t…
May 22, 2020
acfd80d
Rewrote openApp and openEmail into one component. Also, Haniel change…
May 28, 2020
4edf270
re-write of app linking.
Jun 3, 2020
038d3f2
Update appLinking.js
grindlock Jun 3, 2020
5d2dc8d
Fix filterlist initial value bug
esteban737 May 23, 2020
280a84f
rename in dashboard the buttonlinks to socialmedialink.
Jun 5, 2020
b864723
update the files after PR comments.
Jun 10, 2020
446375e
Collapsible view component created.
Jun 28, 2020
44800fd
Revert "Collapsible view component created."
Jun 28, 2020
b7e9772
Collapsible view component created.
Jun 28, 2020
88e1280
Do so cleaning in collapse.
Jul 1, 2020
ee6902d
Lastest updates reflect the rquested changes.
Jul 1, 2020
e78a8b6
Fix color problem in otherprofile page.
Jul 1, 2020
6e96e20
Latest changes to pr #183.
Jul 1, 2020
81b6d7a
Make changes from pr and fix color problem in otherprofile.
Jul 1, 2020
ea01d8f
Latest fixes to the app linking component.
Jul 4, 2020
88aaeb0
move slackinfo to env and do some cleaning.
Jul 6, 2020
a19ea9f
one last time. channel IDs are in the env file
Jul 15, 2020
1ee6baa
miss something
Jul 15, 2020
4853298
working with section list in the conference page.
Jul 20, 2020
c32170b
Added the conference to the router and more page.
Jul 27, 2020
d56dd32
Conference page is finish.
Jul 27, 2020
b20b2de
Update src/utils/appLinking.js
grindlock Aug 30, 2020
c074446
h
Aug 30, 2020
85e7b76
Committing the changes resqueted.
Aug 30, 2020
448573e
resolving a merge conflict.
Aug 30, 2020
af8326d
Merge branch 'master' into conferenceScreen
grindlock Aug 30, 2020
a61597b
Merge pull request #1 from grindlock/conferenceScreen
grindlock Aug 30, 2020
607b4c5
Revert "Conference screen"
grindlock Aug 31, 2020
721c8b4
Merge pull request #2 from grindlock/revert-1-conferenceScreen
grindlock Aug 31, 2020
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
9 changes: 9 additions & 0 deletions ios/shpeucfapp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>tel</string>
<string>mailto</string>
<string>instagram</string>
<string>slack</string>
<string>fb</string>
<string>linkedin</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
6 changes: 3 additions & 3 deletions src/components/general/FilterList.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class FilterList extends Component {
}

componentDidUpdate(prevProps) {
if (prevProps.value !== this.props.value) this.setState(this.processInitialValues());
if (prevProps.value !== this.props.value) this.setState({ selected: this.processInitialValues() });
}

processInitialValues() {
Expand All @@ -84,9 +84,9 @@ class FilterList extends Component {
selected[selectBy(item)] = item;
});
}

return { selected };
}

return selected ;
}

static propTypes = {
Expand Down
122 changes: 55 additions & 67 deletions src/data/FormData.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
The order you put in the data reflects the order that the
fields are displayed
*/
* The order you put in the data reflects the order that the
* fields are displayed
*/

import React from "react";
import Countries from "./Countries.json";
import Majors from "./Majors.json";
import { changeHourBy, timeVerification } from "../utils/events";
import { editUser } from "../ducks";
import { useSelector } from "react-redux";
import { Form } from "../components";

Expand Down Expand Up @@ -35,6 +36,7 @@ export const EventForm = (props) => {
format: ({ type, committee }) => committee ? `${type}: ${committee}` : type.trim(),
revert: ({ type }) => {
const [eventType, , ] = type.split(": ");

return eventType;
}
},
Expand Down Expand Up @@ -132,71 +134,59 @@ export const EventForm = (props) => {
);
};

const editProfileFormDataRegular = [
{
placeholder: "Gender",
camelCaseName: "gender",
type: "PickerInput",
isRequired: false,
options: {
data: genderOptions
}
},
{
placeholder: "Major",
camelCaseName: "major",
type: "FilterList",
isRequired: false,
options: {
data: Majors
}
},
{
placeholder: "Country of Origin",
camelCaseName: "country",
type: "FilterList",
isRequired: false,
options: {
data: Countries
export const ProfileForm = (props) => {
const memberFields = [
{
placeholder: "Gender",
camelCaseName: "gender",
type: "PickerInput",
isRequired: false,
options: { data: genderOptions }
},
{
placeholder: "Major",
camelCaseName: "major",
type: "FilterList",
isRequired: false,
options: { data: Majors }
},
{
placeholder: "Country of Origin",
camelCaseName: "country",
type: "FilterList",
isRequired: false,
options: { data: Countries }
},
{
placeholder: "LinkedIn Profile name",
camelCaseName: "linkedin",
type: "Input",
isRequired: false
}
}
];
];

const editProfileFormDataPrivileged = [
{
placeholder: "Gender",
camelCaseName: "gender",
type: "PickerInput",
isRequired: false,
options: {
data: genderOptions
}
},
{
placeholder: "Major",
camelCaseName: "major",
type: "FilterList",
isRequired: false,
options: {
data: Majors
}
},
{
placeholder: "Country of Origin",
camelCaseName: "country",
type: "FilterList",
isRequired: false,
options: {
data: Countries
const privilegedFields = [
{
placeholder: "Birthday",
camelCaseName: "birthday",
type: "DatePicker",
isRequired: false
}
},
{
placeholder: "Birthday",
camelCaseName: "birthday",
type: "DatePicker",
isRequired: false
}
];
];

const activeUser = useSelector(state => state.user.activeUser);

let elements = (activeUser.privilege.eboard) ? [...memberFields, ...privilegedFields] : memberFields;

return (
<Form
elements = { elements }
values = { activeUser }
onSubmit = { editUser }
{ ...props }
/>
);
};

const registrationFormData = [
{
Expand Down Expand Up @@ -293,8 +283,6 @@ const upsertCommittee = [
];

export {
editProfileFormDataPrivileged,
editProfileFormDataRegular,
registrationFormData,
upsertCommittee
};
Expand Down
4 changes: 2 additions & 2 deletions src/ducks/Members.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const INITIAL_STATE = {
error: "",
id: "",
flag: "",
dashColor: "",
color: "",
filters: {},
userCommittees: {},
userList: {}
Expand Down Expand Up @@ -129,7 +129,7 @@ export default (state = INITIAL_STATE, action) => {
paidMember: payload.paidMember,
flag: payload.flag,
userCommittees: payload.committees,
dashColor: payload.color,
color: payload.color,
privilege: payload.privilege };
case ACTIONS.FETCH_ALL_USERS:
return { ...state,
Expand Down
1 change: 1 addition & 0 deletions src/ducks/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const INITIAL_STATE = {
birthday: "0000-00-00",
paidMember: false,
id: "",
linkedin: "",
voted: false,
applied: false,
userCommittees: {}
Expand Down
18 changes: 9 additions & 9 deletions src/screens/General/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { rankMembersAndReturnsCurrentUser } from "../../utils/render";
import { goToViewEvent } from "../../utils/router";
import { months } from "../../data/DateItems";
import { filterPastEvents } from "../../utils/events";
import { openAppOrWebsite } from "../../utils/appLinking";
import {
Text,
View,
ScrollView,
Dimensions,
TouchableOpacity,
Linking,
Modal,
SafeAreaView,
StatusBar
Expand Down Expand Up @@ -348,25 +348,25 @@ class Dashboard extends Component {
black
} = styles;

let buttonLinks = [
["https://shpeucf2018-2019.slack.com/", "slack"],
["https://www.facebook.com/shpeucfchapter/", "facebook"],
["https://www.shpeucf.com/", "globe"],
["https://www.instagram.com/shpeucf/?hl=en", "instagram"]
let socialMediaLinks = [
{ appLink: ["slack", "channel", "announcements"], appImage: "slack" },
{ appLink: ["facebook", "groups", "shpeucf"], appImage: "facebook" },
{ appLink: ["web", "open", "https://www.shpeucf.com/"], appImage: "globe" },
{ appLink: ["instagram", "open", "shpeucf"], appImage: "instagram" }
];

return (
<View style = { socialMediaContainer }>
<View style = { buttonRowContainer }>
{ buttonLinks.map((data, index) =>
{ socialMediaLinks.map((socialMediaLinks, index) =>
<TouchableOpacity
key = { index }
style = { socialMediaButton }
onPress = { () => Linking.openURL(data[0]) }
onPress = { () => openAppOrWebsite(...socialMediaLinks.appLink) }
>
<FontAwesomeIcon
style = { black }
name = { data[1] }
name = { socialMediaLinks.appImage }
size = { dimension.height * 0.04 }
/>
</TouchableOpacity>
Expand Down
40 changes: 17 additions & 23 deletions src/screens/User/OtherProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React, { Component } from "react";
import { Actions } from "react-native-router-flux";
import Ionicons from "react-native-vector-icons/Ionicons";
import { connect } from "react-redux";
import { Alert, ButtonLayout, NavBar } from "../../components";
import { ButtonLayout, NavBar } from "../../components";
import { Avatar } from "react-native-elements";
import Flag from "react-native-flags";
import { verifiedCheckMark } from "../../utils/render";
import { openAppOrWebsite } from "../../utils/appLinking";
import { Text, View, TouchableOpacity, Dimensions, SafeAreaView } from "react-native";

const dimension = Dimensions.get("window");
Expand All @@ -18,16 +19,8 @@ class OtherProfile extends Component {
}

renderContent() {
const {
email, major, points
} = this.props;
const {
bioContainer,
fieldContainerStyle,
itemLabelText,
itemValueText,
textColor
} = styles;
const { email, major, points } = this.props;
const { bioContainer, fieldContainerStyle, itemLabelText, itemValueText, textColor } = styles;

return (
<SafeAreaView style = {{ flex: 1, backgroundColor: "#0c0b0b" }}>
Expand Down Expand Up @@ -122,8 +115,8 @@ class OtherProfile extends Component {
}

renderFlag() {

let flag = null;

if (this.props.flag !== "" && this.props.flag) {
flag = <Flag
type = "flat"
Expand All @@ -146,27 +139,26 @@ class OtherProfile extends Component {
LogoContainer,
socialmediarow
} = styles;
const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This derefrencing can all be one line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bumpidump dump

firstName,
email,
linkedin
} = this.props;

return (
<View style = {{ flex: 0.2 }}>
<View style = {{ flex: 0.03 }}></View>
<View style = { socialmediarow }>
<View style = { [LogoContainer, { backgroundColor: this.props.color, flex: 1 }] }>
<TouchableOpacity
onPress = { () => {
Alert.alert("Coming Soon");
// Actions.PostShow({ title: 'Linkedin', uri: 'https://www.linkedin.com/'})
} }>
onPress = { () => { openAppOrWebsite("linkedin", "profile", linkedin, `${firstName} has not added their Linkedin profile yet.`) } }>
<Ionicons name = "logo-linkedin" size = { dimension.height * 0.045 } color = 'white' />
</TouchableOpacity>
</View>
<View style = {{ flex: 0.01 }}></View>
<View style = { [LogoContainer, { backgroundColor: this.props.color, flex: 1 }] }>
<TouchableOpacity
onPress = { () => {
Alert.alert("Coming Soon");
// Actions.PostShow({ title: 'Github', uri: 'https://www.github.com/'})
} } >
onPress = { () => { openAppOrWebsite("email", "", email, `${firstName}'s email is not set.`) } } >
<Ionicons name = "ios-mail" size = { dimension.height * 0.045 } color = 'white' />
</TouchableOpacity>
</View>
Expand Down Expand Up @@ -259,7 +251,8 @@ const mapStateToProps = ({ members, general, user }) => {
quote,
color,
flag,
paidMember
paidMember,
linkedin
} = members;
const {
loading
Expand All @@ -280,10 +273,11 @@ const mapStateToProps = ({ members, general, user }) => {
activeUser,
color,
flag,
paidMember
paidMember,
linkedin
};
};

const mapDispatchToProps = {};

export default connect(mapStateToProps, mapDispatchToProps)(OtherProfile);
export default connect(mapStateToProps, mapDispatchToProps)(OtherProfile);
Loading