create-expo-stack 2.10.5-next.0aafcb2 → 2.10.5-next.486a940
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/templates/base/components/Button.tsx.ejs +2 -3
- package/build/templates/packages/nativewind/components/Button.tsx.ejs +4 -5
- package/build/templates/packages/nativewindui/components/Button.tsx.ejs +2 -3
- package/build/templates/packages/restyle/components/Button.tsx.ejs +7 -3
- package/build/templates/packages/tamagui/components/Button.tsx.ejs +11 -5
- package/build/templates/packages/tamagui/tamagui.config.ts.ejs +24 -25
- package/build/templates/packages/unistyles/components/Button.tsx.ejs +8 -3
- package/package.json +1 -1
|
@@ -2,13 +2,12 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type ButtonProps = {
|
|
5
|
-
onPress?: TouchableOpacityProps['onPress'];
|
|
6
5
|
title?: string;
|
|
7
6
|
} & TouchableOpacityProps;
|
|
8
7
|
|
|
9
|
-
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({
|
|
8
|
+
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
|
|
10
9
|
return (
|
|
11
|
-
<TouchableOpacity ref={ref} style={styles.button
|
|
10
|
+
<TouchableOpacity ref={ref} {...touchableProps} style={[styles.button, touchableProps.style]}>
|
|
12
11
|
<Text style={styles.buttonText}>{title}</Text>
|
|
13
12
|
</TouchableOpacity>
|
|
14
13
|
);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import { Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
onPress?: () => void;
|
|
4
|
+
type ButtonProps = {
|
|
6
5
|
title: string;
|
|
7
|
-
}
|
|
6
|
+
} & TouchableOpacityProps;
|
|
8
7
|
|
|
9
|
-
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({
|
|
8
|
+
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
|
|
10
9
|
return (
|
|
11
|
-
<TouchableOpacity ref={ref} className={styles.button}
|
|
10
|
+
<TouchableOpacity ref={ref} {...touchableProps} className={`${styles.button} ${touchableProps.className}`}>
|
|
12
11
|
<Text className={styles.buttonText}>{title}</Text>
|
|
13
12
|
</TouchableOpacity>
|
|
14
13
|
);
|
|
@@ -2,13 +2,12 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type ButtonProps = {
|
|
5
|
-
onPress?: TouchableOpacityProps['onPress'];
|
|
6
5
|
title?: string;
|
|
7
6
|
} & TouchableOpacityProps;
|
|
8
7
|
|
|
9
|
-
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({
|
|
8
|
+
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
|
|
10
9
|
return (
|
|
11
|
-
<TouchableOpacity ref={ref} style={styles.button
|
|
10
|
+
<TouchableOpacity ref={ref} {...touchableProps} style={[styles.button, touchableProps.style]}>
|
|
12
11
|
<Text style={styles.buttonText}>{title}</Text>
|
|
13
12
|
</TouchableOpacity>
|
|
14
13
|
);
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import { TouchableOpacity } from 'react-native';
|
|
2
|
+
import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
|
|
3
3
|
import { Text, makeStyles } from 'theme';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type ButtonProps = {
|
|
6
|
+
title?: string;
|
|
7
|
+
} & TouchableOpacityProps;
|
|
8
|
+
|
|
9
|
+
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
|
|
6
10
|
const styles = useStyles();
|
|
7
11
|
|
|
8
12
|
return (
|
|
9
|
-
<TouchableOpacity style={styles.button
|
|
13
|
+
<TouchableOpacity ref={ref} {...touchableProps} style={[styles.button, touchableProps.style]}>
|
|
10
14
|
<Text variant="body" textAlign="center" color="white" fontWeight="600">
|
|
11
15
|
{title}
|
|
12
16
|
</Text>
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentProps, forwardRef } from 'react';
|
|
2
|
+
import { TamaguiElement } from 'tamagui';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import { Button as TButton } from '../tamagui.config';
|
|
5
|
+
|
|
6
|
+
type ButtonProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
} & ComponentProps<typeof TButton>;
|
|
9
|
+
|
|
10
|
+
export const Button = forwardRef<TamaguiElement, ButtonProps>(({ title, ...tButtonProps }, ref) => {
|
|
5
11
|
return (
|
|
6
|
-
<TButton
|
|
7
|
-
|
|
12
|
+
<TButton {...tButtonProps} ref={ref}>
|
|
13
|
+
{title}
|
|
8
14
|
</TButton>
|
|
9
15
|
);
|
|
10
16
|
});
|
|
@@ -4,7 +4,7 @@ import { createMedia } from "@tamagui/react-native-media-driver";
|
|
|
4
4
|
import { shorthands } from "@tamagui/shorthands";
|
|
5
5
|
import { themes, tokens } from "@tamagui/themes";
|
|
6
6
|
<% if (props.navigationPackage?.type === "navigation") { %>
|
|
7
|
-
import { createTamagui, styled, SizableText, H1, YStack } from "tamagui";
|
|
7
|
+
import { createTamagui, styled, SizableText, H1, YStack, Button as ButtonTamagui } from "tamagui";
|
|
8
8
|
<% } else { %>
|
|
9
9
|
import { createTamagui } from "tamagui";
|
|
10
10
|
<% } %>
|
|
@@ -54,33 +54,32 @@ const bodyFont = createInterFont();
|
|
|
54
54
|
color: '#38434D',
|
|
55
55
|
size: '$9',
|
|
56
56
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
backgroundColor: '#6366F1',
|
|
62
|
-
borderRadius: 28,
|
|
57
|
+
|
|
58
|
+
export const Button = styled(ButtonTamagui, {
|
|
59
|
+
backgroundColor: '#6366F1',
|
|
60
|
+
borderRadius: 28,
|
|
63
61
|
hoverStyle: {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
backgroundColor: '#5a5fcf',
|
|
63
|
+
},
|
|
64
|
+
pressStyle: {
|
|
65
|
+
backgroundColor: '#5a5fcf',
|
|
66
|
+
},
|
|
67
67
|
maxWidth: 500,
|
|
68
|
-
padding: 16,
|
|
69
|
-
shadowColor: '#000',
|
|
70
|
-
shadowOffset: {
|
|
71
|
-
height: 2,
|
|
72
|
-
width: 0,
|
|
73
|
-
},
|
|
74
|
-
shadowOpacity: 0.25,
|
|
75
|
-
shadowRadius: 3.84,
|
|
76
|
-
});
|
|
77
68
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
// Shaddows
|
|
70
|
+
shadowColor: '#000',
|
|
71
|
+
shadowOffset: {
|
|
72
|
+
height: 2,
|
|
73
|
+
width: 0,
|
|
74
|
+
},
|
|
75
|
+
shadowOpacity: 0.25,
|
|
76
|
+
shadowRadius: 3.84,
|
|
77
|
+
|
|
78
|
+
// Button text
|
|
79
|
+
color: '#FFFFFF',
|
|
80
|
+
fontWeight: '600', // Is not passed down to the text. Probably a bug in Tamagui: https://github.com/tamagui/tamagui/issues/1156#issuecomment-1802594930
|
|
81
|
+
fontSize: 16,
|
|
82
|
+
});
|
|
84
83
|
<% } %>
|
|
85
84
|
|
|
86
85
|
const config = createTamagui({
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import { Text, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
|
|
3
3
|
import { useStyles } from 'react-native-unistyles';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type ButtonProps = {
|
|
6
|
+
title?: string;
|
|
7
|
+
} & TouchableOpacityProps;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ title, ...touchableProps }, ref) => {
|
|
6
11
|
const { theme } = useStyles();
|
|
7
12
|
|
|
8
13
|
return (
|
|
9
|
-
<TouchableOpacity style={theme.components.button
|
|
14
|
+
<TouchableOpacity ref={ref} {...touchableProps} style={[theme.components.button, touchableProps.style]}>
|
|
10
15
|
<Text style={theme.components.buttonText}>{title}</Text>
|
|
11
16
|
</TouchableOpacity>
|
|
12
17
|
);
|