aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-07 13:14:36 -0400
committerIvan Chen <ivan@tagg.id>2021-04-07 13:14:36 -0400
commitf36ce8993d45ed69845a2ff6340f4d52d03855d9 (patch)
tree2c2acec3adfeda204c0b48eb7c7b22a7802780eb /src/screens
parent4b0e55cd751bd77e05b8158177a74bd190974218 (diff)
parenta3abb3abe322ea84306e1a12cec46972a81a37de (diff)
Merge branch 'master' into chat-poc
# Conflicts: # src/components/profile/Content.tsx # src/components/taggs/TaggsBar.tsx # src/screens/profile/ProfileScreen.tsx # src/types/types.ts
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/profile/IndividualMoment.tsx14
-rw-r--r--src/screens/profile/InviteFriendsScreen.tsx2
-rw-r--r--src/screens/profile/MomentUploadPromptScreen.tsx20
-rw-r--r--src/screens/profile/ProfileScreen.tsx24
4 files changed, 20 insertions, 40 deletions
diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx
index 8c1dc327..871d62bf 100644
--- a/src/screens/profile/IndividualMoment.tsx
+++ b/src/screens/profile/IndividualMoment.tsx
@@ -27,7 +27,7 @@ interface IndividualMomentProps {
navigation: IndividualMomentNavigationProp;
}
-const ITEM_HEIGHT = SCREEN_HEIGHT * (9 / 10);
+const ITEM_HEIGHT = SCREEN_HEIGHT * 0.9;
const IndividualMoment: React.FC<IndividualMomentProps> = ({
route,
@@ -40,13 +40,13 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({
);
const {
user: {username},
- } = userXId
- ? useSelector((state: RootState) => state.userX[screenType][userXId])
- : useSelector((state: RootState) => state.user);
+ } = useSelector((state: RootState) =>
+ userXId ? state.userX[screenType][userXId] : state.user,
+ );
- const {moments} = userXId
- ? useSelector((state: RootState) => state.userX[screenType][userXId])
- : useSelector((state: RootState) => state.moments);
+ const {moments} = useSelector((state: RootState) =>
+ userXId ? state.userX[screenType][userXId] : state.moments,
+ );
const isOwnProfile = username === loggedInUsername;
const momentData = moments.filter(
diff --git a/src/screens/profile/InviteFriendsScreen.tsx b/src/screens/profile/InviteFriendsScreen.tsx
index a9fa1404..ad9e382e 100644
--- a/src/screens/profile/InviteFriendsScreen.tsx
+++ b/src/screens/profile/InviteFriendsScreen.tsx
@@ -203,7 +203,7 @@ const InviteFriendsScreen: React.FC<InviteFriendsScreenProps> = ({route}) => {
</Animated.View>
</View>
<View style={styles.subheader}>
- <Text style={styles.subheaderText}>Contacts on tagg</Text>
+ <Text style={styles.subheaderText}>Contacts on Tagg</Text>
<UsersFromContacts />
</View>
<View style={styles.subheader}>
diff --git a/src/screens/profile/MomentUploadPromptScreen.tsx b/src/screens/profile/MomentUploadPromptScreen.tsx
index f79c81b4..f0aaffc4 100644
--- a/src/screens/profile/MomentUploadPromptScreen.tsx
+++ b/src/screens/profile/MomentUploadPromptScreen.tsx
@@ -8,7 +8,7 @@ import {Moment} from '../../components';
import {Image} from 'react-native-animatable';
import {UPLOAD_MOMENT_PROMPT_ONE_MESSAGE} from '../../constants/strings';
import {PROFILE_CUTOUT_BOTTOM_Y} from '../../constants';
-import {isIPhoneX, normalize} from '../../utils';
+import {normalize} from '../../utils';
type MomentUploadPromptScreenRouteProp = RouteProp<
MainStackParams,
@@ -28,7 +28,12 @@ const MomentUploadPromptScreen: React.FC<MomentUploadPromptScreenProps> = ({
route,
navigation,
}) => {
- const {screenType, momentCategory, profileBodyHeight} = route.params;
+ const {
+ screenType,
+ momentCategory,
+ profileBodyHeight,
+ socialsBarHeight,
+ } = route.params;
return (
<View style={styles.container}>
<CloseIcon
@@ -61,9 +66,7 @@ const MomentUploadPromptScreen: React.FC<MomentUploadPromptScreenProps> = ({
externalStyles={{
container: {
...styles.momentContainer,
- top: isIPhoneX()
- ? profileBodyHeight + 615
- : profileBodyHeight + 500,
+ top: PROFILE_CUTOUT_BOTTOM_Y + profileBodyHeight + socialsBarHeight,
},
titleText: styles.momentHeaderText,
header: styles.momentHeader,
@@ -103,20 +106,21 @@ const styles = StyleSheet.create({
//Styles to adjust moment container
momentScrollContainer: {
backgroundColor: 'transparent',
+ marginTop: 10,
},
momentContainer: {
...StyleSheet.absoluteFillObject,
backgroundColor: 'transparent',
- height: 170,
+ height: 175,
},
momentHeaderText: {
...StyleSheet.absoluteFillObject,
marginLeft: 12,
- marginTop: 10,
+ paddingVertical: 5,
},
momentHeader: {
+ marginTop: 7,
backgroundColor: 'transparent',
- paddingVertical: 20,
},
});
diff --git a/src/screens/profile/ProfileScreen.tsx b/src/screens/profile/ProfileScreen.tsx
index a5d1e495..6d9ef020 100644
--- a/src/screens/profile/ProfileScreen.tsx
+++ b/src/screens/profile/ProfileScreen.tsx
@@ -4,11 +4,6 @@ import {Content, TabsGradient} from '../../components';
import {RouteProp} from '@react-navigation/native';
import {MainStackParams} from '../../routes/';
-/**r
- * Profile Screen for a user's profile
- * including posts, messaging, and settings
- */
-
type ProfileScreenRouteProps = RouteProp<MainStackParams, 'Profile'>;
interface ProfileOnboardingProps {
@@ -19,25 +14,6 @@ const ProfileScreen: React.FC<ProfileOnboardingProps> = ({route}) => {
const {screenType} = route.params;
let {userXId} = route.params;
- /**
- * This is a double safety check to avoid app crash.
- * Checks if the required userXId is present in the store, if not userXId is set to dummy id
- */
- // if (userXId && !(userXId in useStore().getState().userX[screenType])) {
- // userXId = DUMMY_USERID;
- // }
-
- /**
- * Code under useFocusEffect gets executed every time the screen comes under focus / is being viewed by the user.
- * This is done to reset the users stored in our store for the Search screen.
- * Read more about useFocusEffect here : https://reactnavigation.org/docs/function-after-focusing-screen/
- */
- // useFocusEffect(() => {
- // if (!userXId) {
- // dispatch(resetScreenType(screenType));
- // }
- // });
-
return (
<>
<StatusBar barStyle="dark-content" />