Repository URL to install this package:
|
Version:
0.0.15 ▾
|
import * as tslib_1 from "tslib";
// modules
import React from 'react';
// state domain
import { shippingContainer } from '@skava/packages/core/auth/user';
import { observer } from 'xmobx/mobx-react';
// domain
import { AddressTileList } from './templates/AddressTileList';
import { AddressHeader } from './templates/ShippingAddress';
// local
// @todo @james === import atom
import { myAccountAddressContainer } from '@skava/packages/core/auth/user/container.address';
import { AddressItemWrap, AddressSectionWrap } from './styled';
let AddressSection = class AddressSection extends React.Component {
componentWillMount() {
shippingContainer.fetchAddresses();
}
render() {
const { isList, isEditExpanded, isEdit } = myAccountAddressContainer;
const addressListView = React.createElement(AddressTileList, null);
// Passing headerExpandableState to close the add address form on edit address click
const mainSectionHeader = isEdit === false && (React.createElement(AddressHeader, { key: "header" }));
const addressList = isList === true && (React.createElement(AddressItemWrap, { key: "w" }, addressListView));
return (React.createElement(AddressSectionWrap, null,
mainSectionHeader,
addressList));
}
};
AddressSection = tslib_1.__decorate([
observer
], AddressSection);
export { AddressSection };
export default AddressSection;
//# sourceMappingURL=AddressSection.js.map