Skip to content

Commit

Permalink
changed sensor select translation keys #209
Browse files Browse the repository at this point in the history
  • Loading branch information
io53 committed Aug 14, 2024
1 parent 00c491a commit afdaeba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/SensorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MdArrowDropDown } from 'react-icons/md';
import i18next from 'i18next';
import { getSetting } from "../UnitHelper";

export const SensorPicker = ({ sensors, canBeSelected, onSensorChange, normalStyle }) => {
export const SensorPicker = ({ sensors, canBeSelected, onSensorChange, normalStyle, buttonText }) => {

const handleSensorChange = (selectedSensor) => {
onSensorChange(selectedSensor);
Expand Down Expand Up @@ -41,7 +41,7 @@ export const SensorPicker = ({ sensors, canBeSelected, onSensorChange, normalSty
rightIcon={<MdArrowDropDown size={26} className="buttonSideIcon" style={{}} />}
>
<Box pl={1} className={normalStyle ? "ddlItemAlt" : ""}>
{i18next.t("sensors")}
{buttonText || i18next.t("sensors")}
</Box>
</MenuButton>
<MenuList mt="2" zIndex={10} ml={2} maxH={"800px"} overflowY={"scroll"}>
Expand Down
4 changes: 2 additions & 2 deletions src/states/SensorCompare.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ function SensorCompare(props) {
</>
}

const selectSensorTitle = <div style={{ marginTop: 8, paddingRight: 8, fontWeight: 800, fontFamily: "mulish" }}>{i18next.t("select_sensor")}</div>
const selectSensorTitle = <div style={{ marginTop: 8, paddingRight: 8, fontWeight: 800, fontFamily: "mulish" }}>{i18next.t("sensors_select_label")}</div>
const selectSensor = <>
<SensorPicker sensors={sensors} canBeSelected={canBeSelected} onSensorChange={s => setSelectedSensors([...selectedSensors, s])} />
<SensorPicker sensors={sensors} canBeSelected={canBeSelected} buttonText={i18next.t("sensors_select_button")} onSensorChange={s => setSelectedSensors([...selectedSensors, s])} />
<Flex gap='2' wrap="wrap" mt={3} mb={3}>
{selectedSensors.map((sensor, index) => (
<Box key={index}>
Expand Down
4 changes: 2 additions & 2 deletions src/states/ShareCenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ const ShareCenter = () => {
let sensorsThatCanBeShared = mySensors.filter(x => x.sharedTo.length < pjson.settings.maxSharesPerSensor)
sensorsThatCanBeShared = sensorsThatCanBeShared.filter(sensor => !selectedSensors.includes(sensor.sensor));

const selectSensorTitle = <div style={{ marginTop: 8, paddingRight: 8, fontWeight: 800, fontFamily: "mulish" }}>{i18next.t("select_sensor")}</div>
const selectSensorTitle = <div style={{ marginTop: 8, paddingRight: 8, fontWeight: 800, fontFamily: "mulish" }}>{i18next.t("sensors_select_label")}</div>
const selectSensor = <>
<SensorPicker sensors={mySensors} canBeSelected={sensorsThatCanBeShared} onSensorChange={s => setSelectedSensors([...selectedSensors, s])} />
<SensorPicker sensors={mySensors} canBeSelected={sensorsThatCanBeShared} buttonText={i18next.t("sensors_select_button")} onSensorChange={s => setSelectedSensors([...selectedSensors, s])} />
<Flex gap='2' wrap="wrap" mt={3} mb={3}>
{selectedSensors.map((sensor, index) => (
<Box key={index}>
Expand Down

0 comments on commit afdaeba

Please sign in to comment.