From 0c029f2f801330da227d62858975823cff16978e Mon Sep 17 00:00:00 2001 From: George Rusu Date: Mon, 21 Jun 2021 19:18:25 -0700 Subject: Add new type --- src/constants/api.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/constants') diff --git a/src/constants/api.ts b/src/constants/api.ts index b55489d9..6dab1153 100644 --- a/src/constants/api.ts +++ b/src/constants/api.ts @@ -38,6 +38,7 @@ export const VERIFY_INVITATION_CODE_ENDPOUNT: string = API_URL + 'verify-code/'; export const COMMENTS_ENDPOINT: string = API_URL + 'comments/'; export const COMMENT_REACTIONS_ENDPOINT: string = API_URL + 'reaction-comment/'; export const COMMENT_REACTIONS_REPLY_ENDPOINT: string = API_URL + 'reaction-reply/'; +export const PRESIGNED_URL_ENDPOINT: string = API_URL + 'presigned-url/'; export const FRIENDS_ENDPOINT: string = API_URL + 'friends/'; export const ALL_USERS_ENDPOINT: string = API_URL + 'users/'; export const REPORT_ISSUE_ENDPOINT: string = API_URL + 'report/'; -- cgit v1.2.3-70-g09d2 From 4ecc4525738dc8a56c9f37a05d0870e54cfa5be9 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 22 Jun 2021 19:21:26 -0400 Subject: Lint --- src/components/profile/ProfileBody.tsx | 2 -- src/constants/regex.ts | 2 +- src/screens/profile/IndividualMoment.tsx | 1 - src/services/MomentService.ts | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) (limited to 'src/constants') diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index 048de696..cc001516 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -1,7 +1,5 @@ import React from 'react'; import {LayoutChangeEvent, Linking, StyleSheet, Text, View} from 'react-native'; -import {TouchableOpacity} from 'react-native-gesture-handler'; -import {launchCamera} from 'react-native-image-picker'; import {useDispatch, useSelector, useStore} from 'react-redux'; import {TAGG_DARK_BLUE, TOGGLE_BUTTON_TYPE} from '../../constants'; import { diff --git a/src/constants/regex.ts b/src/constants/regex.ts index f934185d..61523203 100644 --- a/src/constants/regex.ts +++ b/src/constants/regex.ts @@ -36,7 +36,7 @@ export const nameRegex: RegExp = /^[A-Za-z'\-,. ]{2,20}$/; * - match alphanumerics, and special characters used in URLs */ export const websiteRegex: RegExp = - /^$|^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,50}\.[a-zA-Z0-9()]{2,6}\b([-a-zA-Z0-9()@:%_+.~#?&\/=]{0,35})$/; + /^$|^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,50}\.[a-zA-Z0-9()]{2,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]{0,35})$/; /** * The website regex has the following constraints diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index cc176cd3..f8113aba 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -9,7 +9,6 @@ import {AVATAR_DIM} from '../../constants'; import {MainStackParams} from '../../routes'; import {RootState} from '../../store/rootreducer'; import {MomentPostType} from '../../types'; -import Video from 'react-native-video'; import { isIPhoneX, normalize, diff --git a/src/services/MomentService.ts b/src/services/MomentService.ts index da6f9690..da1bfb97 100644 --- a/src/services/MomentService.ts +++ b/src/services/MomentService.ts @@ -1,5 +1,4 @@ import AsyncStorage from '@react-native-community/async-storage'; -import {Image, Video} from 'react-native-image-crop-picker'; import RNFetchBlob from 'rn-fetch-blob'; import { MOMENTS_ENDPOINT, -- cgit v1.2.3-70-g09d2 From 63bef47bffd2893f3013a02f71383c9c0a27881f Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Thu, 24 Jun 2021 18:20:15 -0400 Subject: Fix moment comment count, Add video support --- src/components/comments/CommentsCount.tsx | 15 ++++++---- src/components/moments/MomentPost.tsx | 47 ++++++++++++++++++++++--------- src/constants/strings.ts | 2 +- src/screens/moments/TagFriendsScreen.tsx | 6 ---- 4 files changed, 45 insertions(+), 25 deletions(-) (limited to 'src/constants') diff --git a/src/components/comments/CommentsCount.tsx b/src/components/comments/CommentsCount.tsx index 90514193..d4a93bdd 100644 --- a/src/components/comments/CommentsCount.tsx +++ b/src/components/comments/CommentsCount.tsx @@ -3,27 +3,32 @@ import React from 'react'; import {StyleSheet, Text} from 'react-native'; import {TouchableOpacity} from 'react-native-gesture-handler'; import CommentsIcon from '../../assets/icons/moment-comment-icon.svg'; -import {MomentPostType, ScreenType} from '../../types'; +import {ScreenType} from '../../types'; import {normalize} from '../../utils'; interface CommentsCountProps { - moment: MomentPostType; + momentId: string; + count: number; screenType: ScreenType; } -const CommentsCount: React.FC = ({moment, screenType}) => { +const CommentsCount: React.FC = ({ + momentId, + count, + screenType, +}) => { const navigation = useNavigation(); return ( navigation.navigate('MomentCommentsScreen', { - moment_id: moment.moment_id, + moment_id: momentId, screenType, }) }> - {moment.comments_count} + {count} ); }; diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index 6eccf5ab..f030c41e 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -12,6 +12,7 @@ import { View, } from 'react-native'; import Animated, {EasingNode} from 'react-native-reanimated'; +import Video from 'react-native-video'; import {useDispatch, useSelector, useStore} from 'react-redux'; import {headerBarOptions} from '../../routes'; import {MomentContext} from '../../screens/profile/IndividualMoment'; @@ -72,6 +73,12 @@ const MomentPost: React.FC = ({ const imageRef = useRef(null); const {keyboardVisible} = useContext(MomentContext); + const isVideo = !( + moment.moment_url.endsWith('jpg') || + moment.moment_url.endsWith('JPG') || + moment.moment_url.endsWith('PNG') || + moment.moment_url.endsWith('png') + ); /* * Load tags on initial render to pass tags data to moment header and content @@ -178,17 +185,26 @@ const MomentPost: React.FC = ({ - + {isVideo ? ( + + + ) : ( + + )} {visible && ( @@ -233,7 +249,11 @@ const MomentPost: React.FC = ({ /> )} - + {!hideText && ( @@ -281,8 +301,9 @@ const MomentPost: React.FC = ({ }; const styles = StyleSheet.create({ - image: { + media: { zIndex: 0, + flex: 1, }, imageContainer: { height: SCREEN_HEIGHT, diff --git a/src/constants/strings.ts b/src/constants/strings.ts index a1064f49..112bc546 100644 --- a/src/constants/strings.ts +++ b/src/constants/strings.ts @@ -77,7 +77,7 @@ You've been tagged by ${invitee}. Follow the instructions below to skip the line Sign up and use this code to get in: ${inviteCode}\n ${APP_STORE_LINK}`; export const SUCCESS_LAST_CONTACT_INVITE = 'Done! That was your last invite, hope you used it wisely!'; export const SUCCESS_LINK = (str: string) => `Successfully linked ${str} 🎉`; -export const SUCCESS_PIC_UPLOAD = 'Beautiful, the picture was uploaded successfully!'; +export const SUCCESS_PIC_UPLOAD = 'Beautiful, the Moment was uploaded successfully!'; export const SUCCESS_PWD_RESET = 'Your password was reset successfully!'; export const SUCCESS_VERIFICATION_CODE_SENT = 'New verification code sent! Check your phone messages for your code'; export const UP_TO_DATE = 'Up-to-Date!'; diff --git a/src/screens/moments/TagFriendsScreen.tsx b/src/screens/moments/TagFriendsScreen.tsx index db7456bc..69118660 100644 --- a/src/screens/moments/TagFriendsScreen.tsx +++ b/src/screens/moments/TagFriendsScreen.tsx @@ -108,12 +108,6 @@ const TagFriendsScreen: React.FC = ({route}) => { /> ) : ( - //