mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-06 13:30:41 +02:00
cleanup: changing some frontend components
This commit is contained in:
parent
9c6323d38f
commit
6ed6fe5be1
@ -238,14 +238,13 @@ export const GenericComponent = React.memo(
|
|||||||
<ImageComponent
|
<ImageComponent
|
||||||
name={name}
|
name={name}
|
||||||
parentPath={parentPath}
|
parentPath={parentPath}
|
||||||
value={attribute.value['value']['value'] as string}
|
|
||||||
readOnly={attribute.readonly}
|
|
||||||
docString={attribute.value['value'].doc}
|
docString={attribute.value['value'].doc}
|
||||||
// Add any other specific props for the ImageComponent here
|
|
||||||
format={attribute.value['format']['value'] as string}
|
|
||||||
addNotification={addNotification}
|
|
||||||
displayName={displayName}
|
displayName={displayName}
|
||||||
id={id}
|
id={id}
|
||||||
|
addNotification={addNotification}
|
||||||
|
// Add any other specific props for the ImageComponent here
|
||||||
|
value={attribute.value['value']['value'] as string}
|
||||||
|
format={attribute.value['format']['value'] as string}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else if (attribute.type === 'ColouredEnum') {
|
} else if (attribute.type === 'ColouredEnum') {
|
||||||
|
@ -8,7 +8,6 @@ type ImageComponentProps = {
|
|||||||
name: string;
|
name: string;
|
||||||
parentPath: string;
|
parentPath: string;
|
||||||
value: string;
|
value: string;
|
||||||
readOnly: boolean;
|
|
||||||
docString: string;
|
docString: string;
|
||||||
format: string;
|
format: string;
|
||||||
addNotification: (message: string, levelname?: LevelName) => void;
|
addNotification: (message: string, levelname?: LevelName) => void;
|
||||||
@ -35,9 +34,6 @@ export const ImageComponent = React.memo((props: ImageComponentProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="component imageComponent" id={id}>
|
<div className="component imageComponent" id={id}>
|
||||||
{process.env.NODE_ENV === 'development' && (
|
|
||||||
<div>Render count: {renderCount.current}</div>
|
|
||||||
)}
|
|
||||||
<Card>
|
<Card>
|
||||||
<Card.Header
|
<Card.Header
|
||||||
onClick={() => setOpen(!open)}
|
onClick={() => setOpen(!open)}
|
||||||
@ -52,7 +48,6 @@ export const ImageComponent = React.memo((props: ImageComponentProps) => {
|
|||||||
{process.env.NODE_ENV === 'development' && (
|
{process.env.NODE_ENV === 'development' && (
|
||||||
<p>Render count: {renderCount.current}</p>
|
<p>Render count: {renderCount.current}</p>
|
||||||
)}
|
)}
|
||||||
{/* Your component JSX here */}
|
|
||||||
{format === '' && value === '' ? (
|
{format === '' && value === '' ? (
|
||||||
<p>No image set in the backend.</p>
|
<p>No image set in the backend.</p>
|
||||||
) : (
|
) : (
|
||||||
|
@ -39,15 +39,6 @@ export const MethodComponent = React.memo((props: MethodProps) => {
|
|||||||
triggerNotification();
|
triggerNotification();
|
||||||
};
|
};
|
||||||
|
|
||||||
const formContent = (
|
|
||||||
<Form onSubmit={execute} ref={formRef}>
|
|
||||||
<Button className="component" variant="primary" type="submit">
|
|
||||||
{`${displayName} `}
|
|
||||||
<DocStringComponent docString={docString} />
|
|
||||||
</Button>
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
renderCount.current++;
|
renderCount.current++;
|
||||||
});
|
});
|
||||||
@ -57,7 +48,12 @@ export const MethodComponent = React.memo((props: MethodProps) => {
|
|||||||
{process.env.NODE_ENV === 'development' && (
|
{process.env.NODE_ENV === 'development' && (
|
||||||
<div>Render count: {renderCount.current}</div>
|
<div>Render count: {renderCount.current}</div>
|
||||||
)}
|
)}
|
||||||
<div>{formContent}</div>
|
<Form onSubmit={execute} ref={formRef}>
|
||||||
|
<Button className="component" variant="primary" type="submit">
|
||||||
|
{`${displayName} `}
|
||||||
|
<DocStringComponent docString={docString} />
|
||||||
|
</Button>
|
||||||
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user