expo-template-default 51.0.9 → 51.0.10

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.
@@ -72,8 +72,8 @@ export default function TabTwoScreen() {
72
72
  <ThemedText>
73
73
  This template includes an example of an animated component. The{' '}
74
74
  <ThemedText type="defaultSemiBold">components/HelloWave.tsx</ThemedText> component uses
75
- the <ThemedText type="defaultSemiBold">Animated</ThemedText> API to create a waving hand
76
- animation.
75
+ the powerful <ThemedText type="defaultSemiBold">react-native-reanimated</ThemedText> library
76
+ to create a waving hand animation.
77
77
  </ThemedText>
78
78
  {Platform.select({
79
79
  ios: (
@@ -1,9 +1,9 @@
1
1
  import { Image, StyleSheet, Platform } from 'react-native';
2
2
 
3
+ import { HelloWave } from '@/components/HelloWave';
3
4
  import ParallaxScrollView from '@/components/ParallaxScrollView';
4
5
  import { ThemedText } from '@/components/ThemedText';
5
6
  import { ThemedView } from '@/components/ThemedView';
6
- import { HelloWave } from '@/components/HelloWave';
7
7
 
8
8
  export default function HomeScreen() {
9
9
  return (
@@ -58,6 +58,7 @@ const styles = StyleSheet.create({
58
58
  },
59
59
  stepContainer: {
60
60
  gap: 8,
61
+ marginBottom: 8,
61
62
  },
62
63
  reactLogo: {
63
64
  height: 178,
@@ -23,7 +23,7 @@ export function Collapsible({ children, title }: PropsWithChildren & { title: st
23
23
  />
24
24
  <ThemedText type="defaultSemiBold">{title}</ThemedText>
25
25
  </TouchableOpacity>
26
- <ThemedView style={styles.content}>{isOpen ? children : null}</ThemedView>
26
+ {isOpen && <ThemedView style={styles.content}>{children}</ThemedView>}
27
27
  </ThemedView>
28
28
  );
29
29
  }
@@ -32,9 +32,10 @@ const styles = StyleSheet.create({
32
32
  heading: {
33
33
  flexDirection: 'row',
34
34
  alignItems: 'center',
35
- gap: 4,
35
+ gap: 6,
36
36
  },
37
37
  content: {
38
+ marginTop: 6,
38
39
  marginLeft: 24,
39
40
  },
40
41
  });
@@ -1,23 +1,22 @@
1
1
  import { Link } from 'expo-router';
2
- import * as WebBrowser from 'expo-web-browser';
3
- import React from 'react';
2
+ import { openBrowserAsync } from 'expo-web-browser';
3
+ import { type ComponentProps } from 'react';
4
4
  import { Platform } from 'react-native';
5
5
 
6
- export function ExternalLink(
7
- props: Omit<React.ComponentProps<typeof Link>, 'href'> & { href: string }
8
- ) {
6
+ type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: string };
7
+
8
+ export function ExternalLink({ href, ...rest }: Props) {
9
9
  return (
10
10
  <Link
11
11
  target="_blank"
12
- {...props}
13
- // @ts-expect-error: External URLs are not typed.
14
- href={props.href}
15
- onPress={(e) => {
12
+ {...rest}
13
+ href={href}
14
+ onPress={async (event) => {
16
15
  if (Platform.OS !== 'web') {
17
16
  // Prevent the default behavior of linking to the default browser on native.
18
- e.preventDefault();
17
+ event.preventDefault();
19
18
  // Open the link in an in-app browser.
20
- WebBrowser.openBrowserAsync(props.href as string);
19
+ await openBrowserAsync(href);
21
20
  }
22
21
  }}
23
22
  />
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import type { PropsWithChildren, ReactElement } from 'react';
2
2
  import { StyleSheet, useColorScheme } from 'react-native';
3
3
  import Animated, {
4
4
  interpolate,
@@ -11,15 +11,17 @@ import { ThemedView } from '@/components/ThemedView';
11
11
 
12
12
  const HEADER_HEIGHT = 250;
13
13
 
14
+ type Props = PropsWithChildren<{
15
+ headerImage: ReactElement;
16
+ headerBackgroundColor: { dark: string; light: string };
17
+ }>;
18
+
14
19
  export default function ParallaxScrollView({
15
20
  children,
16
21
  headerImage,
17
22
  headerBackgroundColor,
18
- }: PropsWithChildren<{
19
- headerImage: React.ReactElement;
20
- headerBackgroundColor: { dark: string; light: string };
21
- }>) {
22
- const colorScheme = useColorScheme() || 'light';
23
+ }: Props) {
24
+ const colorScheme = useColorScheme() ?? 'light';
23
25
  const scrollRef = useAnimatedRef<Animated.ScrollView>();
24
26
  const scrollOffset = useScrollViewOffset(scrollRef);
25
27
 
@@ -68,9 +70,7 @@ const styles = StyleSheet.create({
68
70
  content: {
69
71
  flex: 1,
70
72
  padding: 32,
71
- gap: 24,
72
- borderRadius: 16,
73
+ gap: 16,
73
74
  overflow: 'hidden',
74
- marginTop: -12,
75
75
  },
76
76
  });
@@ -1,14 +1,20 @@
1
- import { Text, StyleSheet } from 'react-native';
1
+ import { Text, type TextProps, StyleSheet } from 'react-native';
2
2
 
3
3
  import { useThemeColor } from '@/hooks/useThemeColor';
4
4
 
5
- export type TextProps = {
5
+ export type ThemedTextProps = TextProps & {
6
6
  lightColor?: string;
7
7
  darkColor?: string;
8
- } & { type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link' } & Text['props'];
8
+ type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link';
9
+ };
9
10
 
10
- export function ThemedText(props: TextProps) {
11
- const { style, lightColor, darkColor, type = 'default', ...otherProps } = props;
11
+ export function ThemedText({
12
+ style,
13
+ lightColor,
14
+ darkColor,
15
+ type = 'default',
16
+ ...rest
17
+ }: ThemedTextProps) {
12
18
  const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text');
13
19
 
14
20
  return (
@@ -22,7 +28,7 @@ export function ThemedText(props: TextProps) {
22
28
  type === 'link' ? styles.link : undefined,
23
29
  style,
24
30
  ]}
25
- {...otherProps}
31
+ {...rest}
26
32
  />
27
33
  );
28
34
  }
@@ -49,6 +55,6 @@ const styles = StyleSheet.create({
49
55
  link: {
50
56
  lineHeight: 30,
51
57
  fontSize: 16,
52
- color: '#2e78b7',
58
+ color: '#0a7ea4',
53
59
  },
54
60
  });
@@ -1,14 +1,13 @@
1
- import { View } from 'react-native';
1
+ import { View, type ViewProps } from 'react-native';
2
2
 
3
3
  import { useThemeColor } from '@/hooks/useThemeColor';
4
4
 
5
- export type ViewProps = {
5
+ export type ThemedViewProps = ViewProps & {
6
6
  lightColor?: string;
7
7
  darkColor?: string;
8
- } & View['props'];
8
+ };
9
9
 
10
- export function ThemedView(props: ViewProps) {
11
- const { style, lightColor, darkColor, ...otherProps } = props;
10
+ export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) {
12
11
  const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background');
13
12
 
14
13
  return <View style={[{ backgroundColor }, style]} {...otherProps} />;
@@ -1,11 +1,9 @@
1
1
  // You can explore the built-in icon families and icons on the web at https://icons.expo.fyi/
2
2
 
3
3
  import Ionicons from '@expo/vector-icons/Ionicons';
4
+ import { type IconProps } from '@expo/vector-icons/build/createIconSet';
4
5
  import { type ComponentProps } from 'react';
5
6
 
6
- export function TabBarIcon(props: {
7
- name: ComponentProps<typeof Ionicons>['name'];
8
- color: string;
9
- }) {
10
- return <Ionicons size={28} style={{ marginBottom: -3 }} {...props} />;
7
+ export function TabBarIcon({ style, ...rest }: IconProps<ComponentProps<typeof Ionicons>['name']>) {
8
+ return <Ionicons size={28} style={[{ marginBottom: -3 }, style]} {...rest} />;
11
9
  }
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * Learn more about light and dark modes:
3
- * https://docs.expo.io/guides/color-schemes/
3
+ * https://docs.expo.dev/guides/color-schemes/
4
4
  */
5
5
 
6
6
  import { useColorScheme } from 'react-native';
7
+
7
8
  import { Colors } from '@/constants/Colors';
8
9
 
9
10
  export function useThemeColor(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-template-default",
3
3
  "main": "expo-router/entry",
4
- "version": "51.0.9",
4
+ "version": "51.0.10",
5
5
  "scripts": {
6
6
  "start": "expo start",
7
7
  "reset-project": "./scripts/reset-project.js",
@@ -17,11 +17,11 @@
17
17
  "dependencies": {
18
18
  "@expo/vector-icons": "^14.0.0",
19
19
  "@react-navigation/native": "^6.0.2",
20
- "expo": "~51.0.0-preview.6",
20
+ "expo": "~51.0.0-preview.7",
21
21
  "expo-constants": "~16.0.1",
22
22
  "expo-font": "~12.0.4",
23
23
  "expo-linking": "~6.3.1",
24
- "expo-router": "~3.5.3",
24
+ "expo-router": "~3.5.4",
25
25
  "expo-splash-screen": "~0.27.2",
26
26
  "expo-status-bar": "~1.12.1",
27
27
  "expo-system-ui": "~3.0.2",