Cleanup and Fix trading

This commit is contained in:
duckietm 2024-05-03 15:48:21 +02:00
parent 4b0af81009
commit 38cf8dc7ac
8 changed files with 23 additions and 21 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -143,7 +143,7 @@
.calc-wrapper {
width: 96%;
height: calc(100% - 90px);
height: calc(100% - 100px);
}
.size-list-badges {

View File

@ -1,20 +1,27 @@
import { FC } from 'react';
import { Column, Grid, GridProps, Text } from '../../../common';
import { CreateLinkEvent, LocalizeText } from '../../../api';
import { Button, Column, Flex, Grid, GridProps, Text } from '../../../common';
export interface InventoryCategoryEmptyViewProps extends GridProps
{
title: string;
desc: string;
isTrading?: boolean;
}
export const InventoryCategoryEmptyView: FC<InventoryCategoryEmptyViewProps> = props =>
{
const { title = '', desc = '', children = null, ...rest } = props;
const { title = '', desc = '', isTrading = false, children = null, ...rest } = props;
return (
<Grid {...rest}>
<Column center size={ 5 } overflow="hidden">
<div className="empty-image" />
{ !isTrading &&
<Flex gap={ 2 } position="absolute" className="bottom-2">
<Button className="py-1" onClick={ () => CreateLinkEvent('catalog/open') }>{ LocalizeText('inventory.open.catalog') }</Button>
</Flex>
}
</Column>
<Column justifyContent="center" size={ 7 } overflow="hidden">
<Text fontWeight="bold" fontSize={ 5 } overflow="unset" truncate>{ title }</Text>
@ -23,4 +30,4 @@ export const InventoryCategoryEmptyView: FC<InventoryCategoryEmptyViewProps> = p
{children}
</Grid>
);
}
};

View File

@ -95,11 +95,6 @@ export const InventoryCategoryFilterView: FC<InventoryCategoryFilterViewProps> =
{ [ InventoryFilterType.EVERYTHING, InventoryFilterType.FLOOR, InventoryFilterType.WALL ].map((type, index) => <option key={ index } value={ type }>{ LocalizeText(type) }</option>) }
</select>
</Flex>
<Flex alignItems="center" position="relative" className="ms-2">
<select className="form-select form-select-sm" value={ filterPlace } onChange={ event => setFilterPlace(event.target.value) } disabled={ currentTab === TAB_FURNITURE }>
{ [ InventoryFilterType.ANYWHERE, InventoryFilterType.IN_ROOM, InventoryFilterType.IN_INVENTORY ].map((type, index) => <option key={ index } value={ type }>{ LocalizeText(type) }</option>) }
</select>
</Flex>
</>
}
</Flex>

View File

@ -40,7 +40,7 @@ export const InventoryBadgeView: FC<InventoryBadgeViewProps> = props =>
}, []);
return (
<div className="calc-wrapper mt-n2">
<div className="badge-wrapper calc-wrapper mt-n2">
<Grid gap={ 1 }>
<Column overflow="hidden" className="size-list-badges mt-1">
<AutoGrid gap={ 1 } columnCount={ 5 }>

View File

@ -64,7 +64,7 @@ export const InventoryPetView: FC<InventoryPetViewProps> = props =>
return () => setIsVisible(false);
}, []);
if(!petItems || !petItems.length) return <InventoryCategoryEmptyView title={ LocalizeText('inventory.empty.pets.title') } desc={ LocalizeText('inventory.empty.pets.desc') } />;
if(!petItems || !petItems.length) return <InventoryCategoryEmptyView title={ LocalizeText('inventory.empty.pets.title') } desc={ LocalizeText('inventory.empty.pets.desc') } isTrading={ isTrading } />;
return (
<Grid>