From 0e9832e2f1d4dfd1779017a533a1f017e2ac1c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Tue, 16 Jan 2024 12:55:18 +0100 Subject: [PATCH] updates DocStringComponent placement --- frontend/src/components/AsyncMethodComponent.tsx | 8 +++----- frontend/src/components/ButtonComponent.tsx | 2 +- frontend/src/components/ColouredEnumComponent.tsx | 6 ++++-- frontend/src/components/EnumComponent.tsx | 6 ++++-- frontend/src/components/GenericComponent.tsx | 4 ++-- frontend/src/components/ImageComponent.tsx | 5 +++-- frontend/src/components/MethodComponent.tsx | 2 +- frontend/src/components/NumberComponent.tsx | 8 ++++++-- frontend/src/components/SliderComponent.tsx | 6 ++++-- frontend/src/components/StringComponent.tsx | 6 ++++-- 10 files changed, 32 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/AsyncMethodComponent.tsx b/frontend/src/components/AsyncMethodComponent.tsx index 145b0fc..3d507fc 100644 --- a/frontend/src/components/AsyncMethodComponent.tsx +++ b/frontend/src/components/AsyncMethodComponent.tsx @@ -102,14 +102,12 @@ export const AsyncMethodComponent = React.memo((props: AsyncMethodProps) => { {process.env.NODE_ENV === 'development' && (
Render count: {renderCount.current}
)} -
- Function: {displayName} - -
+
Function: {displayName}
{args}
diff --git a/frontend/src/components/ButtonComponent.tsx b/frontend/src/components/ButtonComponent.tsx index 8d8f868..ad01b01 100644 --- a/frontend/src/components/ButtonComponent.tsx +++ b/frontend/src/components/ButtonComponent.tsx @@ -48,7 +48,6 @@ export const ButtonComponent = React.memo((props: ButtonComponentProps) => {
Render count: {renderCount.current}
)} - { disabled={readOnly} onChange={(e) => setChecked(e.currentTarget.checked)}> {displayName} + ); diff --git a/frontend/src/components/ColouredEnumComponent.tsx b/frontend/src/components/ColouredEnumComponent.tsx index 0f5f5c0..bf6cf8b 100644 --- a/frontend/src/components/ColouredEnumComponent.tsx +++ b/frontend/src/components/ColouredEnumComponent.tsx @@ -53,10 +53,12 @@ export const ColouredEnumComponent = React.memo((props: ColouredEnumComponentPro {process.env.NODE_ENV === 'development' && (
Render count: {renderCount.current}
)} - - {displayName} + + {displayName} + + {readOnly ? ( // Display the Form.Control when readOnly is true { {process.env.NODE_ENV === 'development' && (
Render count: {renderCount.current}
)} - - {displayName} + + {displayName} + + { onClick={() => setOpen(!open)} style={{ cursor: 'pointer' }} // Change cursor style on hover > - {displayName} {open ? : } + {displayName} + + {open ? : } {process.env.NODE_ENV === 'development' && (

Render count: {renderCount.current}

)} - {/* Your component JSX here */} {format === '' && value === '' ? (

No image set in the backend.

diff --git a/frontend/src/components/MethodComponent.tsx b/frontend/src/components/MethodComponent.tsx index 82cc9a4..7b55f89 100644 --- a/frontend/src/components/MethodComponent.tsx +++ b/frontend/src/components/MethodComponent.tsx @@ -89,12 +89,12 @@ export const MethodComponent = React.memo((props: MethodProps) => { )}
setHideOutput(!hideOutput)} style={{ cursor: 'pointer' }}> Function: {displayName} -
{args}
diff --git a/frontend/src/components/NumberComponent.tsx b/frontend/src/components/NumberComponent.tsx index dd2481d..719319e 100644 --- a/frontend/src/components/NumberComponent.tsx +++ b/frontend/src/components/NumberComponent.tsx @@ -313,10 +313,14 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => { {process.env.NODE_ENV === 'development' && (
Render count: {renderCount.current}
)} -
- {showName && {displayName}} + {showName && ( + + {displayName} + + + )} {
Render count: {renderCount.current}
)} - - {displayName} + + {displayName} + + { {process.env.NODE_ENV === 'development' && (
Render count: {renderCount.current}
)} - - {displayName} + + {displayName} + +