Cart Tastic

Tastic name:

Cart

Page type:

Master pages

Cart

Empty cart Cart
Empty cart
Cart

Schema.json

{
    "tasticType": "frontastic/cart",
    "name": "Cart",
    "icon": "menu",
    "category": "Cart",
    "schema": [
        {
            "name": "Company Menu",
            "fields": []
        }
    ]
}

Tastic.jsx

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

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

import DefaultLoader from 'Molecules/Loaders/DefaultLoader/index'
import Cart from 'Organisms/Cart'

const CartTastic = ({ cart }) => {
    if (cart.loading) {
        if (!cart.data) { return <DefaultLoader /> } else { return <Cart isLoading data={cart.data} /> }
    }

    if (cart.isComplete()) {
        return <Cart data={cart.data} />
    }
}

CartTastic.defaultProps = {}

CartTastic.propTypes = {
    cart: PropTypes.instanceOf(Entity).isRequired,
}

export default tastify({ translate: true, connect: { cart: true } })(CartTastic)

Still need help? Contact us Contact us