@homefile/components-v2 2.14.10 → 2.14.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,9 +3,61 @@ import { useState } from 'react';
|
|
|
3
3
|
import { t } from 'i18next';
|
|
4
4
|
import { Image, Flex, Menu, Text } from '@chakra-ui/react';
|
|
5
5
|
import { SelectButton, SelectList, SelectItem } from '../..';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
// categoryItems,
|
|
8
|
+
partnerCategoriesIcons, textOptionVariants, } from '../../../helpers';
|
|
7
9
|
export const PartnerCategorySelect = ({ onClick, width = '10rem', }) => {
|
|
8
10
|
const [category, setCategory] = useState(t('partner.categories.all'));
|
|
11
|
+
const categoryItems = [
|
|
12
|
+
{
|
|
13
|
+
name: t('partner.categories.all'),
|
|
14
|
+
_id: 'all',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: t('partner.categories.insurance'),
|
|
18
|
+
_id: 'insurance',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: t('partner.categories.maintenance'),
|
|
22
|
+
_id: 'maintenance',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: t('partner.categories.warranty'),
|
|
26
|
+
_id: 'warranty',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: t('partner.categories.construction'),
|
|
30
|
+
_id: 'construction',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: t('partner.categories.finance'),
|
|
34
|
+
_id: 'finance',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: t('partner.categories.plumbing'),
|
|
38
|
+
_id: 'plumbing',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: t('partner.categories.electrical'),
|
|
42
|
+
_id: 'electrical',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: t('partner.categories.design'),
|
|
46
|
+
_id: 'design',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: t('partner.categories.organization'),
|
|
50
|
+
_id: 'organization',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: t('partner.categories.misc'),
|
|
54
|
+
_id: 'misc',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: t('partner.categories.other'),
|
|
58
|
+
_id: 'other',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
9
61
|
return (_jsxs(Menu, { children: [_jsx(SelectButton, { variant: "primary", selectedValue: category, width: width }), _jsx(SelectList, { children: categoryItems.map(({ _id, name }) => {
|
|
10
62
|
const handleClick = () => {
|
|
11
63
|
setCategory(name);
|
package/package.json
CHANGED
|
@@ -3,17 +3,69 @@ import { t } from 'i18next'
|
|
|
3
3
|
import { Image, Flex, Menu, Text } from '@chakra-ui/react'
|
|
4
4
|
import { SelectButton, SelectList, SelectItem } from '@/components'
|
|
5
5
|
import {
|
|
6
|
-
categoryItems,
|
|
6
|
+
// categoryItems,
|
|
7
7
|
partnerCategoriesIcons,
|
|
8
8
|
textOptionVariants,
|
|
9
9
|
} from '@/helpers'
|
|
10
|
-
import { PartnerCategorySelectI } from '@/interfaces'
|
|
10
|
+
import { PartnerCategorySelectI, SelectItemI, PartnerCategoryTypes } from '@/interfaces'
|
|
11
11
|
|
|
12
12
|
export const PartnerCategorySelect = ({
|
|
13
13
|
onClick,
|
|
14
14
|
width = '10rem',
|
|
15
15
|
}: PartnerCategorySelectI) => {
|
|
16
16
|
const [category, setCategory] = useState<string>(t('partner.categories.all'))
|
|
17
|
+
|
|
18
|
+
const categoryItems: SelectItemI<PartnerCategoryTypes>[] = [
|
|
19
|
+
{
|
|
20
|
+
name: t('partner.categories.all'),
|
|
21
|
+
_id: 'all',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: t('partner.categories.insurance'),
|
|
25
|
+
_id: 'insurance',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: t('partner.categories.maintenance'),
|
|
29
|
+
_id: 'maintenance',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: t('partner.categories.warranty'),
|
|
33
|
+
_id: 'warranty',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: t('partner.categories.construction'),
|
|
37
|
+
_id: 'construction',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: t('partner.categories.finance'),
|
|
41
|
+
_id: 'finance',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: t('partner.categories.plumbing'),
|
|
45
|
+
_id: 'plumbing',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: t('partner.categories.electrical'),
|
|
49
|
+
_id: 'electrical',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: t('partner.categories.design'),
|
|
53
|
+
_id: 'design',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: t('partner.categories.organization'),
|
|
57
|
+
_id: 'organization',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: t('partner.categories.misc'),
|
|
61
|
+
_id: 'misc',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: t('partner.categories.other'),
|
|
65
|
+
_id: 'other',
|
|
66
|
+
},
|
|
67
|
+
]
|
|
68
|
+
|
|
17
69
|
return (
|
|
18
70
|
<Menu>
|
|
19
71
|
<SelectButton variant="primary" selectedValue={category} width={width} />
|