Skip to content

Commit

Permalink
Merge pull request #341 from Real-Dev-Squad/Fix/develop
Browse files Browse the repository at this point in the history
fix the active screen issue
  • Loading branch information
shreya-mishra authored Nov 22, 2023
2 parents 98fa3ae + f7a8530 commit 0c5965f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 164 deletions.
4 changes: 2 additions & 2 deletions src/components/DisplayContribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { profileScreenStyles } from '../screens/ProfileScreen/styles';

const DisplayContribution = ({ tasks }) => {
return (
<View style={{ padding: 5 }}>
<View style={{ padding: 5, width: "100%", alignItems: 'center' }}>
{tasks?.length !== 0 ? (
tasks?.map((item, index) => (
<View style={profileScreenStyles.DropDownElement} key={index}>
Expand Down Expand Up @@ -166,7 +166,7 @@ const DisplayContribution = ({ tasks }) => {
</View>
))
) : (
<Text>No Tasks Yet!</Text>
<Text style={{color: '#000'}}>No Tasks Yet!</Text>
)}
</View>
);
Expand Down
167 changes: 5 additions & 162 deletions src/screens/ProfileScreen/TaskScreens/All.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import React, { useCallback, useContext, useState } from 'react';
import { View, Text, TouchableOpacity, ScrollView } from 'react-native';
import { profileScreenStyles } from '../styles';
import {
calculateISODateFormat,
calculateTimeDifference,
convertTimestampToReadableDate,
fetchContribution,
parseISODate,
} from '../../AuthScreen/Util';
import { useFocusEffect, useNavigation } from '@react-navigation/native';
import { ScrollView } from 'react-native';

import { useFocusEffect } from '@react-navigation/native';
import { AuthContext } from '../../../context/AuthContext';
import DisplayContribution from '../../../components/DisplayContribution';

const All = () => {
const [allContributionsData, setAllContributionData] = useState([]);
const { loggedInUserData } = useContext(AuthContext);
const navigation = useNavigation();

useFocusEffect(
useCallback(() => {
Expand All @@ -29,157 +22,7 @@ const All = () => {

return (
<ScrollView style={{ padding: 10, elevation: 10 }}>
<View style={profileScreenStyles.container}>
{allContributionsData.map((item, index) => (
<View style={profileScreenStyles.DropDownElement} key={index}>
<TouchableOpacity
style={profileScreenStyles.DropDownbackground}
onPress={() => navigation.navigate('AllTaskDetail')}
>
{item.task.id ? (
<React.Fragment>
<Text
style={{
color: 'blue',
fontSize: 18,
fontWeight: 'bold',
}}
>
{item.task.title}
</Text>
<>
{item.task.purpose ? (
<Text
style={{
paddingLeft: 15,
paddingRight: 15,
paddingTop: 10,
paddingBottom: 10,
color: 'grey',
fontSize: 15,
}}
>
{item.task.purpose}
</Text>
) : (
<View style={{ padding: 10 }} />
)}
</>
<>
{item.task.featureUrl ? (
<Text
style={{
color: 'black',
fontSize: 15,
borderBottomColor: 'grey',
// borderBottomWidth: 1,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 10,
}}
>
Estimated completion:{' '}
<Text style={{ fontWeight: 'bold' }}>
{calculateTimeDifference(
convertTimestampToReadableDate(item.task.startedOn),
convertTimestampToReadableDate(item.task.endsOn),
)}
</Text>
</Text>
) : (
<Text
style={{
color: 'black',
fontSize: 15,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 10,
}}
>
Estimated completion:{' '}
<Text style={{ fontWeight: 'bold' }}>
{calculateTimeDifference(
convertTimestampToReadableDate(item.task.startedOn),
convertTimestampToReadableDate(item.task.endsOn),
)}
</Text>
</Text>
)}
</>
<>
{item.task.featureUrl ? (
<Text
style={{
color: 'grey',
fontSize: 13,
textAlign: 'center',
}}
>
Checkout this feature in action
</Text>
) : null}
</>
</React.Fragment>
) : (
<React.Fragment>
{item.prList.length > 0 && (
<React.Fragment>
<Text
style={{
color: 'blue',
fontSize: 20,
fontWeight: 'bold',
}}
>
PR Title: {item.prList[0].title}
</Text>
<Text
style={{
color: 'black',
fontSize: 15,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 10,
paddingTop: 10,
}}
>
Completed in:{' '}
<Text style={{ fontWeight: 'bold' }}>
{calculateTimeDifference(
parseISODate(item.prList[0].createdAt),
parseISODate(item.prList[0].updatedAt),
)}
</Text>
</Text>
<Text
style={{
color: 'black',
borderBottomColor: 'grey',
// borderBottomWidth: 1,
fontSize: 15,
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 10,
}}
>
Feature live on:{' '}
{calculateISODateFormat(item.prList[0].updatedAt)}
</Text>
<>
{item.prList[0].url ? (
<Text style={{ color: 'grey', textAlign: 'center' }}>
Checkout this feature in action
</Text>
) : null}
</>
</React.Fragment>
)}
</React.Fragment>
)}
</TouchableOpacity>
</View>
))}
</View>
<DisplayContribution tasks={allContributionsData} />
</ScrollView>
);
};
Expand Down

0 comments on commit 0c5965f

Please sign in to comment.