mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 07:40:32 +00:00
feat(warehouse ): warehouses skeleton.
This commit is contained in:
@@ -3,6 +3,7 @@ import styled from 'styled-components';
|
|||||||
import { ContextMenu2 } from '@blueprintjs/popover2';
|
import { ContextMenu2 } from '@blueprintjs/popover2';
|
||||||
|
|
||||||
import { WarehouseContextMenu, WarehousesGrid } from './components';
|
import { WarehouseContextMenu, WarehousesGrid } from './components';
|
||||||
|
import { useWarehousesContext } from './WarehousesProvider';
|
||||||
|
|
||||||
import withAlertsActions from '../../Alert/withAlertActions';
|
import withAlertsActions from '../../Alert/withAlertActions';
|
||||||
import withDialogActions from '../../Dialog/withDialogActions';
|
import withDialogActions from '../../Dialog/withDialogActions';
|
||||||
@@ -20,6 +21,8 @@ function WarehousesGridItems({
|
|||||||
|
|
||||||
warehouse,
|
warehouse,
|
||||||
}) {
|
}) {
|
||||||
|
const { isWarehouesLoading } = useWarehousesContext();
|
||||||
|
|
||||||
// Handle edit warehouse.
|
// Handle edit warehouse.
|
||||||
const handleEditWarehouse = () => {
|
const handleEditWarehouse = () => {
|
||||||
openDialog('warehouse-form', { warehouseId: warehouse.id, action: 'edit' });
|
openDialog('warehouse-form', { warehouseId: warehouse.id, action: 'edit' });
|
||||||
@@ -45,7 +48,7 @@ function WarehousesGridItems({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<WarehousesGrid warehouse={warehouse} />
|
<WarehousesGrid warehouse={warehouse} loading={isWarehouesLoading} />
|
||||||
</ContextMenu2>
|
</ContextMenu2>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import { Classes } from '@blueprintjs/core';
|
||||||
|
import clsx from 'classnames';
|
||||||
|
|
||||||
import { Menu, MenuItem, MenuDivider, Intent } from '@blueprintjs/core';
|
import { Menu, MenuItem, MenuDivider, Intent } from '@blueprintjs/core';
|
||||||
import { If, Icon, Can } from '../../../components';
|
import { If, Icon, Can } from '../../../components';
|
||||||
@@ -37,21 +39,33 @@ export function WarehouseContextMenu({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function WarehousesGrid({ warehouse }) {
|
export function WarehousesGrid({ warehouse, loading }) {
|
||||||
return (
|
return (
|
||||||
<WarehouseGridWrapper>
|
<WarehouseGridWrapper>
|
||||||
<WarehouseHeader>
|
<WarehouseHeader>
|
||||||
<WarehouseTitle>{warehouse.name}</WarehouseTitle>
|
<WarehouseTitle className={clsx({ [Classes.SKELETON]: loading })}>
|
||||||
<WarehouseCode>{warehouse.code}</WarehouseCode>
|
{warehouse.name}
|
||||||
|
</WarehouseTitle>
|
||||||
|
<WarehouseCode className={clsx({ [Classes.SKELETON]: loading })}>
|
||||||
|
{warehouse.code}
|
||||||
|
</WarehouseCode>
|
||||||
<WarehouseIcon>
|
<WarehouseIcon>
|
||||||
<Icon icon="warehouse-16" iconSize={20} />
|
{!loading && <Icon icon="warehouse-16" iconSize={20} />}
|
||||||
</WarehouseIcon>
|
</WarehouseIcon>
|
||||||
</WarehouseHeader>
|
</WarehouseHeader>
|
||||||
<WarehouseContent>
|
<WarehouseContent>
|
||||||
<WarehouseItem>{warehouse.city}</WarehouseItem>
|
<WarehouseItem className={clsx({ [Classes.SKELETON]: loading })}>
|
||||||
<WarehouseItem>{warehouse.country}</WarehouseItem>
|
{warehouse.city}
|
||||||
<WarehouseItem>{warehouse.email}</WarehouseItem>
|
</WarehouseItem>
|
||||||
<WarehouseItem>{warehouse.phone_number}</WarehouseItem>
|
<WarehouseItem className={clsx({ [Classes.SKELETON]: loading })}>
|
||||||
|
{warehouse.country}
|
||||||
|
</WarehouseItem>
|
||||||
|
<WarehouseItem className={clsx({ [Classes.SKELETON]: loading })}>
|
||||||
|
{warehouse.email}
|
||||||
|
</WarehouseItem>
|
||||||
|
<WarehouseItem className={clsx({ [Classes.SKELETON]: loading })}>
|
||||||
|
{warehouse.phone_number}
|
||||||
|
</WarehouseItem>
|
||||||
</WarehouseContent>
|
</WarehouseContent>
|
||||||
</WarehouseGridWrapper>
|
</WarehouseGridWrapper>
|
||||||
);
|
);
|
||||||
@@ -113,7 +127,7 @@ const WarehouseContent = styled.div`
|
|||||||
const WarehouseItem = styled.div`
|
const WarehouseItem = styled.div`
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: #000;
|
color: #000;
|
||||||
line-height: 1.3rem;
|
margin-bottom: 5px;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ import withCurrentOrganization from 'containers/Organization/withCurrentOrganiza
|
|||||||
*/
|
*/
|
||||||
function BaseCurrency({
|
function BaseCurrency({
|
||||||
// #withCurrentOrganization
|
// #withCurrentOrganization
|
||||||
organization: { base_currency = '' },
|
organization: { base_currency },
|
||||||
|
isForeignCustomer,
|
||||||
}) {
|
}) {
|
||||||
// if (base_currency.length <= 0) {
|
console.log(isForeignCustomer, 'XXXX');
|
||||||
// return null;
|
if (isForeignCustomer) {
|
||||||
// }
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseCurrencySign>
|
<BaseCurrencySign>
|
||||||
@@ -26,6 +28,8 @@ function BaseCurrency({
|
|||||||
export default R.compose(withCurrentOrganization())(BaseCurrency);
|
export default R.compose(withCurrentOrganization())(BaseCurrency);
|
||||||
|
|
||||||
const BaseCurrencySign = styled.div`
|
const BaseCurrencySign = styled.div`
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
span {
|
span {
|
||||||
|
|||||||
Reference in New Issue
Block a user