Skip to content

Commit 7b01af4

Browse files
committed
fix: Datareference label fix
1 parent b1d3834 commit 7b01af4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/react-sdk-components/src/components/infra/View/View.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function View(props: PropsWithChildren<ViewProps>) {
5656
const localeUtils = PCore.getLocaleUtils();
5757

5858
const isEmbeddedDataView = mode === 'editable'; // would be better to check the reference child for `context` attribute if possible
59-
if ((isEmbeddedDataView && showLabel === undefined) || (template === 'DataReference' && inheritedProps.showLabel === undefined)) {
59+
if (isEmbeddedDataView && showLabel === undefined) {
6060
showLabel = true;
6161
}
6262

packages/react-sdk-components/src/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FormControl, FormLabel } from '@mui/material';
12
import type { PConnProps } from '../../../types/PConnProps';
23

34
interface SingleReferenceReadOnlyProps extends PConnProps {
@@ -59,5 +60,12 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
5960
{}
6061
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
6162

62-
return <>{component}</>;
63+
return (
64+
<>
65+
<FormControl variant='standard' sx={{ display: 'flex', flexDirection: 'row' }}>
66+
<FormLabel sx={{ marginRight: '2rem' }}>{label}</FormLabel>
67+
{component}
68+
</FormControl>
69+
</>
70+
);
6371
}

0 commit comments

Comments
 (0)