From da03963c6a1fc1217a1209119950eadfd465666e Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Thu, 30 May 2024 15:19:35 +0530 Subject: [PATCH] Camera Feed: Improve watermark and preset sizes in mobile view (#7935) * Camera Feed: Improve watermark and preset sizes in mobile view * adds notification and correct sizes * decrease watermark opacity to 20 * fixed width for preset sizes * add warning for char. limit of preset name * add banding for mobile landscape view to maintain aspect ratio and fit feed content * min width for preset buttons * improve responsiveness --- src/CAREUI/display/NetworkSignal.tsx | 8 +++- .../Assets/configure/CameraConfigure.tsx | 9 ++++- src/Components/CameraFeed/AssetBedSelect.tsx | 38 +++++++++++-------- src/Components/CameraFeed/CameraFeed.tsx | 8 ++-- src/Components/CameraFeed/FeedWatermark.tsx | 6 +-- .../ConsultationFeedTab.tsx | 6 ++- 6 files changed, 49 insertions(+), 26 deletions(-) diff --git a/src/CAREUI/display/NetworkSignal.tsx b/src/CAREUI/display/NetworkSignal.tsx index 2bcd2744acb..1d5f2d49623 100644 --- a/src/CAREUI/display/NetworkSignal.tsx +++ b/src/CAREUI/display/NetworkSignal.tsx @@ -19,7 +19,7 @@ export default function NetworkSignal({ strength, children }: Props) { return (
)) )} + {!!strength && strength < 2 && ( + + )}
{children} diff --git a/src/Components/Assets/configure/CameraConfigure.tsx b/src/Components/Assets/configure/CameraConfigure.tsx index c3ba434ef3f..5a8ccd5c184 100644 --- a/src/Components/Assets/configure/CameraConfigure.tsx +++ b/src/Components/Assets/configure/CameraConfigure.tsx @@ -7,6 +7,7 @@ import { getCameraConfig } from "../../../Utils/transformUtils"; import { Submit } from "../../Common/components/ButtonV2"; import TextFormField from "../../Form/FormFields/TextFormField"; import Card from "../../../CAREUI/display/Card"; +import { FieldErrorText } from "../../Form/FormFields/FormField"; interface CameraConfigureProps { asset: AssetData; @@ -59,8 +60,14 @@ export default function CameraConfigure(props: CameraConfigureProps) { value={newPreset} className="mt-1" onChange={(e) => setNewPreset(e.value)} - error="" + errorClassName="hidden" /> + {newPreset.length > 12 && ( + + )}
diff --git a/src/Components/CameraFeed/AssetBedSelect.tsx b/src/Components/CameraFeed/AssetBedSelect.tsx index 715c326c35d..56def3d41c9 100644 --- a/src/Components/CameraFeed/AssetBedSelect.tsx +++ b/src/Components/CameraFeed/AssetBedSelect.tsx @@ -15,17 +15,17 @@ export default function CameraPresetSelect(props: Props) { const label = props.label ?? defaultLabel; return ( <> -
+
{/* Desktop View */} {props.options .slice(0, props.options.length > 5 ? 4 : 5) .map((option) => ( ))} {props.options.length > 5 && ( - + o.id === props.value?.id)} + /> )}
-
+
{/* Mobile View */}
@@ -54,17 +58,19 @@ export const CameraPresetDropdown = (props: Props) => { return (
- - + + {selected ? label(selected) : "Select preset"} - - + + { leaveFrom="opacity-100" leaveTo="opacity-0" > - + {options?.map((obj) => ( { {({ selected }) => ( <> diff --git a/src/Components/CameraFeed/CameraFeed.tsx b/src/Components/CameraFeed/CameraFeed.tsx index 81b526363b9..a5f0a3d80e0 100644 --- a/src/Components/CameraFeed/CameraFeed.tsx +++ b/src/Components/CameraFeed/CameraFeed.tsx @@ -96,13 +96,13 @@ export default function CameraFeed(props: Props) { props.className, )} > -
+
{props.children}
- + {props.asset.name} @@ -170,7 +170,7 @@ export default function CameraFeed(props: Props) { ) : (