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 { .calc-wrapper {
width: 96%; width: 96%;
height: calc(100% - 90px); height: calc(100% - 100px);
} }
.size-list-badges { .size-list-badges {

View File

@ -1,26 +1,33 @@
import { FC } from 'react'; 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 export interface InventoryCategoryEmptyViewProps extends GridProps
{ {
title: string; title: string;
desc: string; desc: string;
isTrading?: boolean;
} }
export const InventoryCategoryEmptyView: FC<InventoryCategoryEmptyViewProps> = props => export const InventoryCategoryEmptyView: FC<InventoryCategoryEmptyViewProps> = props =>
{ {
const { title = '', desc = '', children = null, ...rest } = props; const { title = '', desc = '', isTrading = false, children = null, ...rest } = props;
return ( return (
<Grid { ...rest }> <Grid {...rest}>
<Column center size={ 5 } overflow="hidden"> <Column center size={ 5 } overflow="hidden">
<div className="empty-image" /> <div className="empty-image" />
</Column> { !isTrading &&
<Column justifyContent="center" size={ 7 } overflow="hidden"> <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> <Text fontWeight="bold" fontSize={ 5 } overflow="unset" truncate>{ title }</Text>
<Text overflow="auto">{ desc }</Text> <Text overflow="auto">{ desc }</Text>
</Column> </Column>
{ children } {children}
</Grid> </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>) } { [ InventoryFilterType.EVERYTHING, InventoryFilterType.FLOOR, InventoryFilterType.WALL ].map((type, index) => <option key={ index } value={ type }>{ LocalizeText(type) }</option>) }
</select> </select>
</Flex> </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> </Flex>

View File

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

View File

@ -64,7 +64,7 @@ export const InventoryPetView: FC<InventoryPetViewProps> = props =>
return () => setIsVisible(false); 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 ( return (
<Grid> <Grid>