Skip to content

Commit cdfa28c

Browse files
refactor: rename identifiers
1 parent 000d5de commit cdfa28c

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

source/app.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { Box } from 'ink'
1+
import {Box} from 'ink'
22
import Divider from 'ink-divider'
3-
import React, { useState } from 'react'
3+
import React, {useState} from 'react'
44
import Step1 from './import/Step1.js'
55
import Step2 from './import/Step2.js'
6-
import { canShowStep } from './import/utils.js'
6+
import {canShowStep} from './import/utils.js'
77

88
const App = () => {
99
const [projectName, setProjectName] = useState<string>('')
10-
const [step, setStep] = useState(1)
10+
const [currentStep, setCurrentStep] = useState(1)
1111

12-
const finishStep = () => setStep(step + 1)
12+
const finishStep = () => setCurrentStep(currentStep + 1)
1313

1414
return (
1515
<Box
@@ -21,13 +21,13 @@ const App = () => {
2121
onCompletion={finishStep}
2222
projectName={projectName}
2323
/>
24-
{canShowStep(step, 2) && (
24+
{canShowStep(currentStep, 2) && (
2525
<Step2
2626
projectName={projectName}
2727
onCompletion={finishStep}
2828
/>
2929
)}
30-
{canShowStep(step, 3) && (
30+
{canShowStep(currentStep, 3) && (
3131
<Divider
3232
titlePadding={2}
3333
titleColor={'whiteBright'}

source/import/CloneRepo.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { join } from 'node:path'
1+
import {join} from 'node:path'
22
import * as process from 'node:process'
3-
import { Box, Text } from 'ink'
4-
import { Script, Spawn } from 'ink-spawn'
5-
import React, { useState, type FC } from 'react'
6-
import { repoUrl } from './config.js'
7-
import { canShowStep } from './utils.js'
3+
import {Box, Text} from 'ink'
4+
import {Script, Spawn} from 'ink-spawn'
5+
import React, {useState, type FC} from 'react'
6+
import {repoUrl} from './config.js'
7+
import {canShowStep} from './utils.js'
88

99
interface Props {
1010
projectName: string
@@ -14,19 +14,19 @@ interface Props {
1414
/**
1515
* @description Clone the repository
1616
*/
17-
const CloneRepo: FC<Props> = ({ projectName, onCompletion }) => {
17+
const CloneRepo: FC<Props> = ({projectName, onCompletion}) => {
1818
const projectDir = join(process.cwd(), projectName)
19-
const [step, setStep] = useState(1)
19+
const [currentStep, setCurrentStep] = useState(1)
2020

21-
const finishStep = () => setStep(step + 1)
21+
const finishStep = () => setCurrentStep(currentStep + 1)
2222

2323
return (
2424
<Box
2525
flexDirection={'column'}
2626
gap={0}
2727
>
2828
<Script>
29-
{canShowStep(step, 1) && (
29+
{canShowStep(currentStep, 1) && (
3030
<>
3131
<Text color={'whiteBright'}>Cloning dAppBooster in </Text>
3232
<Text italic>{projectName}</Text>
@@ -44,7 +44,7 @@ const CloneRepo: FC<Props> = ({ projectName, onCompletion }) => {
4444
command="git"
4545
args={['clone', '--depth', '1', '--no-checkout', repoUrl, projectName]}
4646
/>
47-
{canShowStep(step, 2) && <Text color={'whiteBright'}>Fetching tags</Text>}
47+
{canShowStep(currentStep, 2) && <Text color={'whiteBright'}>Fetching tags</Text>}
4848
<Spawn
4949
shell
5050
cwd={projectDir}
@@ -58,7 +58,7 @@ const CloneRepo: FC<Props> = ({ projectName, onCompletion }) => {
5858
finishStep()
5959
}}
6060
/>
61-
{canShowStep(step, 3) && <Text color={'whiteBright'}>Checking out latest tag</Text>}
61+
{canShowStep(currentStep, 3) && <Text color={'whiteBright'}>Checking out latest tag</Text>}
6262
<Spawn
6363
shell
6464
cwd={projectDir}
@@ -70,7 +70,7 @@ const CloneRepo: FC<Props> = ({ projectName, onCompletion }) => {
7070
finishStep()
7171
}}
7272
/>
73-
{canShowStep(step, 4) && <Text color={'whiteBright'}>Removing .git folder</Text>}
73+
{canShowStep(currentStep, 4) && <Text color={'whiteBright'}>Removing .git folder</Text>}
7474
<Spawn
7575
shell
7676
cwd={projectDir}
@@ -82,7 +82,7 @@ const CloneRepo: FC<Props> = ({ projectName, onCompletion }) => {
8282
finishStep()
8383
}}
8484
/>
85-
{canShowStep(step, 5) && <Text color={'whiteBright'}>Initializing Git repository</Text>}
85+
{canShowStep(currentStep, 5) && <Text color={'whiteBright'}>Initializing Git repository</Text>}
8686
<Spawn
8787
shell
8888
cwd={projectDir}

0 commit comments

Comments
 (0)