Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"platforms": ["ios", "web", "android"],
"platforms": [
"ios",
"web",
"android"
],
"ios": {
"supportsTablet": true,
"infoPlist": {
Expand All @@ -25,7 +29,12 @@
"output": "server",
"favicon": "./assets/images/favicon.png"
},
"plugins": [],
"plugins": [
"expo-font",
"expo-router",
"expo-splash-screen",
"expo-status-bar"
],
"experiments": {
"typedRoutes": true
}
Expand Down
4 changes: 1 addition & 3 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import "@/utils/fetch-polyfill";

import {
DarkTheme,
DefaultTheme,
ThemeProvider,
} from "@react-navigation/native";
} from "expo-router/react-navigation";

import { Stack } from "expo-router";
import { useColorScheme } from "react-native";
Expand Down
7 changes: 3 additions & 4 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ function formDataFromImagePicker(result: ImagePicker.ImagePickerSuccessResult) {
formData.append(
`photo.${index}`,
// Avoid using base64, but some APIs only return base64 so we support it.
base64ToFile(asset.base64, asset.fileName)
base64ToFile(asset.base64, asset.fileName),
);
} else {
formData.append(
`photo.${index}`,
// asset.file is returned on web only as of SDK 54.
asset.file ??
// We can create a File from the URI on native.
new File(asset.uri)
new File(asset.uri),
);
}

Expand All @@ -45,7 +45,6 @@ async function pickImage(options: ImagePicker.ImagePickerOptions) {
...options,
});
if (!result.canceled) {
console.log(result.assets[0].file);
// Upload the image to the API route.
const response = await fetch("/api/img", {
method: "POST",
Expand All @@ -62,7 +61,7 @@ export default function HomeScreen() {
const [results, setResults] = React.useState<string | null>(null);

const pickImageWithResults = async (
options: ImagePicker.ImagePickerOptions
options: ImagePicker.ImagePickerOptions,
) => {
const result = await pickImage(options);

Expand Down
1,257 changes: 1,257 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
},
"dependencies": {
"@bacons/apple-colors": "^0.0.6",
"@expo/vector-icons": "^15.0.2",
"expo": "^54.0.10",
"expo-font": "~14.0.8",
"expo-image-picker": "~17.0.8",
"expo-linking": "~8.0.8",
"expo-router": "~6.0.8",
"expo-splash-screen": "~31.0.10",
"expo-status-bar": "~3.0.8",
"expo-symbols": "~1.0.7",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.4",
"react-native-gesture-handler": "~2.28.0",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-web": "^0.21.0",
"react-native-worklets": "0.5.1"
"@expo/vector-icons": "^15.0.3",
"expo": "^56",
"expo-font": "~56.0.5",
"expo-image-picker": "~56.0.13",
"expo-linking": "~56.0.11",
"expo-router": "~56.2.6",
"expo-splash-screen": "~56.0.10",
"expo-status-bar": "~56.0.4",
"expo-symbols": "~56.0.5",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-native": "0.85.3",
"react-native-gesture-handler": "~2.31.1",
"react-native-reanimated": "4.3.1",
"react-native-safe-area-context": "~5.7.0",
"react-native-screens": "4.25.2",
"react-native-web": "^0.21.2",
"react-native-worklets": "0.8.3"
},
"private": true,
"devDependencies": {
"@types/react": "~19.1.10",
"typescript": "~5.9.2"
"@types/react": "~19.2.14",
"typescript": "~6.0.3"
}
}
82 changes: 0 additions & 82 deletions utils/fetch-polyfill.ts

This file was deleted.

1 change: 0 additions & 1 deletion utils/fetch-polyfill.web.ts

This file was deleted.

Loading