aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/moments/CaptionScreenHeader.tsx7
-rw-r--r--src/components/moments/IndividualMomentTitleBar.tsx8
-rw-r--r--src/components/moments/Moment.tsx1
-rw-r--r--src/components/profile/Friends.tsx78
-rw-r--r--src/screens/main/NotificationsScreen.tsx1
-rw-r--r--src/screens/onboarding/OnboardingStepTwo.tsx2
-rw-r--r--src/screens/onboarding/RegistrationTwo.tsx2
-rw-r--r--src/screens/profile/CaptionScreen.tsx6
-rw-r--r--src/screens/profile/InviteFriendsScreen.tsx16
9 files changed, 62 insertions, 59 deletions
diff --git a/src/components/moments/CaptionScreenHeader.tsx b/src/components/moments/CaptionScreenHeader.tsx
index 46dfddfe..0638c128 100644
--- a/src/components/moments/CaptionScreenHeader.tsx
+++ b/src/components/moments/CaptionScreenHeader.tsx
@@ -21,18 +21,15 @@ const styles = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
- height: '5%',
},
headerContainer: {
- position: 'absolute',
- left: '50%',
+ width: '90%',
},
header: {
- position: 'relative',
- right: '50%',
fontSize: 20,
fontWeight: 'bold',
color: 'white',
+ textAlign: 'center',
},
});
export default CaptionScreenHeader;
diff --git a/src/components/moments/IndividualMomentTitleBar.tsx b/src/components/moments/IndividualMomentTitleBar.tsx
index 6cdfe0e8..88e0c308 100644
--- a/src/components/moments/IndividualMomentTitleBar.tsx
+++ b/src/components/moments/IndividualMomentTitleBar.tsx
@@ -18,7 +18,9 @@ const IndividualMomentTitleBar: React.FC<IndividualMomentTitleBarProps> = ({
<TouchableOpacity style={styles.closeButton} onPress={close}>
<CloseIcon height={'100%'} width={'100%'} color={'white'} />
</TouchableOpacity>
- <Text style={styles.header}>{title}</Text>
+ <View style={styles.headerContainer}>
+ <Text style={styles.header}>{title}</Text>
+ </View>
</View>
);
};
@@ -30,6 +32,10 @@ const styles = StyleSheet.create({
justifyContent: 'center',
height: '5%',
},
+ headerContainer: {
+ flexShrink: 1,
+ marginLeft: '11%',
+ },
header: {
color: 'white',
fontSize: normalize(18),
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx
index 10cf6070..e972a1ca 100644
--- a/src/components/moments/Moment.tsx
+++ b/src/components/moments/Moment.tsx
@@ -171,6 +171,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
titleText: {
+ width: '80%',
fontSize: normalize(16),
fontWeight: 'bold',
color: TAGG_LIGHT_BLUE,
diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx
index d87b0fb0..ac724ae0 100644
--- a/src/components/profile/Friends.tsx
+++ b/src/components/profile/Friends.tsx
@@ -26,12 +26,10 @@ interface FriendsProps {
}
const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
+ const state: RootState = useStore().getState();
const dispatch = useDispatch();
+ const {user: loggedInUser = NO_USER} = state;
const navigation = useNavigation();
- const {user: loggedInUser = NO_USER} = useSelector(
- (state: RootState) => state.user,
- );
- const state = useStore().getState();
const [usersFromContacts, setUsersFromContacts] = useState<
ProfilePreviewType[]
>([]);
@@ -65,7 +63,6 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
<TouchableOpacity
style={styles.addFriendButton}
onPress={() => {
- console.log('screentype: ', screenType);
handleAddFriend(screenType, profilePreview, dispatch, state).then(
(success) => {
if (success) {
@@ -88,42 +85,41 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
return (
<>
- {loggedInUser.userId === userId ||
- (userId === undefined && (
- <View style={styles.subheader}>
- <View style={styles.addFriendHeaderContainer}>
- <Text style={[styles.subheaderText]}>Add Friends</Text>
- <TouchableOpacity
- style={styles.findFriendsButton}
- onPress={async () => {
- const permission = await checkPermission();
- if (permission === 'authorized') {
- navigation.navigate('InviteFriendsScreen', {
- screenType: ScreenType.Profile,
- });
- } else {
- Alert.alert(
- '"Tagg" Would Like to Access Your Contacts',
- 'This helps you quickly get in touch with friends on the app and more',
- [
- {
- text: "Don't Allow",
- style: 'cancel',
- },
- {text: 'Allow', onPress: () => Linking.openSettings()},
- ],
- );
- }
- }}>
- <FindFriendsBlueIcon width={20} height={20} />
- <Text style={styles.findFriendsSubheaderText}>
- Find Friends
- </Text>
- </TouchableOpacity>
- </View>
- <UsersFromContacts />
+ {loggedInUser.userId === userId && (
+ <View style={styles.subheader}>
+ <View style={styles.addFriendHeaderContainer}>
+ <Text style={[styles.subheaderText]}>Add Friends</Text>
+ <TouchableOpacity
+ style={styles.findFriendsButton}
+ onPress={async () => {
+ const permission = await checkPermission();
+ if (permission === 'authorized') {
+ navigation.navigate('InviteFriendsScreen', {
+ screenType: ScreenType.Profile,
+ });
+ } else {
+ Alert.alert(
+ '"Tagg" Would Like to Access Your Contacts',
+ 'This helps you quickly get in touch with friends on the app and more',
+ [
+ {
+ text: "Don't Allow",
+ style: 'cancel',
+ },
+ {text: 'Allow', onPress: () => Linking.openSettings()},
+ ],
+ );
+ }
+ }}>
+ <FindFriendsBlueIcon width={20} height={20} />
+ <Text style={styles.findFriendsSubheaderText}>
+ Invite Friends
+ </Text>
+ </TouchableOpacity>
</View>
- ))}
+ <UsersFromContacts />
+ </View>
+ )}
<Text style={[styles.subheaderText, styles.friendsSubheaderText]}>
Friends
</Text>
@@ -141,7 +137,7 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
screenType={screenType}
/>
</View>
- {loggedInUser.userId !== userId && (
+ {loggedInUser.userId === userId && (
<TouchableOpacity
style={styles.unfriendButton}
onPress={() =>
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx
index 501c44fc..57dea6f5 100644
--- a/src/screens/main/NotificationsScreen.tsx
+++ b/src/screens/main/NotificationsScreen.tsx
@@ -285,6 +285,7 @@ const NotificationsScreen: React.FC = () => {
</View>
<SectionList
contentContainerStyle={styles.container}
+ stickySectionHeadersEnabled={false}
sections={sectionedNotifications}
keyExtractor={(_item, index) => index.toString()}
renderItem={renderNotification}
diff --git a/src/screens/onboarding/OnboardingStepTwo.tsx b/src/screens/onboarding/OnboardingStepTwo.tsx
index 93342c3f..1014981d 100644
--- a/src/screens/onboarding/OnboardingStepTwo.tsx
+++ b/src/screens/onboarding/OnboardingStepTwo.tsx
@@ -247,7 +247,7 @@ const OnboardingStepTwo: React.FC<OnboardingStepTwoProps> = ({
<TaggInput
accessibilityHint="Enter your email."
accessibilityLabel="Email input field."
- placeholder="Email"
+ placeholder="School Email"
autoCompleteType="email"
textContentType="emailAddress"
autoCapitalize="none"
diff --git a/src/screens/onboarding/RegistrationTwo.tsx b/src/screens/onboarding/RegistrationTwo.tsx
index 707e621a..6d7b2226 100644
--- a/src/screens/onboarding/RegistrationTwo.tsx
+++ b/src/screens/onboarding/RegistrationTwo.tsx
@@ -214,7 +214,7 @@ const RegistrationTwo: React.FC<RegistrationTwoProps> = ({
<TaggInput
accessibilityHint="Enter your email."
accessibilityLabel="Email input field."
- placeholder="Email"
+ placeholder="School Email"
autoCompleteType="email"
textContentType="emailAddress"
autoCapitalize="none"
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx
index 01e859ba..998897e2 100644
--- a/src/screens/profile/CaptionScreen.tsx
+++ b/src/screens/profile/CaptionScreen.tsx
@@ -152,10 +152,8 @@ const styles = StyleSheet.create({
position: 'relative',
backgroundColor: 'white',
width: '100%',
- paddingLeft: '2%',
- paddingRight: '2%',
- paddingBottom: '1%',
- paddingTop: '1%',
+ paddingHorizontal: '2%',
+ paddingVertical: '1%',
height: 60,
},
});
diff --git a/src/screens/profile/InviteFriendsScreen.tsx b/src/screens/profile/InviteFriendsScreen.tsx
index d1142b7f..36aa8ada 100644
--- a/src/screens/profile/InviteFriendsScreen.tsx
+++ b/src/screens/profile/InviteFriendsScreen.tsx
@@ -31,15 +31,21 @@ import Animated from 'react-native-reanimated';
import Icon from 'react-native-vector-icons/Feather';
import {InviteFriendTile} from '../../components/friends';
import {TAGG_LIGHT_BLUE} from '../../constants';
+import {MainStackParams} from '../../routes';
+import {RouteProp} from '@react-navigation/native';
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
+type InviteFriendsScreenRouteProp = RouteProp<
+ MainStackParams,
+ 'InviteFriendsScreen'
+>;
+
interface InviteFriendsScreenProps {
- screenType: ScreenType;
+ route: InviteFriendsScreenRouteProp;
}
-const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({
- screenType,
-}) => {
+const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({route}) => {
+ const {screenType} = route.params;
const dispatch = useDispatch();
const state = useStore().getState();
const [usersFromContacts, setUsersFromContacts] = useState<
@@ -64,7 +70,6 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({
let response = await usersFromContactsService(retrievedContacts);
await setUsersFromContacts(response.existing_tagg_users);
await setNonUsersFromContacts(response.invite_from_contacts);
- usersFromContacts.map((user) => console.log('user: ', user.username));
setResults({
usersFromContacts: response.existing_tagg_users,
nonUsersFromContacts: response.invite_from_contacts,
@@ -81,7 +86,6 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({
* Main handler for changes in query.
*/
useEffect(() => {
- console.log('query is now ', query);
const search = async () => {
if (query.length > 0) {
const searchResultsUsers = usersFromContacts.filter(