From 951330eac436d3cbebd574cd3817f028d6cb30fb Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 6 Dec 2023 16:18:11 +0530 Subject: [PATCH] update reponsiveness --- src/Components/CameraFeed/AssetBedSelect.tsx | 8 +- src/Components/CameraFeed/CameraFeed.tsx | 4 +- .../CameraFeed/CameraFeedWithBedPresets.tsx | 2 +- src/Components/CameraFeed/FeedButton.tsx | 2 +- src/Components/CameraFeed/FeedControls.tsx | 263 +++++++++--------- src/Components/CameraFeed/NoFeedAvailable.tsx | 2 +- 6 files changed, 144 insertions(+), 137 deletions(-) diff --git a/src/Components/CameraFeed/AssetBedSelect.tsx b/src/Components/CameraFeed/AssetBedSelect.tsx index 8715b480642..17701dccbde 100644 --- a/src/Components/CameraFeed/AssetBedSelect.tsx +++ b/src/Components/CameraFeed/AssetBedSelect.tsx @@ -31,7 +31,7 @@ export default function AssetBedSelect(props: Props) { return (
- + {selected?.bed_object.name ?? "No Preset"} @@ -45,7 +45,7 @@ export default function AssetBedSelect(props: Props) { leaveFrom="opacity-100" leaveTo="opacity-0" > - + {data?.results.map((obj) => ( ( <> - {obj.bed_object.name} + {obj.bed_object.name}: {obj.meta.preset_name} )} diff --git a/src/Components/CameraFeed/CameraFeed.tsx b/src/Components/CameraFeed/CameraFeed.tsx index fe3a11bf8e0..4ec039e4e70 100644 --- a/src/Components/CameraFeed/CameraFeed.tsx +++ b/src/Components/CameraFeed/CameraFeed.tsx @@ -96,8 +96,8 @@ export default function CameraFeed(props: Props) { )} >
-
- +
+ {props.asset.name}
diff --git a/src/Components/CameraFeed/CameraFeedWithBedPresets.tsx b/src/Components/CameraFeed/CameraFeedWithBedPresets.tsx index 5c5d6452a47..b52071a8597 100644 --- a/src/Components/CameraFeed/CameraFeedWithBedPresets.tsx +++ b/src/Components/CameraFeed/CameraFeedWithBedPresets.tsx @@ -19,7 +19,7 @@ export default function LocationFeedTile(props: Props) { preset={preset?.meta.position} shortcutsDisabled > -
+
{ interface Props { shortcutsDisabled?: boolean; - onMove?: (payload: PTZPayload) => void; + onMove: (payload: PTZPayload) => void; isFullscreen: boolean; setFullscreen: (state: boolean) => void; onReset: () => void; } -export default function FeedControls({ - shortcutsDisabled, - onMove, - ...props -}: Props) { +export default function FeedControls({ shortcutsDisabled, ...props }: Props) { const [precision, setPrecision] = useState(1); const togglePrecision = () => setPrecision((p) => (p === 16 ? 1 : p << 1)); - const move = - onMove && - ((direction: number) => () => onMove(payload(direction, precision))); + const move = (direction: number) => () => { + props.onMove(payload(direction, precision)); + }; return (
- {/* Move Controls */} - {move && ( - <> -
-
- - - - - - - - - - - - - - - {precision}x - - - - - - - - - - - - - - - - - -
-
- -
-
- - - - - - - - - - {/* TODO: implement this when this is used in where presets can be saved. */} - {/* +
    +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • + +
  • + + {precision}x + +
  • + +
  • + + + +
  • + +
  • + + + +
  • + +
  • + + + +
  • + +
  • + + + +
  • +
+
+ +
+
+ + + + + + + + + + {/* TODO: implement this when this is used in where presets can be saved. */} + {/* */} - props.setFullscreen(!props.isFullscreen)} - shortcutsDisabled={shortcutsDisabled} - > - - -
-
- - )} + props.setFullscreen(!props.isFullscreen)} + shortcutsDisabled={shortcutsDisabled} + > + + +
+
); } diff --git a/src/Components/CameraFeed/NoFeedAvailable.tsx b/src/Components/CameraFeed/NoFeedAvailable.tsx index 31af0083556..9056ed11bfc 100644 --- a/src/Components/CameraFeed/NoFeedAvailable.tsx +++ b/src/Components/CameraFeed/NoFeedAvailable.tsx @@ -28,7 +28,7 @@ export default function NoFeedAvailable(props: Props) { > {props.message} - + {redactedURL}