From a98c81757ff0a15a5c88718ecb2dcb46a63d3b27 Mon Sep 17 00:00:00 2001 From: malmen237 Date: Mon, 22 Apr 2024 07:34:19 +0200 Subject: [PATCH 1/6] fix: added empty line in css and prop in exit-btn --- src/components/manage-productions/manage-productions.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/manage-productions/manage-productions.tsx b/src/components/manage-productions/manage-productions.tsx index 27230088..9653abbd 100644 --- a/src/components/manage-productions/manage-productions.tsx +++ b/src/components/manage-productions/manage-productions.tsx @@ -52,6 +52,7 @@ const VerifyButtons = styled.div` const Button = styled(ActionButton)` margin: 0 1rem 0 0; `; + const StyledBackBtnIcon = styled.div` margin: 0 0 3rem 0; `; @@ -113,7 +114,7 @@ export const ManageProductions = () => { return ( - + null} /> Remove Production From bd1a0342b9c4e6624f91f3d0fedf63ea944dd64e Mon Sep 17 00:00:00 2001 From: malmen237 Date: Mon, 22 Apr 2024 07:35:51 +0200 Subject: [PATCH 2/6] feat: updated exit-btn to be back-arrow-btn --- .../production-line/production-line.tsx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/components/production-line/production-line.tsx b/src/components/production-line/production-line.tsx index a15006f9..dc822eb9 100644 --- a/src/components/production-line/production-line.tsx +++ b/src/components/production-line/production-line.tsx @@ -1,6 +1,6 @@ import styled from "@emotion/styled"; import { FC, useCallback, useEffect, useState } from "react"; -import { useNavigate, useParams } from "react-router-dom"; +import { useParams } from "react-router-dom"; import { useGlobalState } from "../../global-state/context-provider.tsx"; import { useAudioInput } from "./use-audio-input.ts"; import { useRtcConnection } from "./use-rtc-connection.ts"; @@ -26,6 +26,7 @@ import { useLinePolling } from "./use-line-polling.ts"; import { useFetchProduction } from "../landing-page/use-fetch-production.ts"; import { useIsLoading } from "./use-is-loading.ts"; import { useCheckBadLineData } from "./use-check-bad-line-data.ts"; +import { NavigateToRootButton } from "../navigate-to-root-button/navigate-to-root-button.tsx"; const TempDiv = styled.div` padding: 1rem 0; @@ -41,10 +42,6 @@ const SmallText = styled.span` font-size: 1.6rem; `; -const ButtonWrapper = styled.span` - margin: 0 2rem 0 0; -`; - const ButtonIcon = styled.div` width: 2.5rem; display: inline-block; @@ -58,10 +55,13 @@ const UserControlBtn = styled(ActionButton)` text-align: left; `; +const StyledBackBtnIcon = styled.span` + margin: 0 2rem 0 0; +`; + export const ProductionLine: FC = () => { const { productionId: paramProductionId, lineId: paramLineId } = useParams(); const [{ joinProductionOptions }, dispatch] = useGlobalState(); - const navigate = useNavigate(); const [isInputMuted, setIsInputMuted] = useState(true); const [isOutputMuted, setIsOutputMuted] = useState(false); @@ -87,8 +87,7 @@ export const ProductionLine: FC = () => { type: "UPDATE_JOIN_PRODUCTION_OPTIONS", payload: null, }); - navigate("/"); - }, [dispatch, navigate]); + }, [dispatch]); useLineHotkeys({ muteInput, @@ -153,9 +152,9 @@ export const ProductionLine: FC = () => { return ( <> - - Exit - + + + {!loading && production && line && ( Production: {production.name}{" "} From cfd8fb8e3938715493d694ecd2b13f19fcb84f22 Mon Sep 17 00:00:00 2001 From: malmen237 Date: Mon, 22 Apr 2024 07:37:03 +0200 Subject: [PATCH 3/6] feat: added reset-prop to btn-component --- .../navigate-to-root-button.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/navigate-to-root-button/navigate-to-root-button.tsx b/src/components/navigate-to-root-button/navigate-to-root-button.tsx index 868e5d31..3f2b814b 100644 --- a/src/components/navigate-to-root-button/navigate-to-root-button.tsx +++ b/src/components/navigate-to-root-button/navigate-to-root-button.tsx @@ -9,11 +9,21 @@ const StyledBackBtn = styled(ActionButton)` width: 4rem; `; -export const NavigateToRootButton = () => { +export const NavigateToRootButton = ({ + resetOnExit, +}: { + resetOnExit: () => void | null; +}) => { const navigate = useNavigate(); return ( - navigate("/")}> + { + navigate("/"); + resetOnExit(); + }} + > ); From dbb4caed619ff65e9d298630d359e2031cdbf601 Mon Sep 17 00:00:00 2001 From: malmen237 Date: Mon, 22 Apr 2024 07:42:36 +0200 Subject: [PATCH 4/6] fix: removed old comment --- src/components/manage-productions/manage-productions.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/manage-productions/manage-productions.tsx b/src/components/manage-productions/manage-productions.tsx index 9653abbd..1467311e 100644 --- a/src/components/manage-productions/manage-productions.tsx +++ b/src/components/manage-productions/manage-productions.tsx @@ -109,7 +109,6 @@ export const ManageProductions = () => { setRemoveId(parseInt(value.productionId, 10)); }; - // TODO return button return ( From 32fe4042f53c74aff87d719eb2e6ffc2062f13aa Mon Sep 17 00:00:00 2001 From: malmen237 Date: Tue, 23 Apr 2024 13:14:58 +0200 Subject: [PATCH 5/6] fix: renamed div to button-wrapper --- src/components/production-line/production-line.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/production-line/production-line.tsx b/src/components/production-line/production-line.tsx index dc822eb9..054f3110 100644 --- a/src/components/production-line/production-line.tsx +++ b/src/components/production-line/production-line.tsx @@ -55,7 +55,7 @@ const UserControlBtn = styled(ActionButton)` text-align: left; `; -const StyledBackBtnIcon = styled.span` +const ButtonWrapper = styled.span` margin: 0 2rem 0 0; `; @@ -152,9 +152,9 @@ export const ProductionLine: FC = () => { return ( <> - + - + {!loading && production && line && ( Production: {production.name}{" "} From 910424c1bc9f72e59e95936c1cf6c2aec3b6742d Mon Sep 17 00:00:00 2001 From: malmen237 Date: Tue, 23 Apr 2024 13:16:05 +0200 Subject: [PATCH 6/6] fix: made reset-on-exit optional --- src/components/manage-productions/manage-productions.tsx | 2 +- .../navigate-to-root-button/navigate-to-root-button.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/manage-productions/manage-productions.tsx b/src/components/manage-productions/manage-productions.tsx index 1467311e..4852b37a 100644 --- a/src/components/manage-productions/manage-productions.tsx +++ b/src/components/manage-productions/manage-productions.tsx @@ -113,7 +113,7 @@ export const ManageProductions = () => { return ( - null} /> + Remove Production diff --git a/src/components/navigate-to-root-button/navigate-to-root-button.tsx b/src/components/navigate-to-root-button/navigate-to-root-button.tsx index 3f2b814b..5bd1930a 100644 --- a/src/components/navigate-to-root-button/navigate-to-root-button.tsx +++ b/src/components/navigate-to-root-button/navigate-to-root-button.tsx @@ -12,7 +12,7 @@ const StyledBackBtn = styled(ActionButton)` export const NavigateToRootButton = ({ resetOnExit, }: { - resetOnExit: () => void | null; + resetOnExit?: () => void; }) => { const navigate = useNavigate(); @@ -20,8 +20,10 @@ export const NavigateToRootButton = ({ { + if (resetOnExit) { + resetOnExit(); + } navigate("/"); - resetOnExit(); }} >