added show diff button

This commit is contained in:
Sadaqat Ali 2022-04-27 20:55:26 +05:00
parent 4a7421ef1c
commit ded5aa2b44
3 changed files with 32 additions and 6 deletions

View File

@ -40,6 +40,9 @@ const BasicHeaderView = ({
quickTitle, quickTitle,
rightButtonText, rightButtonText,
rightIconName, rightIconName,
iconType,
rightIconBtnStyle,
rightIconStyle,
title, title,
handleOnSubmit, handleOnSubmit,
handleOnSearch, handleOnSearch,
@ -206,8 +209,10 @@ const BasicHeaderView = ({
<IconButton <IconButton
size={25} size={25}
onPress={() => handleRightIconPress()} onPress={() => handleRightIconPress()}
iconStyle={styles.rightIcon} iconStyle={[styles.rightIcon, rightIconStyle]}
style={rightIconBtnStyle}
name={rightIconName} name={rightIconName}
iconType={iconType}
/> />
)} )}

View File

@ -37,6 +37,7 @@ const EditHistoryScreen = ({ navigation }) => {
const intl = useIntl(); const intl = useIntl();
const [editHistory, setEditHistory] = useState<CommentHistoryItem[]>([]); const [editHistory, setEditHistory] = useState<CommentHistoryItem[]>([]);
const [versionSelected, setVersionSelected] = useState(1); const [versionSelected, setVersionSelected] = useState(1);
const [showDiff, setShowDiff] = useState(false);
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
useEffect(() => { useEffect(() => {
_getCommentHistory(); _getCommentHistory();
@ -151,11 +152,7 @@ const EditHistoryScreen = ({ navigation }) => {
<View style={styles.postHeaderContainer}> <View style={styles.postHeaderContainer}>
<Text style={styles.postHeaderTitle}>{selectedItem.title}</Text> <Text style={styles.postHeaderTitle}>{selectedItem.title}</Text>
<View style={styles.tagsContainer}> <View style={styles.tagsContainer}>
<Icon <Icon style={styles.tagIcon} iconType="AntDesign" name={'tag'} />
style={styles.tagIcon}
iconType="AntDesign"
name={'tag'}
/>
<Text style={styles.tags}>{selectedItem.tags}</Text> <Text style={styles.tags}>{selectedItem.tags}</Text>
</View> </View>
</View> </View>
@ -172,6 +169,22 @@ const EditHistoryScreen = ({ navigation }) => {
title={intl.formatMessage({ title={intl.formatMessage({
id: 'history.edit', id: 'history.edit',
})} })}
iconType="Ionicons"
rightIconName="git-compare-sharp"
rightIconBtnStyle={[
styles.rightIcon,
{
backgroundColor: showDiff
? EStyleSheet.value('$primaryBlue')
: EStyleSheet.value('$primaryDarkGray'),
},
]}
rightIconStyle={{
color: showDiff
? EStyleSheet.value('white')
: EStyleSheet.value('$iconColor'),
}}
handleRightIconPress={() => setShowDiff(!showDiff)}
/> />
<View style={styles.mainContainer}> <View style={styles.mainContainer}>
{editHistory.length > 0 && _renderVersionsList()} {editHistory.length > 0 && _renderVersionsList()}

View File

@ -56,5 +56,13 @@ export default EStyleSheet.create({
}, },
tagIcon: { tagIcon: {
color: '$primaryDarkGray' color: '$primaryDarkGray'
},
rightIcon: {
backgroundColor: '$primaryDarkGray',
width: 40,
height: 40,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 8,
} }
}); });