feat: delete unnecessary components
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
Reference in New Issue
Block a user