All CC screen improvements + date type changes. BOD-235 BOD-233
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Slider } from "antd";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useEffect, useState, forwardRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const CourtesyCarFuelComponent = ({ value = 100, onChange }) => {
|
||||
const CourtesyCarFuelComponent = ({ value = 100, onChange }, ref) => {
|
||||
const [option, setOption] = useState(value);
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -15,9 +15,9 @@ const CourtesyCarFuelComponent = ({ value = 100, onChange }) => {
|
||||
const marks = {
|
||||
0: {
|
||||
style: {
|
||||
color: "#f50"
|
||||
color: "#f50",
|
||||
},
|
||||
label: t("courtesycars.labels.fuel.empty")
|
||||
label: t("courtesycars.labels.fuel.empty"),
|
||||
},
|
||||
13: t("courtesycars.labels.fuel.18"),
|
||||
25: t("courtesycars.labels.fuel.14"),
|
||||
@@ -28,14 +28,15 @@ const CourtesyCarFuelComponent = ({ value = 100, onChange }) => {
|
||||
88: t("courtesycars.labels.fuel.78"),
|
||||
100: {
|
||||
style: {
|
||||
color: "#008000"
|
||||
color: "#008000",
|
||||
},
|
||||
label: <strong>{t("courtesycars.labels.fuel.full")}</strong>
|
||||
}
|
||||
label: <strong>{t("courtesycars.labels.fuel.full")}</strong>,
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<Slider
|
||||
ref={ref}
|
||||
marks={marks}
|
||||
defaultValue={value}
|
||||
onChange={setOption}
|
||||
@@ -43,4 +44,4 @@ const CourtesyCarFuelComponent = ({ value = 100, onChange }) => {
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default CourtesyCarFuelComponent;
|
||||
export default forwardRef(CourtesyCarFuelComponent);
|
||||
|
||||
Reference in New Issue
Block a user