hiding action panel if not logged in

This commit is contained in:
Nouman Tahir 2021-09-16 13:01:58 +05:00
parent 4745f19f07
commit e0b0040a0c
2 changed files with 7 additions and 2 deletions

View File

@ -12,6 +12,7 @@ interface ActionPanelProps {
} }
export const ActionPanel = ({isFollowing, isFavourite, onFavouritePress, onFollowPress}: ActionPanelProps) => { export const ActionPanel = ({isFollowing, isFavourite, onFavouritePress, onFollowPress}: ActionPanelProps) => {
return ( return (
<View style={styles.actionPanel}> <View style={styles.actionPanel}>
<IconButton <IconButton

View File

@ -33,6 +33,7 @@ export const QuickProfileContent = ({
const currentAccount = useAppSelector((state)=>state.account.currentAccount); const currentAccount = useAppSelector((state)=>state.account.currentAccount);
const pinCode = useAppSelector((state)=>state.application.pin); const pinCode = useAppSelector((state)=>state.application.pin);
const isLoggedIn = useAppSelector((state)=>state.application.isLoggedIn);
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [user, setUser] = useState(null); const [user, setUser] = useState(null);
@ -259,12 +260,15 @@ export const QuickProfileContent = ({
text='VIEW FULL PROFILE' text='VIEW FULL PROFILE'
onPress={_openFullProfile} onPress={_openFullProfile}
/> />
<ActionPanel {isLoggedIn && (
<ActionPanel
isFollowing={isFollowing} isFollowing={isFollowing}
isFavourite={isFavourite} isFavourite={isFavourite}
onFavouritePress={_onFavouritePress} onFavouritePress={_onFavouritePress}
onFollowPress={_onFollowPress} onFollowPress={_onFollowPress}
/> />
)}
</View> </View>
) )
}; };