feat: enhance filter functionality and UI improvements
- Added FilterView component for managing custom filters. - Implemented temporary filter application in MyChores and custom filter hooks. - Improved sorting of archived chores by updated date. - Enhanced SortAndGrouping component with keyboard navigation support. - Updated CustomFilterChips to visually indicate active filters. - Refactored AdvancedFilterBuilder to improve usability and added listbox positioning. - Integrated project selection caching in ProjectView for better navigation. - Cleaned up unused imports and optimized existing code for better performance.
This commit is contained in:
@@ -24,9 +24,9 @@ import LABEL_COLORS, {
|
||||
import { DeleteProject } from '../../utils/Fetcher'
|
||||
import { getIconComponent } from '../../utils/ProjectIcons'
|
||||
import { getSafeBottomStyles } from '../../utils/SafeAreaUtils'
|
||||
import { useProjectFilter } from '../Chores/hooks/useProjectFilter'
|
||||
import ConfirmationModal from '../Modals/Inputs/ConfirmationModal'
|
||||
import { useProjects } from './ProjectQueries'
|
||||
|
||||
const ProjectCard = ({
|
||||
project,
|
||||
onEditClick,
|
||||
@@ -36,7 +36,9 @@ const ProjectCard = ({
|
||||
taskCounts = {},
|
||||
}) => {
|
||||
const navigate = useNavigate()
|
||||
const { data: projects = [], isLoading: projectsLoading } = useProjects()
|
||||
// Helper function to get color name from hex value
|
||||
const { setSelectedProjectWithCache } = useProjectFilter(projects)
|
||||
const getColorName = hexValue => {
|
||||
const colorObj = LABEL_COLORS.find(
|
||||
color => color.value.toLowerCase() === hexValue.toLowerCase(),
|
||||
@@ -311,6 +313,7 @@ const ProjectCard = ({
|
||||
// For default project, use 'default', for others use project ID
|
||||
const projectIdentifier =
|
||||
project.id === 'default' ? 'default' : project.id
|
||||
setSelectedProjectWithCache(project)
|
||||
navigate(`/chores?project=${encodeURIComponent(projectIdentifier)}`)
|
||||
}}
|
||||
onTouchStart={isEditable ? handleTouchStart : undefined}
|
||||
|
||||
Reference in New Issue
Block a user