@@ -42,26 +42,26 @@ const stepReducer = (
4242 ...state ,
4343 step :
4444 state . dataProvider === 'ra-data-fakerest'
45- ? 'generate '
45+ ? 'install '
4646 : 'resources' ,
4747 authProvider : action . value ,
4848 } ;
4949 case 'resources' :
5050 return {
5151 ...state ,
52- step : 'generate ' ,
52+ step : 'install ' ,
5353 resources : action . value ,
5454 } ;
55- case 'generate ' :
55+ case 'install ' :
5656 return {
5757 ...state ,
58- step : 'install' ,
58+ installer : action . value ,
59+ step : 'generate' ,
5960 } ;
60- case 'install ' :
61+ case 'generate ' :
6162 return {
6263 ...state ,
63- installer : action . value ,
64- step : action . value ? 'run-install' : 'finish' ,
64+ step : state . installer ? 'run-install' : 'finish' ,
6565 } ;
6666 case 'run-install' :
6767 return {
@@ -98,16 +98,16 @@ export default function App({ name = 'my-admin' }: Props) {
9898 if ( state . step === 'resources' ) {
9999 return < StepResources onSubmit = { handleSubmit } /> ;
100100 }
101+ if ( state . step === 'install' ) {
102+ return < StepInstall onSubmit = { handleSubmit } /> ;
103+ }
101104 if ( state . step === 'generate' ) {
102105 generateProject ( state ) . then ( messages => {
103106 helpMessages . current = messages ;
104107 dispatch ( { } ) ;
105108 } ) ;
106109 return < Text > Generating your application...</ Text > ;
107110 }
108- if ( state . step === 'install' ) {
109- return < StepInstall onSubmit = { handleSubmit } /> ;
110- }
111111 if ( state . step === 'run-install' ) {
112112 installDeps ( state ) . then ( ( ) => {
113113 dispatch ( { } ) ;
@@ -125,16 +125,33 @@ export default function App({ name = 'my-admin' }: Props) {
125125 < Text >
126126 To start working, run < Text bold > cd { state . name } </ Text > .
127127 </ Text >
128- < Text >
129- Start the app in development mode by running{ ' ' }
130- < Text bold >
131- { state . installer === 'npm' ? 'npm run' : 'yarn' } dev
128+ { state . installer ? (
129+ < Text >
130+ Start the app in development mode by running{ ' ' }
131+ < Text bold >
132+ { state . installer === 'npm' ? 'npm run' : 'yarn' } dev
133+ </ Text >
134+ .
132135 </ Text >
133- .
134- </ Text >
136+ ) : (
137+ < Box >
138+ < Box >
139+ < Text >
140+ Install the dependencies using your favorite package
141+ manager.
142+ </ Text >
143+ </ Box >
144+ < Box >
145+ < Text >
146+ Run the < Text bold > dev</ Text > command to start the
147+ app.
148+ </ Text >
149+ </ Box >
150+ </ Box >
151+ ) }
135152 < Box marginBottom = { 1 } >
136- { helpMessages . current . map ( line => (
137- < Text key = { line } > { line } </ Text >
153+ { helpMessages . current . map ( ( line , index ) => (
154+ < Text key = { index } > { line } </ Text >
138155 ) ) }
139156 </ Box >
140157 </ >
0 commit comments