2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue6281

This commit is contained in:
Matthias Mair
2025-01-12 14:47:40 +01:00
2 changed files with 14 additions and 2 deletions

View File

@ -1,10 +1,16 @@
import { Paper, SimpleGrid } from '@mantine/core';
import { useElementSize } from '@mantine/hooks';
import type React from 'react';
import { useMemo } from 'react';
export function ItemDetailsGrid(props: React.PropsWithChildren<{}>) {
const { ref, width } = useElementSize();
const cols = useMemo(() => (width > 700 ? 2 : 1), [width]);
return (
<Paper p='xs'>
<SimpleGrid cols={2} spacing='xs' verticalSpacing='xs'>
<SimpleGrid cols={cols} spacing='xs' verticalSpacing='xs' ref={ref}>
{props.children}
</SimpleGrid>
</Paper>

View File

@ -66,7 +66,13 @@ export function PageDetail({
<Group justify='space-between' wrap='nowrap'>
<Group justify='left' wrap='nowrap'>
{imageUrl && (
<ApiImage src={imageUrl} radius='sm' mah={42} maw={42} />
<ApiImage
src={imageUrl}
radius='sm'
miw={42}
mah={42}
maw={42}
/>
)}
<Stack gap='xs'>
{title && <StylishText size='lg'>{title}</StylishText>}