From e09f37e73b45a58c0a6ebf8ad8b5216c91713f26 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Mon, 24 May 2021 14:03:32 -0700 Subject: Fix yarn lint issues --- src/components/comments/AddComment.tsx | 5 ++--- src/components/common/FriendsButton.tsx | 8 +++----- src/components/profile/Content.tsx | 8 +++----- src/components/profile/ProfileBody.tsx | 8 ++------ src/components/profile/PublicProfile.tsx | 5 ++--- 5 files changed, 12 insertions(+), 22 deletions(-) (limited to 'src/components') diff --git a/src/components/comments/AddComment.tsx b/src/components/comments/AddComment.tsx index befaa8fe..b229d010 100644 --- a/src/components/comments/AddComment.tsx +++ b/src/components/comments/AddComment.tsx @@ -27,9 +27,8 @@ export interface AddCommentProps { } const AddComment: React.FC = ({momentId, placeholderText}) => { - const {setShouldUpdateAllComments, commentTapped} = useContext( - CommentContext, - ); + const {setShouldUpdateAllComments, commentTapped} = + useContext(CommentContext); const [inReplyToMention, setInReplyToMention] = useState(''); const [comment, setComment] = useState(''); const [keyboardVisible, setKeyboardVisible] = useState(false); diff --git a/src/components/common/FriendsButton.tsx b/src/components/common/FriendsButton.tsx index ae901229..e7a1f8c7 100644 --- a/src/components/common/FriendsButton.tsx +++ b/src/components/common/FriendsButton.tsx @@ -31,11 +31,9 @@ const FriendsButton: React.FC = ({ }) => { const dispatch = useDispatch(); - const { - user = NO_USER, - profile = NO_PROFILE, - } = useSelector((state: RootState) => - userXId ? state.userX[screenType][userXId] : state.user, + const {user = NO_USER, profile = NO_PROFILE} = useSelector( + (state: RootState) => + userXId ? state.userX[screenType][userXId] : state.user, ); const {user: loggedInUser = NO_USER} = useSelector( diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx index 8298dc9a..2d1002dd 100644 --- a/src/components/profile/Content.tsx +++ b/src/components/profile/Content.tsx @@ -38,11 +38,9 @@ interface ContentProps { } const Content: React.FC = ({userXId, screenType}) => { const dispatch = useDispatch(); - const { - user = NO_USER, - profile = NO_PROFILE, - } = useSelector((state: RootState) => - userXId ? state.userX[screenType][userXId] : state.user, + const {user = NO_USER, profile = NO_PROFILE} = useSelector( + (state: RootState) => + userXId ? state.userX[screenType][userXId] : state.user, ); const {blockedUsers = EMPTY_PROFILE_PREVIEW_LIST} = useSelector( (state: RootState) => state.blocked, diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index 7557de00..8743acfb 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -42,12 +42,8 @@ const ProfileBody: React.FC = ({ userXId ? state.userX[screenType][userXId] : state.user, ); - const { - biography, - website, - friendship_status, - friendship_requester_id, - } = profile; + const {biography, website, friendship_status, friendship_requester_id} = + profile; const {id, username, first_name, last_name} = getUserAsProfilePreviewType( user, diff --git a/src/components/profile/PublicProfile.tsx b/src/components/profile/PublicProfile.tsx index b8920351..8a80c56f 100644 --- a/src/components/profile/PublicProfile.tsx +++ b/src/components/profile/PublicProfile.tsx @@ -55,9 +55,8 @@ const PublicProfile: React.FC = ({ const [isStageTwoPromptClosed, setIsStageTwoPromptClosed] = useState(false); const [isStageOnePromptClosed, setIsStageOnePromptClosed] = useState(false); - const [isStageThreePromptClosed, setIsStageThreePromptClosed] = useState( - false, - ); + const [isStageThreePromptClosed, setIsStageThreePromptClosed] = + useState(false); const move = (direction: 'up' | 'down', title: string) => { let categories = [...momentCategories]; -- cgit v1.2.3-70-g09d2 From b8958cda3485af46181e8a6091f12718acfb621c Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Mon, 24 May 2021 14:04:02 -0700 Subject: Fix tag lint issues --- src/components/moments/TagFriendsFoooter.tsx | 35 ++++++++++++++++------------ src/screens/moments/TagFriendsScreen.tsx | 3 ++- src/screens/profile/CaptionScreen.tsx | 35 +++++++++++++--------------- src/screens/profile/IndividualMoment.tsx | 5 +--- 4 files changed, 39 insertions(+), 39 deletions(-) (limited to 'src/components') diff --git a/src/components/moments/TagFriendsFoooter.tsx b/src/components/moments/TagFriendsFoooter.tsx index 6b8fc62a..7b109877 100644 --- a/src/components/moments/TagFriendsFoooter.tsx +++ b/src/components/moments/TagFriendsFoooter.tsx @@ -27,29 +27,23 @@ const TagFriendsFooter: React.FC = ({ selectedUsers: taggedUsers, }) } - style={{ - flexDirection: 'column', - alignItems: 'center', - }}> + style={styles.tagMoreContainer}> - {'Tagg More'} + {'Tagg More'} ); const TaggedUser = (user: ProfilePreviewType) => ( - + handleRemoveTag(user)}> = ({ */ const TagFriendsTitle = () => ( navigation.navigate('TagSelectionScreen', { @@ -112,7 +104,7 @@ const styles = StyleSheet.create({ flexWrap: 'wrap', justifyContent: 'flex-start', }, - taggMoreLabel: { + tagMoreLabel: { fontWeight: '500', fontSize: normalize(9), lineHeight: normalize(10), @@ -127,6 +119,19 @@ const styles = StyleSheet.create({ right: -20, zIndex: 1, }, + tagMoreContainer: { + flexDirection: 'column', + alignItems: 'center', + }, + tagMoreIcon: {width: 38, height: 38, top: -2}, + taggedUserContainer: {flexDirection: 'row-reverse'}, + closeIcon: { + width: 20, + height: 20, + }, + tagFriendsTitleContainer: { + flexDirection: 'row', + }, }); export default TagFriendsFooter; diff --git a/src/screens/moments/TagFriendsScreen.tsx b/src/screens/moments/TagFriendsScreen.tsx index e6a9f5fb..b0722efc 100644 --- a/src/screens/moments/TagFriendsScreen.tsx +++ b/src/screens/moments/TagFriendsScreen.tsx @@ -99,7 +99,7 @@ const TagFriendsScreen: React.FC = ({route}) => { } /> )} - + = ({route, navigation}) => { selectedUsers: taggedUsers, }) } - style={{ - marginHorizontal: '5%', - marginTop: '3%', - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - }}> + style={styles.tagFriendsContainer}> Tag Friends - + {taggedList} {taggedList.length > 21 ? '. . .' : ''} @@ -255,9 +240,21 @@ const styles = StyleSheet.create({ fontWeight: '600', }, tagFriendsContainer: { - flexDirection: 'row', + marginHorizontal: '5%', marginTop: '3%', + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + }, + taggedListContainer: { + color: 'white', + width: 150, + fontSize: normalize(10), + lineHeight: normalize(11), + letterSpacing: normalize(0.3), + textAlign: 'right', }, + tagIcon: {width: 20, height: 20}, }); export default CaptionScreen; diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index 4baca5b2..515cbacf 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -1,17 +1,14 @@ -import AsyncStorage from '@react-native-community/async-storage'; import {BlurView} from '@react-native-community/blur'; import {RouteProp} from '@react-navigation/native'; import {StackNavigationProp} from '@react-navigation/stack'; import React from 'react'; -import {Alert, FlatList, StyleSheet, View} from 'react-native'; +import {FlatList, StyleSheet, View} from 'react-native'; import {useSelector} from 'react-redux'; import { IndividualMomentTitleBar, MomentPostContent, MomentPostHeader, } from '../../components'; -import {MOMENT_TAGS_ENDPOINT} from '../../constants'; -import {ERROR_SOMETHING_WENT_WRONG_REFRESH} from '../../constants/strings'; import {MainStackParams} from '../../routes'; import {RootState} from '../../store/rootreducer'; import {MomentType} from '../../types'; -- cgit v1.2.3-70-g09d2