Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(moblie): bump to expo@52 #40

Merged
merged 2 commits into from
Dec 8, 2024
Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Imperial Kitchen

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-000.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

[中文版](README_ZH.md)

A food ordering app for family kitchen.
Expand Down
2 changes: 2 additions & 0 deletions README_ZH.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 御膳房

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-000.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

[English Version](README.md)

一个家庭厨房的点餐应用。
Expand Down
3 changes: 2 additions & 1 deletion apps/mobile/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://docs.expo.dev/guides/environment-variables/#how-variables-are-loaded
# Expo variables need to add EXPO_PUBLIC prefix
EXPO_USE_METRO_WORKSPACE_ROOT=1
# Enable by default
# EXPO_USE_METRO_WORKSPACE_ROOT=1
2 changes: 1 addition & 1 deletion apps/mobile/app/(guide)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Stack } from 'expo-router';
export default function GuideLayout() {
return (
<Stack
initialRouteName="Guide"
initialRouteName="guide"
screenOptions={{
animation: 'slide_from_right',
header: (props) => <StackHeader navProps={props} children={undefined} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { router } from 'expo-router';
import { StyleSheet, Text, View } from 'react-native';

export const CreateRecipeGuide = () => {
export default function CreateRecipeGuide() {
return (
<View style={styles.container}>
<View style={styles.header}>
Expand All @@ -27,7 +27,7 @@ export const CreateRecipeGuide = () => {
</View>
</View>
);
};
}

const styles = StyleSheet.create({
container: {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/app/modules/dishes/components/FoodListLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const Header = ({ title }: { title: string }) => {
);
};

export const FoodListLayout = ({ type }: { type: FoodType }) => {
export default function FoodListLayout({ type }: { type: FoodType }) {
return (
<View className="flex-1 bg-[#f9f9f9]">
<Header title={FoodType2Slogan[type]} />
</View>
);
};
}

const styles = StyleSheet.create({
header: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ const DifficultyItem = ({
);
};

export const RecipeDifficultyRadioSelector = ({
export default function RecipeDifficultyRadioSelector({
form,
setForm
}: {
form: CreateRecipeDTO;
setForm: Dispatch<SetStateAction<CreateRecipeDTO>>;
}) => {
}) {
const { difficulty } = form;

const handleSelect = useCallback((selectedDifficulty: typeof difficulty) => {
Expand All @@ -93,7 +93,7 @@ export const RecipeDifficultyRadioSelector = ({
))}
</View>
);
};
}

const styles = StyleSheet.create({
container: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const SPRING_CONFIG = {
mass: 0.5
} as const;

export const RecipeNameInputBox = ({
export default function RecipeNameInputBox({
form,
setForm
}: {
form: CreateRecipeDTO;
setForm: Dispatch<SetStateAction<CreateRecipeDTO>>;
}) => {
}) {
const inputRef = useRef(null);
const [isFocused, setIsFocused] = useState(false);
const spinValue = useSharedValue(0);
Expand Down Expand Up @@ -65,4 +65,4 @@ export const RecipeNameInputBox = ({
</Animated.View>
</View>
);
};
}
10 changes: 5 additions & 5 deletions apps/mobile/app/modules/dishes/components/RecipeTagsBox.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CreateRecipeDTO, TagVO } from '@imperial-kitchen/types';
import { Dispatch, SetStateAction } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { TagItem } from './TagItem';
import { TagSelectModal } from './TagSelectModal';
import TagItem from './TagItem';
import TagSelectModal from './TagSelectModal';

const AddTagButton = ({ onPress }: { onPress: () => void }) => {
return (
Expand All @@ -12,13 +12,13 @@ const AddTagButton = ({ onPress }: { onPress: () => void }) => {
);
};

export const RecipeTagsBox = ({
export default function RecipeTagsBox({
form,
setForm
}: {
form: CreateRecipeDTO;
setForm: Dispatch<SetStateAction<CreateRecipeDTO>>;
}) => {
}) {
const { tags } = form;
const onItemDelete = (tag: TagVO) => {
setForm({ ...form, tags: tags.filter((t) => t.id !== tag.id) });
Expand All @@ -38,7 +38,7 @@ export const RecipeTagsBox = ({
/>
</View>
);
};
}

const styles = StyleSheet.create({
addTagButton: {
Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/app/modules/dishes/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ const ToggleMenuButton = ({ showMenu, setShowMenu }: { showMenu: boolean; setSho
);
};

export const SideBar = ({
export default function SideBar({
configs,
selectedKey,
onSelect
}: {
configs: SidebarConfig[];
selectedKey: string;
onSelect: (key: SidebarItemType) => void;
}) => {
}) {
const [showMenu, setShowMenu] = useState(true);
const opacity = useSharedValue(1);

Expand Down Expand Up @@ -144,7 +144,7 @@ export const SideBar = ({
</View>
</View>
);
};
}

const styles = StyleSheet.create({
container: {
Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/app/modules/dishes/components/TagItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import CloseIcon from '@/assets/icons/close-icon.svg';
import { TagVO } from '@imperial-kitchen/types';
import { Chip } from 'react-native-paper';

export const TagItem = ({
export default function TagItem({
tag,
onClose,
onPress,
Expand All @@ -12,7 +12,7 @@ export const TagItem = ({
onClose?: () => void;
onPress?: () => void;
active?: boolean;
}) => {
}) {
const _onClose = active ? onClose : undefined;
return (
<Chip
Expand All @@ -29,4 +29,4 @@ export const TagItem = ({
{tag.name}
</Chip>
);
};
}
8 changes: 4 additions & 4 deletions apps/mobile/app/modules/dishes/components/TagSelectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { TagVO } from '@imperial-kitchen/types';
import { ReactNode, useCallback, useState } from 'react';
import { View } from 'react-native';
import { Modal, Portal } from 'react-native-paper';
import { TagItem } from './TagItem';
import TagItem from './TagItem';

export const TagSelectModal = ({
export default function TagSelectModal({
trigger,
activeTags,
onSelect,
Expand All @@ -16,7 +16,7 @@ export const TagSelectModal = ({
activeTags: TagVO[];
onSelect: (tag: TagVO) => void;
onItemDelete: (tag: TagVO) => void;
}) => {
}) {
const [visible, setVisible] = useState(false);

const showModal = () => setVisible(true);
Expand Down Expand Up @@ -79,4 +79,4 @@ export const TagSelectModal = ({
{trigger(showModal)}
</>
);
};
}
6 changes: 3 additions & 3 deletions apps/mobile/app/modules/dishes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { ThemedView } from '@/components/ThemedView';
import { CreateRecipe, SidebarConfig, SidebarItemType } from '@/types';
import { FoodType } from '@imperial-kitchen/types';
import { useState } from 'react';
import { CreateRecipeGuide } from './components/CreateRecipeGuide';
import { FoodListLayout } from './components/FoodListLayout';
import { SideBar } from './components/SideBar';
import SideBar from './components/SideBar';
import CreateRecipeGuide from './components/CreateRecipeGuide';
import FoodListLayout from './components/FoodListLayout';

const SidebarConfigs: SidebarConfig[] = [
{
Expand Down
6 changes: 3 additions & 3 deletions apps/mobile/app/modules/dishes/pages/recipe.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CreateRecipeDTO } from '@imperial-kitchen/types';
import { Dispatch, ReactNode, SetStateAction, useState } from 'react';
import { Button, StyleSheet, Text, View } from 'react-native';
import { RecipeDifficultyRadioSelector } from '../components/RecipeDifficultyRadioSelector';
import { RecipeNameInputBox } from '../components/RecipeNameInputBox';
import { RecipeTagsBox } from '../components/RecipeTagsBox';
import RecipeNameInputBox from '../components/RecipeNameInputBox';
import RecipeDifficultyRadioSelector from '../components/RecipeDifficultyRadioSelector';
import RecipeTagsBox from '../components/RecipeTagsBox';

const CardItem = ({ title, children }: { title: string; children: ReactNode }) => {
return (
Expand Down
44 changes: 22 additions & 22 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,45 @@
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^14.0.0",
"@expo/vector-icons": "^14.0.2",
"@imperial-kitchen/types": "1.0.0",
"@react-navigation/native": "^6.0.2",
"axios": "^1.7.2",
"expo": "~51.0.0",
"expo-constants": "~16.0.1",
"expo-font": "~12.0.4",
"expo-linking": "~6.3.1",
"expo-localization": "^15.0.3",
"expo-router": "~3.5.10",
"expo-secure-store": "^13.0.1",
"expo-splash-screen": "~0.27.4",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.4",
"expo-web-browser": "~13.0.3",
"expo": "52.0.17",
"expo-constants": "~17.0.3",
"expo-font": "~13.0.1",
"expo-linking": "~7.0.3",
"expo-localization": "^16.0.0",
"expo-router": "~4.0.11",
"expo-secure-store": "^14.0.0",
"expo-splash-screen": "~0.29.16",
"expo-status-bar": "~2.0.0",
"expo-system-ui": "~4.0.5",
"expo-web-browser": "~14.0.1",
"formik": "^2.4.6",
"i18next": "^23.15.1",
"nativewind": "^4.1.21",
"react-i18next": "^15.0.2",
"react-native": "0.74.1",
"react-native-gesture-handler": "~2.16.1",
"react-native": "0.76.3",
"react-native-gesture-handler": "~2.20.2",
"react-native-paper": "^5.12.5",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "^4.14.0",
"react-native-screens": "3.31.1",
"react-native-reanimated": "~3.16.1",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.1.0",
"react-native-sse": "^1.2.1",
"react-native-svg": "15.2.0",
"react-native-svg": "15.8.0",
"react-native-vector-icons": "^10.2.0",
"react-native-web": "~0.19.10",
"react-native-web": "~0.19.13",
"tailwindcss": "^3.4.14",
"yup": "^1.4.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/core": "^7.25.2",
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react": "~18.3.12",
"@types/react-test-renderer": "^18.0.7",
"jest": "^29.2.1",
"jest-expo": "~51.0.1",
"jest-expo": "~52.0.2",
"react-native-svg-transformer": "^1.5.0",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3"
Expand Down
Loading
Loading