From 2360e774d94e271d1d9db0d5b92b801b9325535e Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Thu, 25 Feb 2021 12:39:31 -0800 Subject: TMA-634-indentation and unused variables removed --- src/components/index.ts | 1 - src/components/taggs/SocialMediaInfo.tsx | 2 +- src/constants/constants.ts | 10 ++++-- src/routes/main/MainStackNavigator.tsx | 2 +- src/routes/tabs/NavigationBar.tsx | 7 ++-- src/screens/badge/BadgeItem.tsx | 1 - src/screens/badge/BadgeList.tsx | 6 ++-- src/screens/badge/BadgeScreenHeader.tsx | 2 +- src/screens/badge/BadgeSelection.tsx | 41 ++++++++++------------ src/screens/badge/index.ts | 4 --- .../onboarding/InvitationCodeVerification.tsx | 5 ++- src/screens/profile/SocialMediaTaggs.tsx | 7 +++- src/services/FCMService.ts | 2 +- src/services/ReportingService.ts | 5 +-- src/store/reducers/userBlockReducer.ts | 5 +-- src/utils/common.ts | 4 ++- 16 files changed, 55 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/components/index.ts b/src/components/index.ts index 0a7c189b..d5649323 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -6,4 +6,3 @@ export * from './taggs'; export * from './comments'; export * from './moments'; export * from './suggestedPeople'; - diff --git a/src/components/taggs/SocialMediaInfo.tsx b/src/components/taggs/SocialMediaInfo.tsx index 46e651f9..f05ad503 100644 --- a/src/components/taggs/SocialMediaInfo.tsx +++ b/src/components/taggs/SocialMediaInfo.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {StyleSheet, Text, View} from 'react-native'; -import { ScreenType } from '../../types'; +import {ScreenType} from '../../types'; import {SocialIcon} from '..'; import {handleOpenSocialUrlOnBrowser} from '../../utils'; diff --git a/src/constants/constants.ts b/src/constants/constants.ts index 99526474..84106df0 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -79,8 +79,14 @@ export const NOTIFICATION_GRADIENT = [ 'rgba(247, 248, 248, 1)', 'rgba(247, 248, 248, 0)', ]; -export const BADGE_GRADIENT_FIRST = ['rgba(86, 63, 51, 1)', 'rgba(236, 32, 39, 1)'] -export const BADGE_GRADIENT_REST = ['rgba(78, 54, 41, 1)', 'rgba(236, 32, 39, 1)'] +export const BADGE_GRADIENT_FIRST = [ + 'rgba(86, 63, 51, 1)', + 'rgba(236, 32, 39, 1)', +]; +export const BADGE_GRADIENT_REST = [ + 'rgba(78, 54, 41, 1)', + 'rgba(236, 32, 39, 1)', +]; export const SOCIAL_FONT_COLORS = { INSTAGRAM: INSTAGRAM_FONT_COLOR, diff --git a/src/routes/main/MainStackNavigator.tsx b/src/routes/main/MainStackNavigator.tsx index 3a8ade4f..4230f4a6 100644 --- a/src/routes/main/MainStackNavigator.tsx +++ b/src/routes/main/MainStackNavigator.tsx @@ -71,7 +71,7 @@ export type MainStackParams = { }; UpdateSPPicture: { goTo: string; - }, + }; Badge: { screenType: ScreenType; }; diff --git a/src/routes/tabs/NavigationBar.tsx b/src/routes/tabs/NavigationBar.tsx index 49713d66..5d4f7cf2 100644 --- a/src/routes/tabs/NavigationBar.tsx +++ b/src/routes/tabs/NavigationBar.tsx @@ -19,9 +19,10 @@ const NavigationBar: React.FC = () => { (state: RootState) => state, ); - const [unreadNotificationsPresent, setUnreadNotificationsPresent] = useState< - boolean - >(false); + const [ + unreadNotificationsPresent, + setUnreadNotificationsPresent, + ] = useState(false); useEffect(() => { const determine = async () => { diff --git a/src/screens/badge/BadgeItem.tsx b/src/screens/badge/BadgeItem.tsx index ec47d7b5..d7c0b74a 100644 --- a/src/screens/badge/BadgeItem.tsx +++ b/src/screens/badge/BadgeItem.tsx @@ -1,6 +1,5 @@ import React from 'react'; import {View, Text, StyleSheet, Image, ImageSourcePropType} from 'react-native'; -import {Background} from '../../components'; import {SCREEN_WIDTH, normalize} from '../../utils'; import LinearGradient from 'react-native-linear-gradient'; import {BADGE_GRADIENT_FIRST, BADGE_GRADIENT_REST} from '../../constants'; diff --git a/src/screens/badge/BadgeList.tsx b/src/screens/badge/BadgeList.tsx index 39d0a948..93932123 100644 --- a/src/screens/badge/BadgeList.tsx +++ b/src/screens/badge/BadgeList.tsx @@ -1,5 +1,5 @@ -import React, {useState} from 'react'; -import {StyleSheet, SectionList, ScrollView, View} from 'react-native'; +import React from 'react'; +import {StyleSheet, SectionList, ScrollView} from 'react-native'; import BadgeItem from './BadgeItem'; import BadgeHeader from './BadgeListHeader'; import {SCREEN_HEIGHT} from '../../utils'; @@ -18,7 +18,7 @@ const BadgeList: React.FC = ({ return ( item + index} diff --git a/src/screens/badge/BadgeScreenHeader.tsx b/src/screens/badge/BadgeScreenHeader.tsx index 7f722e28..8996282a 100644 --- a/src/screens/badge/BadgeScreenHeader.tsx +++ b/src/screens/badge/BadgeScreenHeader.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Image, StyleSheet, Text, View} from 'react-native'; -import {SCREEN_WIDTH, SCREEN_HEIGHT, normalize} from '../../utils'; +import {normalize} from '../../utils'; const BadgeScreenHeader: React.FC = () => { return ( diff --git a/src/screens/badge/BadgeSelection.tsx b/src/screens/badge/BadgeSelection.tsx index fa709832..9ed1b08f 100644 --- a/src/screens/badge/BadgeSelection.tsx +++ b/src/screens/badge/BadgeSelection.tsx @@ -1,8 +1,7 @@ import React, {useEffect, useState} from 'react'; import {StatusBar, SafeAreaView, View, StyleSheet} from 'react-native'; import {BackgroundGradientType} from '../../types'; -import {Background} from '../../components'; -import {StatusBarHeight, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; +import {StatusBarHeight, SCREEN_HEIGHT} from '../../utils'; import LinearGradient from 'react-native-linear-gradient'; import {BACKGROUND_GRADIENT_MAP} from '../../constants'; import BadgeList from './BadgeList'; @@ -159,34 +158,18 @@ const BadgeSelection: React.FC = ({navigation}) => { navigation.setOptions({ headerRight: () => ( { if (canSubmit) { uploadUserSelection(); } }}> - - {canSubmit ? 'Done' : 'Skip'} - + {canSubmit ? 'Done' : 'Skip'} ), headerLeft: () => ( - - - Cancel - + + Cancel ), }); @@ -269,6 +252,20 @@ const styles = StyleSheet.create({ }, viewContainer: {marginTop: StatusBarHeight}, listContainer: {marginTop: SCREEN_HEIGHT * 0.05}, + rightButtonContainer: {marginRight: 24}, + rightButton: { + color: '#FFFFFF', + fontWeight: 'bold', + fontSize: 15, + lineHeight: 18, + }, + leftButtonContainer: {marginLeft: 24}, + leftButton: { + color: '#FFFFFF', + fontWeight: '500', + fontSize: 15, + lineHeight: 18, + }, }); export default BadgeSelection; diff --git a/src/screens/badge/index.ts b/src/screens/badge/index.ts index f6b20b83..217aa7e8 100644 --- a/src/screens/badge/index.ts +++ b/src/screens/badge/index.ts @@ -3,7 +3,3 @@ export {default as BadgeItem} from './BadgeItem'; export {default as BadgeListHeader} from './BadgeListHeader'; export {default as BadgeList} from './BadgeList'; export {default as BadgeScreenHeader} from './BadgeScreenHeader'; - - - - diff --git a/src/screens/onboarding/InvitationCodeVerification.tsx b/src/screens/onboarding/InvitationCodeVerification.tsx index 903a9912..a0213530 100644 --- a/src/screens/onboarding/InvitationCodeVerification.tsx +++ b/src/screens/onboarding/InvitationCodeVerification.tsx @@ -78,7 +78,10 @@ const InvitationCodeVerification: React.FC = ({ Alert.alert(ERROR_INVALID_INVITATION_CODE); } } catch (error) { - Alert.alert(ERROR_VERIFICATION_FAILED_SHORT, ERROR_DOUBLE_CHECK_CONNECTION); + Alert.alert( + ERROR_VERIFICATION_FAILED_SHORT, + ERROR_DOUBLE_CHECK_CONNECTION, + ); return { name: 'Verification error', description: error, diff --git a/src/screens/profile/SocialMediaTaggs.tsx b/src/screens/profile/SocialMediaTaggs.tsx index 45d417a6..466ba509 100644 --- a/src/screens/profile/SocialMediaTaggs.tsx +++ b/src/screens/profile/SocialMediaTaggs.tsx @@ -12,7 +12,12 @@ import { } from '../../components'; import {AVATAR_GRADIENT} from '../../constants'; import {ProfileStackParams} from '../../routes'; -import {SimplePostType, TwitterPostType, SocialAccountType, ScreenType} from '../../types'; +import { + SimplePostType, + TwitterPostType, + SocialAccountType, + ScreenType, +} from '../../types'; import {AvatarHeaderHeight, SCREEN_HEIGHT} from '../../utils'; import {useSelector} from 'react-redux'; import {RootState} from '../../store/rootReducer'; diff --git a/src/services/FCMService.ts b/src/services/FCMService.ts index b6cd18af..84f30f09 100644 --- a/src/services/FCMService.ts +++ b/src/services/FCMService.ts @@ -134,7 +134,7 @@ class FCMService { // TODO: Get {name, params} of screen when user must be redirected to // Redirected to Notification Screen for now const redirectTo = 'Notifications'; - /* TODO: Check login status and redirect user/store screen to async as + /* TODO: Check login status and redirect user/store screen to async as initialRoute for NavigationBar Stack */ RootNavigation.navigate(redirectTo); } diff --git a/src/services/ReportingService.ts b/src/services/ReportingService.ts index 8c0a4bfb..76883e81 100644 --- a/src/services/ReportingService.ts +++ b/src/services/ReportingService.ts @@ -3,10 +3,7 @@ import {REPORT_ISSUE_ENDPOINT} from '../constants'; import {Alert} from 'react-native'; import AsyncStorage from '@react-native-community/async-storage'; -import { - ERROR_SOMETHING_WENT_WRONG, - MARKED_AS_MSG, -} from '../constants/strings'; +import {ERROR_SOMETHING_WENT_WRONG, MARKED_AS_MSG} from '../constants/strings'; export const sendReport = async ( moment_id: string, diff --git a/src/store/reducers/userBlockReducer.ts b/src/store/reducers/userBlockReducer.ts index 90e4a04a..64bdda30 100644 --- a/src/store/reducers/userBlockReducer.ts +++ b/src/store/reducers/userBlockReducer.ts @@ -11,8 +11,9 @@ const userBlockSlice = createSlice({ updateBlockedList: (state, action) => { const {isBlocked, data} = action.payload; - if (!isBlocked) state.blockedUsers.push(data); - else { + if (!isBlocked) { + state.blockedUsers.push(data); + } else { state.blockedUsers = state.blockedUsers.filter( (user) => user.username != data.username, ); diff --git a/src/utils/common.ts b/src/utils/common.ts index 8efe1f6a..6a8b66d3 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -88,7 +88,9 @@ export const haveUnreadNotifications = async ( continue; } const unread = lastViewed ? lastViewed.diff(notificationDate) < 0 : false; - if (unread) return true; + if (unread) { + return true; + } } return false; }; -- cgit v1.2.3-70-g09d2