File tree Expand file tree Collapse file tree
cli/src/templates/packages/expo-router/stack/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' create-expo-stack ' : patch
3+ ' rn-new ' : patch
4+ ---
5+
6+ Add horizontal margins to button wrapper in Nativewind templates to prevent full-width buttons.
7+
8+ - Add button wrapper View with ` mx-4 ` class (16px horizontal margins) around Link/Button components in the Nativewind Expo Router stack template
9+ - Ensures buttons have proper spacing and don't stretch to fill the entire screen width
Original file line number Diff line number Diff line change @@ -30,13 +30,19 @@ export default function Home() {
3030 < InternalizationExample / >
3131 < % } % >
3232 < / ScreenContent>
33+ < % if (props .stylingPackage ? .name === " nativewind" ) { % >
34+ < View className= {styles .buttonWrapper }>
35+ < % } % >
3336 < Link href= {{ pathname: ' /details' , params: { name: ' Dan' } }} asChild>
3437 < % if (props .stylingPackage ? .name === " unistyles" ) { % >
3538 < Button title= " Show Details" style= {styles .button } / >
3639 < % } else { % >
3740 < Button title= " Show Details" / >
3841 < % } % >
3942 < / Link>
43+ < % if (props .stylingPackage ? .name === " nativewind" ) { % >
44+ < / View>
45+ < % } % >
4046 < / Container>
4147 < / View>
4248 );
@@ -45,7 +51,8 @@ export default function Home() {
4551< % if (props .stylingPackage ? .name === " nativewind" ) { % >
4652const styles = {
4753 container: " flex flex-1 bg-white" ,
48- }
54+ buttonWrapper: " mx-4" ,
55+ };
4956< % } else if (props .stylingPackage ? .name === " stylesheet" ) { % >
5057const styles = StyleSheet .create ({
5158 container: {
You can’t perform that action at this time.
0 commit comments