feat: delete unnecessary components

This commit is contained in:
Ilia Mashkov
2026-01-02 20:03:20 +03:00
parent 90899c0b3b
commit 949c7c1b48
7 changed files with 52 additions and 29 deletions

View File

@@ -1,9 +1,7 @@
import { FONT_CATEGORIES } from './model/state';
import { categoryFilterStore } from './store/categoryFilterStore';
import CategoryFilter from './ui/CategoryFilter.svelte';
export {
CategoryFilter,
categoryFilterStore,
FONT_CATEGORIES,
};

View File

@@ -1,11 +1,14 @@
import type { FilterModel } from '$shared/store/createFilterStore';
import type {
Category,
FilterModel,
} from '$shared/store/createFilterStore';
/**
* Model of state for CategoryFilter
*/
export type CategoryFilterModel = FilterModel;
export const FONT_CATEGORIES = [
export const FONT_CATEGORIES: Category[] = [
{
id: 'serif',
name: 'Serif',

View File

@@ -1,6 +1,8 @@
import { FONT_CATEGORIES } from '$entities/Font/model/font';
import { createFilterStore } from '$shared/store/createFilterStore';
import type { CategoryFilterModel } from '../model/state';
import {
type CategoryFilterModel,
FONT_CATEGORIES,
} from '../model/state';
/**
* Initial state for CategoryFilter

View File

@@ -1,20 +0,0 @@
<script lang="ts">
import CheckboxFilter from '$shared/ui/CheckboxFilter/CheckboxFilter.svelte';
import { categoryFilterStore } from '../store/categoryFilterStore';
const { categories } = $derived($categoryFilterStore);
function didCategoryToggle(categoryId: string) {
if (categories?.find(category => category.id === categoryId)?.selected) {
categoryFilterStore.deselectCategory(categoryId);
} else {
categoryFilterStore.selectCategory(categoryId);
}
}
</script>
<CheckboxFilter
filterName="Font category"
categories={categories}
onCategoryToggle={didCategoryToggle}
/>