File tree Expand file tree Collapse file tree 4 files changed +29
-15
lines changed
generators/screen/templates Expand file tree Collapse file tree 4 files changed +29
-15
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " romulus-cli " : minor
3+ ---
4+
5+ Update the screen command
Original file line number Diff line number Diff line change @@ -127,10 +127,11 @@ App/
127127│ ├── Text/
128128│ │ ├── index.tsx
129129│ │ └── styles.ts
130- │ └── Utilities/
131- │ └── Environment/
132- │ ├── index.tsx
133- │ └── styles.ts
130+ │ ├── Utilities/
131+ │ │ └── Environment/
132+ │ │ ├── index.tsx
133+ │ │ └── styles.ts
134+ │ └── Router.tsx
134135├── Config/
135136│ ├── Locales/
136137│ │ └── en.json
162163├── Theme/
163164│ └── index.js
164165├── index.tsx
165- ├── Router.ts
166166└── Theme.ts
167167```
168168
Original file line number Diff line number Diff line change @@ -145,16 +145,25 @@ You should then import this screen into `App/Screens/index.ts` so it can be
145145easily added to the router.
146146
147147``` js
148+ import { Box } from " @mobily/stacks" ;
148149import React from " react" ;
149- import { NavigationStackScreenComponent } from " react-navigation-stack" ;
150- import Layout from " Remulus/App/Components/Layout" ;
151- import Text from " Remulus/App/Components/Text" ;
150+ import { StackNavigationProp } from " @react-navigation/stack" ;
151+ import Text from " MyApp/App/Components/Text" ;
152152
153- const Home: NavigationStackScreenComponent = ({ navigation }) => {
153+ type HomeScreenNavigationProp = StackNavigationProp<
154+ RootStackParamList,
155+ " Home"
156+ > ;
157+
158+ type Props = {
159+ navigation: HomeScreenNavigationProp;
160+ };
161+
162+ function Home ({ navigation }: Props ) {
154163 return (
155- < Layout . Center >
164+ < Box flex = " fluid " alignX = " center " alignY = " center " >
156165 < Text > Home< / Text >
157- < / Layout . Center >
166+ < / Box >
158167 );
159168};
160169
Original file line number Diff line number Diff line change 1+ import { Box } from "@mobily/stacks" ;
12import React from "react" ;
23import { StackNavigationProp } from "@react-navigation/stack" ;
3- import Layout from "<%= name %>/App/Components/Layout" ;
44import Text from "<%= name %>/App/Components/Text" ;
55
66type < %= screen % > ScreenNavigationProp = StackNavigationProp <
@@ -12,11 +12,11 @@ type Props = {
1212 navigation : < %= screen % > ScreenNavigationProp ;
1313} ;
1414
15- const < %= screen % > : React . FC < Props > = ( { navigation } ) => {
15+ function < %= screen % > ( { navigation } : Props ) {
1616 return (
17- < Layout . Center >
17+ < Box flex = "fluid" alignX = "center" alignY = "center" >
1818 < Text > < %= screen % > </ Text >
19- </ Layout . Center >
19+ </ Box >
2020 );
2121}
2222
You can’t perform that action at this time.
0 commit comments