added quick profile action panel

This commit is contained in:
Nouman Tahir 2021-09-16 10:32:12 +05:00
parent 51fcdd0c22
commit 433cbba484
3 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,30 @@
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import EStyleSheet from 'react-native-extended-stylesheet';
import { IconButton } from '../../..';
import styles from './quickProfileStyles';
interface ActionPanelProps {
isFollowing:boolean,
isFavourite:boolean,
}
export const ActionPanel = ({isFollowing, isFavourite}: ActionPanelProps) => {
return (
<View style={styles.actionPanel}>
<IconButton
iconType='SimpleLineIcons'
name={isFollowing?'user-following':'user-follow'}
size={20}
color={EStyleSheet.value('$primaryBlack')}
/>
<IconButton
style={{marginLeft:8}}
iconType='SimpleLineIcons'
name={'heart'}
size={20}
color={EStyleSheet.value(isFavourite?'$primaryRed':'$primaryBlack')}
/>
</View>
);
};

View File

@ -10,6 +10,7 @@ import styles from './quickProfileStyles'
import { ProfileBasic } from './profileBasic'
import { parseReputation } from '../../../../utils/user'
import { default as ROUTES } from '../../../../constants/routeNames';
import { ActionPanel } from './actionPanel'
interface QuickProfileContentProps {
username:string,
@ -177,6 +178,10 @@ export const QuickProfileContent = ({
text='VIEW FULL PROFILE'
onPress={_openFullProfile}
/>
<ActionPanel
isFollowing={isFollowing}
isFavourite={isFavourite}
/>
</View>
)
};

View File

@ -89,10 +89,13 @@ export default EStyleSheet.create({
actionPanel:{
width:'100%',
position: 'absolute',
right:0,
top:0,
flexDirection:'row',
justifyContent:'space-around',
alignItems:'center',
} as ViewStyle,
})