Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
shreya-mishra committed Nov 21, 2023
2 parents 919ebd6 + 98fa3ae commit f7a8530
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 643 deletions.
4 changes: 2 additions & 2 deletions src/navigations/TabNavigation/TabNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TabViewStyle } from './style';
import GoalsScreenStack from '../../screens/GoalScreen/GoalScreen';
import HomeScreenV2 from '../../screens/HomeScreen/HomeScreenV2';
import { useSelector } from 'react-redux';
import ProfileScreen2 from '../../screens/ProfileScreen/ProfileScreen2';
import { AllTaskScreenStack } from '../../screens/Stacks/AllStack';

const tab = createBottomTabNavigator();

Expand Down Expand Up @@ -91,7 +91,7 @@ const TabNavigation = () => {

<tab.Screen
name={Strings.Tab_Profile}
component={ProfileScreen2}
component={AllTaskScreenStack}
options={{
headerShown: false,
tabBarLabel: ({ focused }) => {
Expand Down
12 changes: 12 additions & 0 deletions src/screens/ProfileScreen/DetailsScreen/AllTaskDetailScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Text, View } from 'react-native';
import React from 'react';

const AllTaskDetailScreen = () => {
return (
<View>
<Text>AllTaskDetailScreen</Text>
</View>
);
};

export default AllTaskDetailScreen;
116 changes: 0 additions & 116 deletions src/screens/ProfileScreen/ProfileScreen.tsx

This file was deleted.

43 changes: 4 additions & 39 deletions src/screens/ProfileScreen/ProfileScreen2.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useCallback, useContext } from 'react';
import { View, Text, ScrollView, Pressable, StyleSheet } from 'react-native';
import { View, Text, ScrollView, Pressable } from 'react-native';
import { ScreenViewContainer } from '../../styles/GlobalStyle';
import { profileScreenStyles } from './styles';
import ButtonWidget from '../../components/ButtonWidget';
Expand All @@ -8,40 +8,12 @@ import UploadImageModalView from '../../components/GalleryModal';
import { AuthContext } from '../../context/AuthContext';
import { ImagePickerResponse } from 'react-native-image-picker';
import Strings from '../../i18n/en';
import UserData from './User Data/UserData';
import { useSelector, useDispatch } from 'react-redux';
import All from './UserDataV2/All';
import All from './TaskScreens/All';
// import Note from './UserDataV2/NoteWorthy';
import { Tabs } from 'react-native-collapsible-tab-view';
import { useFocusEffect } from '@react-navigation/native';
import { fetchContribution } from '../AuthScreen/Util';
import DisplayContribution from '../../components/DisplayContribution';

const ActiveScreen = () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [activeTasks, setActiveTasks] = useState([]);
const { loggedInUserData } = useContext(AuthContext);

useFocusEffect(
useCallback(() => {
(async () => {
const userName = loggedInUserData?.username;
const contributionResponse = await fetchContribution(userName);
setActiveTasks(
contributionResponse.all.filter(
(item) => item.task.status === 'IN_PROGRESS',
),
);
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []),
);
return (
<View style={styles.profile}>
<DisplayContribution tasks={activeTasks} />
</View>
);
};
import ActiveScreen from './TaskScreens/ActiveTask';
import UserData from './User Data/UserData';

const ProfileScreen = () => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -131,11 +103,4 @@ const ProfileScreen2: React.FC = () => {
);
};

const styles = StyleSheet.create({
profile: {
justifyContent: 'flex-start',
alignItems: 'center',
},
});

export default ProfileScreen2;
43 changes: 43 additions & 0 deletions src/screens/ProfileScreen/TaskScreens/ActiveTask.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';
import { useFocusEffect } from '@react-navigation/native';
import { useCallback, useContext, useState } from 'react';
import { fetchContribution } from '../../AuthScreen/Util';
import { AuthContext } from '../../../context/AuthContext';
import DisplayContribution from '../../../components/DisplayContribution';
import { View } from 'react-native';
import { StyleSheet } from 'react-native';

const ActiveScreen = () => {
const [activeTasks, setActiveTasks] = useState([]);
const { loggedInUserData } = useContext(AuthContext);

useFocusEffect(
useCallback(() => {
(async () => {
const userName = loggedInUserData?.username;
const contributionResponse = await fetchContribution(userName);
setActiveTasks(
contributionResponse.all.filter(
(item: { task: { status: string } }) =>
item.task.status === 'ACTIVE',
),
);
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []),
);
return (
<View style={styles.profile}>
<DisplayContribution tasks={activeTasks} />
</View>
);
};

const styles = StyleSheet.create({
profile: {
justifyContent: 'flex-start',
alignItems: 'center',
},
});

export default ActiveScreen;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback, useContext, useState } from 'react';
import { ScrollView } from 'react-native';
import { fetchContribution } from '../../AuthScreen/Util';

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

This file was deleted.

Loading

0 comments on commit f7a8530

Please sign in to comment.