Skip to content

Commit

Permalink
implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
aniamisiorek committed Dec 7, 2023
1 parent 7b86d99 commit f723d05
Show file tree
Hide file tree
Showing 10 changed files with 291 additions and 357 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import { fetchTaskTag } from '@/services/TaskService';
import { Text, View } from 'native-base';

import React, { useEffect, useState } from 'react';
import { Pressable } from 'react-native';
import { Pressable, TouchableOpacity } from 'react-native';

import RightArrowIcon from '../icons/RightArrowIcon';
import CircleProgress from '../reusable/CircleProgress';

type HSTCProps = {
task: ITask;
isAllTasks?: boolean;
handleOnPress?: () => void;
};

const HomeScreenTaskCard: React.FC<HSTCProps> = ({ task, isAllTasks }) => {
const HomeScreenTaskCard: React.FC<HSTCProps> = ({ task, isAllTasks, handleOnPress }) => {
const [tag, setTag] = useState<string | null>(null);
const [isPending, setIsPending] = useState<boolean>(false);
const [error, setError] = useState<Error | null>(null);
Expand All @@ -39,7 +40,7 @@ const HomeScreenTaskCard: React.FC<HSTCProps> = ({ task, isAllTasks }) => {
const progress = Math.floor(Math.random() * 100) + 1;

return (
<Pressable onPress={() => console.log(`pressed ${task.id}`)}>
<TouchableOpacity onPress={handleOnPress}>
<View
paddingLeft={5}
paddingTop={6}
Expand Down Expand Up @@ -130,7 +131,7 @@ const HomeScreenTaskCard: React.FC<HSTCProps> = ({ task, isAllTasks }) => {
</View>
)}
</View>
</Pressable>
</TouchableOpacity>
);
};

Expand Down
3 changes: 2 additions & 1 deletion client-new/src/navigation/AppStack.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import GuideScreen from '@/screens/app/GuideScreen';
import TaskScreen from '@/screens/app/TaskScreen';
import TaskScreen from '@/screens/app/tasks/TaskScreen';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

import React from 'react';

import HomeScreen from '../screens/app/BottomTabNavigator';
import TaskStack from './TaskStack';

const Stack = createNativeStackNavigator();

Expand Down
2 changes: 0 additions & 2 deletions client-new/src/navigation/AuthStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import AccessScreen from '@/screens/auth/AccessScreen';
import LoginScreen from '@/screens/auth/LoginScreen';
import SignUpScreen from '@/screens/auth/SignUpScreen';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { View } from 'native-base';

import React from 'react';
import { ActivityIndicator } from 'react-native';

import { useUser } from '../contexts/UserContext';
import OnboardingStack from './OnboardingStack';
Expand Down
28 changes: 28 additions & 0 deletions client-new/src/navigation/TaskStack.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import React from 'react';
import TaskScreen from '@/screens/app/tasks/TaskScreen';
import SubTaskSummaryScreen from '@/screens/app/tasks/SubTaskSummaryScreen';
import SubTaskScreen from '@/screens/app/tasks/SubTaskScreen';

const Stack = createNativeStackNavigator();
/**
* The Task Stack contains all the screens related to tasks
* - All Tasks Screen
* - Task Summary Screen
* - Subtask Summary Screen
* @returns TaskStack
*/
export default function TaskStack() {
return (
<Stack.Navigator
initialRouteName="Subtask Summary Screen"
screenOptions={{
headerShown: false
}}
>
<Stack.Screen name="Task Screen" component={TaskScreen} />
<Stack.Screen name="Subtask Summary Screen" component={SubTaskSummaryScreen} />
<Stack.Screen name="Subtask Screen" component={SubTaskScreen} />
</Stack.Navigator>
);
}
2 changes: 1 addition & 1 deletion client-new/src/screens/app/BottomTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import FileCollectionScreen from '@/screens/app/FileCollectionScreen';
import GuideScreen from '@/screens/app/GuideScreen';
import HomeScreen from '@/screens/app/HomeScreen';
import MarketplaceScreen from '@/screens/app/MarketplaceScreen';
import TaskScreen from '@/screens/app/TaskScreen';
import TaskScreen from '@/screens/app/tasks/TaskScreen';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';

import React from 'react';
Expand Down
158 changes: 0 additions & 158 deletions client-new/src/screens/app/SubTaskSummaryScreen.tsx

This file was deleted.

Loading

0 comments on commit f723d05

Please sign in to comment.