|
|
|
|
|
|
|
|
import { useTranslation } from "react-i18next"; |
|
|
import { useTranslation } from "react-i18next"; |
|
|
import { FieldLabel, SelectOption } from "../FirstPartCreateOffer.styled"; |
|
|
import { FieldLabel, SelectOption } from "../FirstPartCreateOffer.styled"; |
|
|
import { SelectField } from "../../CreateOffer.styled"; |
|
|
import { SelectField } from "../../CreateOffer.styled"; |
|
|
|
|
|
import { CategoryContainer, CategoryIcon } from "./OfferCategoryField.styled"; |
|
|
|
|
|
import { |
|
|
|
|
|
getImageUrl, |
|
|
|
|
|
variants, |
|
|
|
|
|
} from "../../../../../util/helpers/imageUrlGetter"; |
|
|
|
|
|
import useIsMobile from "../../../../../hooks/useIsMobile"; |
|
|
|
|
|
|
|
|
const OfferCategoryField = (props) => { |
|
|
const OfferCategoryField = (props) => { |
|
|
const { t } = useTranslation(); |
|
|
const { t } = useTranslation(); |
|
|
|
|
|
const { isMobile } = useIsMobile(); |
|
|
const formik = props.formik; |
|
|
const formik = props.formik; |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
|
|
|
|
|
|
value={cat.name} |
|
|
value={cat.name} |
|
|
onClick={() => props.handleSubcategories(cat.name)} |
|
|
onClick={() => props.handleSubcategories(cat.name)} |
|
|
> |
|
|
> |
|
|
{cat.name} |
|
|
|
|
|
|
|
|
<CategoryContainer> |
|
|
|
|
|
<CategoryIcon |
|
|
|
|
|
src={getImageUrl(cat.image, variants.categoryIcon, isMobile)} |
|
|
|
|
|
/> |
|
|
|
|
|
{cat.name} |
|
|
|
|
|
</CategoryContainer> |
|
|
</SelectOption> |
|
|
</SelectOption> |
|
|
); |
|
|
); |
|
|
})} |
|
|
})} |