Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/(tabs)/inboxView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const InboxView = () => {
const renderCategoriesTodo = ({ item }) => {
return (
<View style={styles.bottomContainer}>
<CategoryMainItem item={item} />
<CategoryMainItem item={item} isToday={false} />
<InboxTodos todosData={todosData} categoryId={item.id} />
</View>
);
Expand All @@ -61,6 +61,7 @@ const InboxView = () => {
<FlatList
data={categoriesData}
renderItem={renderCategoriesTodo}
keyExtractor={item => item.id}
/>
</Suspense>
<CalendarBottomSheet isTodo={true} item={selectedTodo} />
Expand Down
2 changes: 1 addition & 1 deletion app/(tabs)/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const TodayView = () => {
const renderCategoriesTodo = ({ item }) => {
return (
<View>
<CategoryMainItem item={item} />
<CategoryMainItem item={item} isToday={true} />
<DailyTodos todosData={todosData} categoryId={item.id} />
</View>
);
Expand Down
11 changes: 5 additions & 6 deletions components/InboxSubTodo.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { TextInputContext } from '@/contexts/textInputContext';
import { useSubTodoUpdateMutation } from '@/hooks/api/useSubTodoMutations';
import { Icon, Input, ListItem } from '@ui-kitten/components';
import { useContext, useState } from 'react';
import React, { useContext, useState } from 'react';
import { Text, TouchableOpacity } from 'react-native';
import { useTheme } from 'react-native-elements';
import TodoModal from './TodoModal';
import React from 'react';
import { TextInputContext } from '@/contexts/textInputContext';

const InboxSubTodo = ({ item }) => {
const [isEditing, setIsEditing] = useState(false);
const [content, setContent] = useState(item.content);
const theme = useTheme();
const [modalVisible, setModalVisible] = useState(false);
const { mutate: updateInboxSubTodo } = useSubTodoUpdateMutation();
const { setTextInputOpen } = useContext(TextInputContext);
const { setInboxTextInputOpen } = useContext(TextInputContext);

const handleEdit = () => {
setIsEditing(true);
setTextInputOpen(false);
setInboxTextInputOpen(false);
setModalVisible(false);
};

Expand Down Expand Up @@ -66,7 +65,7 @@ const InboxSubTodo = ({ item }) => {
onSubmitEditing={() => {
handleInboxSubTodoUpdate();
setIsEditing(false);
setTextInputOpen(true);
setInboxTextInputOpen(true);
}}
autoFocus={true}
/>
Expand Down
173 changes: 0 additions & 173 deletions components/InboxTodo.jsx

This file was deleted.

115 changes: 0 additions & 115 deletions components/InboxTodos.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion components/categoryView/CategoryBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CategoryBottomSheet = () => {
title: categoryName,
color: 1,
};
addCategory({ addCategoryData });
addCategory(addCategoryData);
};

const handleEditCategory = () => {
Expand Down
21 changes: 15 additions & 6 deletions components/categoryView/CategoryMainItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@ import colors from '@/theme/theme.json';
import { Icon } from '@ui-kitten/components';
import { useContext } from 'react';
import { Pressable, StyleSheet, View } from 'react-native';
import CategoryButton from './CategoryButton';
import { scale, verticalScale } from 'react-native-size-matters';
import CategoryButton from './CategoryButton';

const CategoryMainItem = ({ item }) => {
const { setTextInputOpen, setActivatedCategoryId } =
useContext(TextInputContext);
const CategoryMainItem = ({ item, isToday = true }) => {
const {
setTodayTextInputOpen,
setTodayActivatedCategoryId,
setInboxTextInputOpen,
setInboxActivatedCategoryId,
} = useContext(TextInputContext);
const handlePress = () => {
setTextInputOpen(true);
setActivatedCategoryId(item.id);
if (isToday) {
setTodayTextInputOpen(true);
setTodayActivatedCategoryId(item.id);
} else {
setInboxTextInputOpen(true);
setInboxActivatedCategoryId(item.id);
}
};

return (
Expand Down
Loading
Loading