From 59f64faa456b7f4852eef3d9281afde8d8f46e9a Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Mon, 29 Mar 2021 14:13:06 -0400 Subject: fix linter warnings --- src/components/profile/PublicProfile.tsx | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/components/profile/PublicProfile.tsx b/src/components/profile/PublicProfile.tsx index a70e8e50..8d597986 100644 --- a/src/components/profile/PublicProfile.tsx +++ b/src/components/profile/PublicProfile.tsx @@ -30,20 +30,20 @@ import {moveCategory, normalize, SCREEN_HEIGHT} from '../../utils'; import {TaggPrompt} from '../common'; import {Moment} from '../moments'; -const PublicProfile: React.FC = ({y, userXId, screenType}) => { +const PublicProfile: React.FC = ({userXId, screenType}) => { const dispatch = useDispatch(); - const {profile = NO_PROFILE} = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.user); + const {profile = NO_PROFILE} = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.user, + ); - const {moments = EMPTY_MOMENTS_LIST} = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.moments); + const {moments = EMPTY_MOMENTS_LIST} = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.moments, + ); - const {momentCategories = []} = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.momentCategories); + const {momentCategories = []} = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.momentCategories, + ); const {user: loggedInUser = NO_USER} = useSelector( (state: RootState) => state.user, @@ -117,10 +117,12 @@ const PublicProfile: React.FC = ({y, userXId, screenType}) => { setTimeout(navigateToMomentUploadPrompt, 2000); } }, [ + userXId, profile.profile_completion_stage, momentCategories, - userXId, isStageOnePromptClosed, + navigation, + screenType, ]), ); @@ -188,7 +190,7 @@ const PublicProfile: React.FC = ({y, userXId, screenType}) => { { setIsStageTwoPromptClosed(true); }} @@ -200,7 +202,7 @@ const PublicProfile: React.FC = ({y, userXId, screenType}) => { { setIsStageThreePromptClosed(true); }} -- cgit v1.2.3-70-g09d2