-
Notifications
You must be signed in to change notification settings - Fork 90
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
Remove bluetooth status #499
Changes from all commits
13f035a
88652cc
8338a3b
47aaa12
aa99968
dabc9d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum BatteryCodes { | ||
STATUS = 54108, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum BluetoothCodes { | ||
PAIRING = 54109, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum EnergyCodes { | ||
STATUS = 54111, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum RFCodes { | ||
STATUS = 54112, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ import Dropdown from "react-bootstrap/Dropdown"; | |
|
||
import i18n from "@Renderer/i18n"; | ||
import { SelectWirelessDropdownProps, WirelessButton } from "@Renderer/types/wireless"; | ||
import { BluetoothCodes } from "@Renderer/../hw/bluetooth"; | ||
import { BatteryCodes } from "@Renderer/../hw/battery"; | ||
|
||
const Style = Styled.div` | ||
width: 100%; | ||
|
@@ -137,12 +139,16 @@ width: 100%; | |
} | ||
`; | ||
|
||
enum WirelessButtonOrder { | ||
BATTERY_LEVEL = 0, | ||
PAIRING_MODE = 1, | ||
} | ||
|
||
function SelectWirelessDropdown(props: SelectWirelessDropdownProps) { | ||
const { keyCode, onKeySelect } = props; | ||
const WirelessButtons: Array<WirelessButton> = [ | ||
{ name: i18n.editor.standardView.wireless.batteryLevel, keynum: 54108 }, | ||
{ name: i18n.wireless.bluetooth.StatusButton, keynum: 54109 }, | ||
{ name: i18n.wireless.bluetooth.pairingModeButton, keynum: 54110 }, | ||
{ name: i18n.editor.standardView.wireless.batteryLevel, keynum: BatteryCodes.STATUS }, | ||
{ name: i18n.wireless.bluetooth.pairingModeButton, keynum: BluetoothCodes.PAIRING }, | ||
]; | ||
const KC: number = keyCode.base + keyCode.modified; | ||
// const verifiedKC = WirelessButtons.findIndex((param: WirelessButton) => param.keynum === KC); | ||
|
@@ -169,29 +175,17 @@ function SelectWirelessDropdown(props: SelectWirelessDropdownProps) { | |
</div> | ||
<div className="dropdown-group-buttons"> | ||
<Dropdown.Item | ||
eventKey={String(WirelessButtons[0].keynum)} | ||
key={`wirelessButtons-${0}`} | ||
disabled={WirelessButtons[0].keynum === -1} | ||
className={` | ||
${WirelessButtons[0].keynum === keyCode.base + keyCode.modified ? "active" : ""} dropdown-config-button`} | ||
> | ||
<div className="dropdownItem">{WirelessButtons[0].name}</div> | ||
</Dropdown.Item> | ||
</div> | ||
</div> | ||
<div className="dropdown-group wirelessSaving"> | ||
<div className="dropdownHeader"> | ||
Bluetooth <span>{i18n.wireless.bluetooth.StatusTitle}</span> | ||
</div> | ||
<div className="dropdown-group-buttons"> | ||
<Dropdown.Item | ||
eventKey={String(WirelessButtons[1].keynum)} | ||
key={`wirelessButtons-${1}`} | ||
disabled={WirelessButtons[1].keynum === -1} | ||
eventKey={String(WirelessButtons[WirelessButtonOrder.BATTERY_LEVEL].keynum)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AlexDygma @thiagohernandez No he mirado como hacemos los dropdown menus en Bazecor pero si es necesario estaría bueno en el futuro poner los dropdown values como string si se puede porque así no tenemos que rely on an array order como en este fichero. Quizás me ánimo y lo hago en otro PR |
||
key={`wirelessButtons-${WirelessButtonOrder.BATTERY_LEVEL}`} | ||
disabled={WirelessButtons[WirelessButtonOrder.BATTERY_LEVEL].keynum === -1} | ||
className={` | ||
${WirelessButtons[1].keynum === keyCode.base + keyCode.modified ? "active" : ""} dropdown-config-button`} | ||
${ | ||
WirelessButtons[WirelessButtonOrder.BATTERY_LEVEL].keynum === keyCode.base + keyCode.modified | ||
? "active" | ||
: "" | ||
} dropdown-config-button`} | ||
> | ||
<div className="dropdownItem">{WirelessButtons[1].name}</div> | ||
<div className="dropdownItem">{WirelessButtons[WirelessButtonOrder.BATTERY_LEVEL].name}</div> | ||
</Dropdown.Item> | ||
</div> | ||
</div> | ||
|
@@ -201,13 +195,15 @@ function SelectWirelessDropdown(props: SelectWirelessDropdownProps) { | |
</div> | ||
<div className="dropdown-group-buttons"> | ||
<Dropdown.Item | ||
eventKey={String(WirelessButtons[2].keynum)} | ||
key={`wirelessButtons-${2}`} | ||
disabled={WirelessButtons[2].keynum === -1} | ||
eventKey={String(WirelessButtons[WirelessButtonOrder.PAIRING_MODE].keynum)} | ||
key={`wirelessButtons-${WirelessButtonOrder.PAIRING_MODE}`} | ||
disabled={WirelessButtons[WirelessButtonOrder.PAIRING_MODE].keynum === -1} | ||
className={` | ||
${WirelessButtons[2].keynum === keyCode.base + keyCode.modified ? "active" : ""} dropdown-config-button`} | ||
${ | ||
WirelessButtons[WirelessButtonOrder.PAIRING_MODE].keynum === keyCode.base + keyCode.modified ? "active" : "" | ||
} dropdown-config-button`} | ||
> | ||
<div className="dropdownItem">{WirelessButtons[2].name}</div> | ||
<div className="dropdownItem">{WirelessButtons[WirelessButtonOrder.PAIRING_MODE].name}</div> | ||
</Dropdown.Item> | ||
</div> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault que se me ha colado del otro branch, ignorar este file para este cambio