Skip to content

Commit 9d43f35

Browse files
fix: improve skip logic
1 parent e07f256 commit 9d43f35

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

source/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const App = () => {
1717
const [setupType, setSetupType] = useState<InstallationSelectItem | undefined>()
1818
const [selectedFeatures, setSelectedFeatures] = useState<Array<MultiSelectItem> | undefined>()
1919

20-
const finishStep = useCallback(() => setCurrentStep(currentStep + 1), [currentStep])
20+
const finishStep = useCallback(() => setCurrentStep((prevStep) => prevStep + 1), [])
2121
const onSelectSetupType = useCallback((item: InstallationSelectItem) => setSetupType(item), [])
2222
const onSelectSelectedFeatures = useCallback(
2323
(selectedItems: Array<MultiSelectItem>) => setSelectedFeatures([...selectedItems]),

source/components/steps/OptionalPackages.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Text } from 'ink'
2-
import { type FC, useState } from 'react'
2+
import { type FC, useEffect, useState } from 'react'
33
import type { MultiSelectItem } from '../../types/types.js'
44
import MultiSelect from '../Multiselect/index.js'
55

@@ -42,10 +42,13 @@ interface Props {
4242
const OptionalPackages: FC<Props> = ({ onCompletion, onSubmit, skip = false }) => {
4343
const [isFocused, setIsFocused] = useState(true)
4444

45-
// full installation, do nothing
46-
if (skip) {
47-
onCompletion()
48-
}
45+
// biome-ignore lint/correctness/useExhaustiveDependencies: Run this only once, no matter what
46+
useEffect(() => {
47+
// full installation, do nothing
48+
if (skip) {
49+
onCompletion()
50+
}
51+
}, [])
4952

5053
const onHandleSubmit = (selectedItems: Array<MultiSelectItem>) => {
5154
onSubmit(selectedItems)

source/components/steps/PostInstall.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ const SubgraphWarningMessage: FC = () => (
2626
{figures.warning}
2727
</Text>
2828
</Box>
29-
<Text bold>Follow these steps:</Text>
29+
<Text color={'whiteBright'}>Follow these steps:</Text>
3030
<Box flexDirection={'column'}>
3131
<Text>
32-
1- Provide your own API key for <Text bold>PUBLIC_SUBGRAPHS_API_KEY</Text> in{' '}
33-
<Text bold>.env.local</Text> You can get one{' '}
32+
1- Provide your own API key for <Text color={'gray'}>PUBLIC_SUBGRAPHS_API_KEY</Text> in{' '}
33+
<Text color={'gray'}>.env.local</Text> You can get one{' '}
3434
<Link url="https://thegraph.com/studio/apikeys">here</Link>
3535
</Text>
3636
<Text>
37-
2- After the API key is correctly configured, run <Text bold>pnpm subgraph-codegen</Text> in
38-
your console from the project's folder
37+
2- After the API key is correctly configured, run{' '}
38+
<Text color={'gray'}>pnpm subgraph-codegen</Text> in your console from the project's folder
3939
</Text>
4040
</Box>
4141
<Text>
@@ -57,23 +57,23 @@ const PostInstallMessage: FC<{ projectName: string }> = ({ projectName }) => (
5757
rowGap={1}
5858
paddingBottom={2}
5959
>
60-
<Text bold>To start development on your project:</Text>
60+
<Text color={'whiteBright'}>To start development on your project:</Text>
6161
<Box flexDirection={'column'}>
6262
<Text>
63-
1- Move into the project's folder with <Text bold>cd {projectName}</Text>
63+
1- Move into the project's folder with <Text color={'gray'}>cd {projectName}</Text>
6464
</Text>
6565
<Text>
66-
2- Start the development server with <Text bold>pnpm dev</Text>
66+
2- Start the development server with <Text color={'gray'}>pnpm dev</Text>
6767
</Text>
6868
</Box>
69-
<Text bold>More info:</Text>
69+
<Text color={'whiteBright'}>More info:</Text>
7070
<Box flexDirection={'column'}>
7171
<Text>
72-
- Check out <Text bold>.env.local</Text> for more configurations.
72+
- Check out <Text color={'gray'}>.env.local</Text> for more configurations.
7373
</Text>
7474
<Text>
7575
- Read <Link url="https://docs.dappbooster.dev">the docs</Link> to know more about{' '}
76-
<Text bold>dAppBooster</Text>!
76+
<Text color={'gray'}>dAppBooster</Text>!
7777
</Text>
7878
<Text>
7979
- Report issues with this installer{' '}

0 commit comments

Comments
 (0)