fix: digits inputs in ltr mode
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
|
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Harmony club</title>
|
<title>Harmony Accounts</title>
|
||||||
<!-- this script add for preventing initial theme flashing -->
|
<!-- this script add for preventing initial theme flashing -->
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
|
|||||||
6364
package-lock 2.json
6364
package-lock 2.json
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@ import React, {
|
|||||||
type KeyboardEvent,
|
type KeyboardEvent,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { TextField, Stack } from '@mui/material';
|
import { TextField, Stack } from '@mui/material';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
interface DigitInputProps {
|
interface DigitInputProps {
|
||||||
error: boolean;
|
error: boolean;
|
||||||
@@ -20,6 +21,7 @@ const DigitInput: React.FC<DigitInputProps> = ({
|
|||||||
success,
|
success,
|
||||||
}) => {
|
}) => {
|
||||||
const [code, setCode] = useState<string[]>(['', '', '', '']);
|
const [code, setCode] = useState<string[]>(['', '', '', '']);
|
||||||
|
const { i18n } = useTranslation();
|
||||||
const inputRefs = useRef<Array<HTMLInputElement | null>>([]);
|
const inputRefs = useRef<Array<HTMLInputElement | null>>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -78,7 +80,7 @@ const DigitInput: React.FC<DigitInputProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
direction="row-reverse"
|
direction={i18n.dir() == 'ltr' ? 'row' : 'row-reverse'}
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
sx={{ gap: 2, width: '100%', my: 4 }}
|
sx={{ gap: 2, width: '100%', my: 4 }}
|
||||||
justifyContent="center"
|
justifyContent="center"
|
||||||
|
|||||||
Reference in New Issue
Block a user