Skip to content

Commit

Permalink
Extract number count
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianBouron committed Nov 24, 2024
1 parent 8982345 commit 2971833
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { PageWithStepper } from '../../../../templates';
import { ECDSA } from 'xrpl';
import { SecretNumberInput } from '../../../../atoms';

const schemaInput = new RegExp(/^[0-9]{6}$/);

type InputErrors = {
numbersA: string;
numbersB: string;
Expand All @@ -24,6 +22,8 @@ type InputErrors = {
};

const DIGIT_ERROR = 'You need 6 digits';
const NUMBERS_COUNT = 8;
const schemaInput = new RegExp(/^[0-9]{6}$/);

export interface ImportSecretNumbersProps {
activeStep: number;
Expand Down Expand Up @@ -113,7 +113,7 @@ export const ImportSecretNumbers: FC<ImportSecretNumbersProps> = ({
Please enter your secret numbers in order to load your wallet to GemWallet.
</Typography>
<Grid container rowSpacing={0} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
{Array.from({ length: 8 }, (_, i) => {
{Array.from({ length: NUMBERS_COUNT }, (_, i) => {
const id = `numbers${String.fromCharCode(65 + i)}` as keyof InputErrors;
return (
<SecretNumberInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { PageWithStepper } from '../../../templates';
import { ECDSA } from 'xrpl';
import { SecretNumberInput } from '../../../atoms';

const schemaInput = new RegExp(/^[0-9]{6}$/);

type InputErrors = {
numbersA: string;
numbersB: string;
Expand All @@ -23,6 +21,8 @@ type InputErrors = {
};

const DIGIT_ERROR = 'You need 6 digits';
const NUMBERS_COUNT = 8;
const schemaInput = new RegExp(/^[0-9]{6}$/);

export interface SecretNumbersProps {
activeStep: number;
Expand Down Expand Up @@ -101,7 +101,7 @@ export const SecretNumbers: FC<SecretNumbersProps> = ({ activeStep, steps, onBac
Please enter your secret numbers in order to load your wallet to GemWallet.
</Typography>
<Grid container rowSpacing={0} columnSpacing={{ xs: 1, sm: 2, md: 3 }}>
{Array.from({ length: 8 }, (_, i) => {
{Array.from({ length: NUMBERS_COUNT }, (_, i) => {
const id = `numbers${String.fromCharCode(65 + i)}` as keyof InputErrors;
return (
<SecretNumberInput
Expand Down

0 comments on commit 2971833

Please sign in to comment.