How to use the @magento/peregrine/lib/talons/CategoryList/useCategoryTile.useCategoryTile function in @magento/peregrine

To help you get started, we’ve selected a few @magento/peregrine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jordaneisenburger / fallback-studio / src / pwa-studio / packages / venia-ui / lib / components / CategoryList / categoryTile.js View on Github external
const CategoryTile = props => {
    const talonProps = useCategoryTile({
        item: props.item
    });

    const { image, item } = talonProps;

    const imagePath = resourceUrl(image.url, {
        type: image.type,
        width: image.width
    });

    // interpolation doesn't work inside `url()` for legacy reasons
    // so a custom property should wrap its value in `url()`
    const imageUrl = imagePath ? `url(${imagePath})` : 'none';
    const imageWrapperStyle = { '--venia-image': imageUrl };

    const classes = mergeClasses(defaultClasses, props.classes);