Feature/new fields
This commit is contained in:
11
src/core/components/LtrTextField.jsx
Normal file
11
src/core/components/LtrTextField.jsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { styled, TextField } from "@mui/material";
|
||||
|
||||
const LtrTextField = styled(TextField)`
|
||||
.MuiInputBase-input {
|
||||
/* @noflip */
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
`;
|
||||
|
||||
export default LtrTextField;
|
||||
23
src/core/components/PriceField.jsx
Normal file
23
src/core/components/PriceField.jsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
import { useTranslations } from "next-intl";
|
||||
import LtrTextField from "@/core/components/LtrTextField";
|
||||
|
||||
const PriceField = (props) => {
|
||||
const t = useTranslations();
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<Stack>
|
||||
<LtrTextField {...props} />
|
||||
</Stack>
|
||||
<Stack direction="row" alignItems="center">
|
||||
<Typography sx={{ margin: 1 }} component="span">
|
||||
{(props.value / 10).toLocaleString()}
|
||||
</Typography>
|
||||
<Typography component="span" variant="caption" color={"gray"}>
|
||||
{t("PriceField.toman")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default PriceField;
|
||||
Reference in New Issue
Block a user