Wishlist Tastic

Tastic name:

Wishlist

Page type:

Master page

Example images:

Empty wishlist Wishlist
Empty wishlist Wishlist

Schema.json:

{
    "tasticType": "frontastic/account/wishlists",
    "name": "Wishlists",
    "category": "Account",
    "icon": "menu",
    "schema": [
        {
            "name": "Stream Selection",
            "fields": [
                {
                    "label": "Stream",
                    "field": "stream",
                    "type": "stream",
                    "streamType": "account-wishlists",
                    "default": null
                }
            ]
        }   
    ]
}

Tastic.jsx

import React from 'react'
import PropTypes from 'prop-types'

import tastify from '@frontastic/catwalk/src/js/helper/tastify'
import app from '@frontastic/catwalk/src/js/app/app'

import AccountWishlist from 'Organisms/Account/AccountWishlist'

const AccountWishlistsTastic = ({ wishlist }) => {
    return (
        <AccountWishlist
            wishlist={wishlist}
            handleRemoveFromWishlist={(itemId) => {
                app.getLoader('wishlist').removeLineItem(wishlist.data.wishlistId, {
                    lineItemId: itemId,
                })
            }}
            returnToHomePage={() => {
                app.getRouter().history.replace('/')
            }}
        />
    )
}

AccountWishlistsTastic.propTypes = {
    wishlist: PropTypes.object.isRequired,
}

export default tastify({
    translate: true,
    connect: {
        wishlist: true,
    },
})(AccountWishlistsTastic)

Still need help? Contact us Contact us