Skip to content

Commit bbe0628

Browse files
committed
fix: nativewind home layout, TabBarIcon types, rerun-hint quoting
- Give EditScreenInfo's outer View w-full: ScreenContent centers its children, so the unconstrained View sized to the text's intrinsic single-line width and the description clipped at the screen edge. - Inset the Show Details button with mx-6; the Container only has safe-area padding, which is zero horizontally on iPhones, so the stretched button touched the screen edges. - Type TabBarIcon color as ColorValue: Expo Router's Tabs on SDK 56 passes ColorValue to tabBarIcon, which fails typechecking against color: string. @expo/vector-icons accepts string | OpaqueColorValue. - Only quote the rerun-hint project name when it contains characters that actually need shell quoting.
1 parent 3d84352 commit bbe0628

5 files changed

Lines changed: 17 additions & 3 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'create-expo-stack': patch
3+
'rn-new': patch
4+
---
5+
6+
Fix Nativewind template layout: inset the Show Details button from the screen edges, constrain EditScreenInfo so its description text wraps instead of clipping, type TabBarIcon color as ColorValue for SDK 56 tabs, and only quote the rerun-hint project name when it needs shell quoting.

cli/src/templates/base/components/TabBarIcon.tsx.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import FontAwesome from '@expo/vector-icons/FontAwesome';
2-
import { StyleSheet } from 'react-native';
2+
import { ColorValue, StyleSheet } from 'react-native';
33

44
export const TabBarIcon = (props: {
55
name: React.ComponentProps<typeof FontAwesome>['name'];
6-
color: string;
6+
color: ColorValue;
77
}) => {
88
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
99
};

cli/src/templates/packages/expo-router/stack/app/index.tsx.ejs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export default function Home() {
3636
<Link href={{ pathname: '/details', params: { name: 'Dan' } }} asChild>
3737
<% if (props.stylingPackage?.name === "unistyles") { %>
3838
<Button title="Show Details" style={styles.button} />
39+
<% } else if (props.stylingPackage?.name === "nativewind") { %>
40+
<Button title="Show Details" className="mx-6" />
3941
<% } else { %>
4042
<Button title="Show Details" />
4143
<% } %>

cli/src/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const EditScreenInfo: React.FC<EditScreenInfoProps> = ({ path }) => {
1818
const description = "Change any of the text, save the file, and your app will automatically update."
1919
<% } %>
2020
return (
21-
<View>
21+
<View className={styles.container}>
2222
<View className={styles.getStartedContainer}>
2323
<Text className={styles.getStartedText}>{title}</Text>
2424
<View className={`${styles.codeHighlightContainer} ${styles.homeScreenFilename}`}>
@@ -33,6 +33,7 @@ export const EditScreenInfo: React.FC<EditScreenInfoProps> = ({ path }) => {
3333
};
3434
3535
const styles = {
36+
container: `w-full`,
3637
codeHighlightContainer: `rounded-md px-1`,
3738
getStartedContainer: `items-center mx-12`,
3839
getStartedText: `text-lg leading-6 text-center`,

cli/src/utilities/systemCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ type STDIO = 'inherit' | 'ignore' | 'pipe' | 'overlapped';
55
export const ONLY_ERRORS = ['ignore', 'ignore', 'inherit'] as const;
66

77
export function quoteShellArg(value: string): string {
8+
// Values made of safe characters don't need quoting on any platform
9+
if (/^[A-Za-z0-9._-]+$/.test(value)) {
10+
return value;
11+
}
12+
813
if (process.platform === 'win32') {
914
return `"${value.replace(/"/g, '""')}"`;
1015
}

0 commit comments

Comments
 (0)