Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added variable to toggle-hotkey #284

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/production-line/hotkeys-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ export const HotkeysComponent = ({
</strong>
Toggle Output Mute
</TempDiv>
<TempDiv>
<strong>
{(savedHotkeys?.pushToTalkHotkey || "").toUpperCase()}:{" "}
</strong>
Push to Talk
</TempDiv>
{!isProgramOutputLine && (
<TempDiv>
<strong>
{(savedHotkeys?.pushToTalkHotkey || "").toUpperCase()}:{" "}
</strong>
Push to Talk
</TempDiv>
)}
<TempDiv>
<strong>
{savedHotkeys?.increaseVolumeHotkey.toUpperCase()}:{" "}
Expand Down
132 changes: 68 additions & 64 deletions src/components/production-line/settings-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,39 +300,41 @@ export const SettingsModal = ({
/>
)}
</FormLabel>
<FormLabel>
<DecorativeLabel>Toggle push to talk: </DecorativeLabel>
<FormInput
id="hotkeyPushToTalk"
ref={(el) => setInputRef(2, el)}
type="text"
value={hotkeys.pushToTalkHotkey}
onChange={(e) =>
handleInputChange("pushToTalkHotkey", e.target.value)
}
placeholder="Enter hotkey"
maxLength={1}
onKeyDown={(e) => handleKeyDown(e, 2)}
/>
{errors.pushToTalkHotkey && (
<ErrorMessage
errors={{
longpresskey: { message: errors.pushToTalkHotkey },
}}
name="longpresskey"
as={<StyledWarningMessage className="error-message" />}
{!programOutPutLine && (
<FormLabel>
<DecorativeLabel>Toggle push to talk: </DecorativeLabel>
<FormInput
id="hotkeyPushToTalk"
ref={(el) => setInputRef(2, el)}
type="text"
value={hotkeys.pushToTalkHotkey}
onChange={(e) =>
handleInputChange("pushToTalkHotkey", e.target.value)
}
placeholder="Enter hotkey"
maxLength={1}
onKeyDown={(e) => handleKeyDown(e, 2)}
/>
)}
{!errors.pushToTalkHotkey && warning.pushToTalkHotkey && (
<ErrorMessage
errors={{
longpresskey: { message: warning.pushToTalkHotkey },
}}
name="longpresskey"
as={StyledWarningMessage}
/>
)}
</FormLabel>
{errors.pushToTalkHotkey && (
<ErrorMessage
errors={{
longpresskey: { message: errors.pushToTalkHotkey },
}}
name="longpresskey"
as={<StyledWarningMessage className="error-message" />}
/>
)}
{!errors.pushToTalkHotkey && warning.pushToTalkHotkey && (
<ErrorMessage
errors={{
longpresskey: { message: warning.pushToTalkHotkey },
}}
name="longpresskey"
as={StyledWarningMessage}
/>
)}
</FormLabel>
)}
<FormLabel>
<DecorativeLabel>Increase volume:</DecorativeLabel>
<FormInput
Expand Down Expand Up @@ -411,39 +413,41 @@ export const SettingsModal = ({
</FormLabel>
</>
)}
<FormLabel>
<DecorativeLabel>Toggle mute all microphones: </DecorativeLabel>
<FormInput
id="globalMuteMicrophones"
ref={(el) => setInputRef(3, el)}
type="text"
value={hotkeys.globalMuteHotkey}
onChange={(e) =>
handleInputChange("globalMuteHotkey", e.target.value)
}
placeholder="Enter hotkey"
maxLength={1}
onKeyDown={(e) => handleKeyDown(e, 3)}
/>
{errors.globalMuteHotkey && (
<ErrorMessage
errors={{
globalMuteHotkey: { message: errors.globalMuteHotkey },
}}
name="globalMuteHotkey"
as={<StyledWarningMessage className="error-message" />}
/>
)}
{!errors.globalMuteHotkey && warning.globalMuteHotkey && (
<ErrorMessage
errors={{
globalMuteHotkey: { message: warning.globalMuteHotkey },
}}
name="globalMuteHotkey"
as={StyledWarningMessage}
{!programOutPutLine && (
<FormLabel>
<DecorativeLabel>Toggle mute all microphones: </DecorativeLabel>
<FormInput
id="globalMuteMicrophones"
ref={(el) => setInputRef(3, el)}
type="text"
value={hotkeys.globalMuteHotkey}
onChange={(e) =>
handleInputChange("globalMuteHotkey", e.target.value)
}
placeholder="Enter hotkey"
maxLength={1}
onKeyDown={(e) => handleKeyDown(e, 3)}
/>
)}
</FormLabel>
{errors.globalMuteHotkey && (
<ErrorMessage
errors={{
globalMuteHotkey: { message: errors.globalMuteHotkey },
}}
name="globalMuteHotkey"
as={<StyledWarningMessage className="error-message" />}
/>
)}
{!errors.globalMuteHotkey && warning.globalMuteHotkey && (
<ErrorMessage
errors={{
globalMuteHotkey: { message: warning.globalMuteHotkey },
}}
name="globalMuteHotkey"
as={StyledWarningMessage}
/>
)}
</FormLabel>
)}
<ButtonDiv>
<CancelButton type="button" onClick={onClose}>
Cancel
Expand Down
Loading