This commit is contained in:
2021-11-02 23:48:35 +01:00
parent e202b7a160
commit 8a9ebe2816
14 changed files with 54 additions and 34 deletions

View File

@@ -1,14 +1,14 @@
{ {
"expo": { "expo": {
"name": "ohome-app", "name": "Ohome",
"slug": "ohome-app", "slug": "ohome",
"version": "1.0.0", "version": "1.0.0",
"orientation": "portrait", "orientation": "portrait",
"icon": "./assets/icon.png", "icon": "./assets/logo512.png",
"splash": { "splash": {
"image": "./assets/splash.png", "image": "./assets/OhomeSplash.png",
"resizeMode": "contain", "resizeMode": "contain",
"backgroundColor": "#ffffff" "backgroundColor": "#f9f6ef"
}, },
"updates": { "updates": {
"fallbackToCacheTimeout": 0 "fallbackToCacheTimeout": 0
@@ -17,16 +17,20 @@
"**/*" "**/*"
], ],
"ios": { "ios": {
"bundleIdentifier": "codebenchers.ohome",
"buildNumber": "1.0.0",
"supportsTablet": true "supportsTablet": true
}, },
"android": { "android": {
"package": "codebenchers.ohome",
"versionCode": 1,
"adaptiveIcon": { "adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png", "foregroundImage": "./assets/logo512.png",
"backgroundColor": "#FFFFFF" "backgroundColor": "#f9f6ef"
} }
}, },
"web": { "web": {
"favicon": "./assets/favicon.png" "favicon": "./assets/logo192.png"
} }
} }
} }

BIN
assets/OhomeSplash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

BIN
assets/logo192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
assets/logo512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -11,10 +11,11 @@ import Recipe from './pages/recipes/Recipe';
import theme from './styles/theme'; import theme from './styles/theme';
//dependencies //dependencies
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
//navigation //navigation
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { useNavigation } from '@react-navigation/core';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
@@ -38,11 +39,21 @@ function App() {
backgroundColor: theme.colors.dp00 + 'bb' backgroundColor: theme.colors.dp00 + 'bb'
}, //COLORS.dp08 }, //COLORS.dp08
headerShadowVisible: false, headerShadowVisible: false,
headerTintColor: theme.colors.textW0, headerTintColor: theme.colors.textW1,
headerTitleStyle: { fontSize: 32 }, headerTitleStyle: { fontSize: 32, fontWeight: 'bold' },
cardOverlayEnabled: true, cardOverlayEnabled: true,
headerTransparent: true, headerTransparent: true,
headerLeft: () => {
const navigation = useNavigation()
return (
< MaterialCommunityIcons style={{marginLeft: -5, marginRight: 15, marginTop: 5}} name="arrow-left" size={40} color={theme.colors.textW2}
onPress={() => navigation.goBack()}
>
</MaterialCommunityIcons>)}
}}
options={{
}}> }}>
<Stack.Screen name="Home" component={HomePage} options={{ <Stack.Screen name="Home" component={HomePage} options={{
headerLeft: () => ( headerLeft: () => (
< TouchableOpacity < TouchableOpacity
@@ -54,7 +65,7 @@ function App() {
<Stack.Screen name="Groceries" component={GroceryListPage} /> <Stack.Screen name="Groceries" component={GroceryListPage} />
<Stack.Screen name="Recipes" component={RecipePage} /> <Stack.Screen name="Recipes" component={RecipePage} />
<Stack.Screen name="Recipe" component={Recipe} /> <Stack.Screen name="Recipe" component={Recipe} />
<Stack.Screen name="AddRecipe" component={AddRecipe} /> <Stack.Screen name="Add a recipe" component={AddRecipe} />
</Stack.Navigator> </Stack.Navigator>
</NavigationContainer> </NavigationContainer>
); );

View File

@@ -48,9 +48,10 @@ export default React.memo((props) => {
const [modalListVisible, setModalListVisible] = useState(false); const [modalListVisible, setModalListVisible] = useState(false);
const HandleAnimation = (event) => { const HandleAnimation = (event) => {
const height = event.nativeEvent.layout.height
LayoutAnimation.configureNext(LayoutAnimation.create(200, 'easeInEaseOut', 'opacity')) LayoutAnimation.configureNext(LayoutAnimation.create(200, 'easeInEaseOut', 'opacity'))
setHeight(event.nativeEvent.layout.height) setHeight(height)
// console.log("height changed: ", event.nativeEvent.layout.height) // console.log(height)
} }
const removeList = () => { const removeList = () => {

View File

@@ -12,7 +12,6 @@ const GroceryCard = (props) => {
<WrapperCard onPress={() => navigation.navigate('Groceries')}> <WrapperCard onPress={() => navigation.navigate('Groceries')}>
<TextCard>Groceries</TextCard> <TextCard>Groceries</TextCard>
<IconCoffee /> <IconCoffee />
<View style={{ height: 100, width: '100%' }} />
</WrapperCard> </WrapperCard>
) )
} }

View File

@@ -31,14 +31,19 @@ export const TextCard = styled(Text)`
color: ${props => props.theme.colors.textW2}; color: ${props => props.theme.colors.textW2};
background-color: #0003; background-color: #0003;
` `
const Coffee = () => <MaterialCommunityIcons name="coffee" color={theme.colors.primaryVar} size={50} />
export const IconCoffee = styled(Coffee)` export const IconCoffee = styled(MaterialCommunityIcons).attrs({
margin-top: 15px; name: 'coffee'
})`
color: ${props => props.theme.colors.primaryVar};
font-size: 70px;
margin-top: 10px;
` `
const Meal = () => <MaterialCommunityIcons name="noodles" color={theme.colors.primaryVar} size={50} /> export const IconRecipe = styled(MaterialCommunityIcons).attrs({
name: 'noodles'
export const IconRecipe = styled(Meal)` })`
margin-top: 15px; color: ${props => props.theme.colors.primaryVar};
font-size: 70px;
margin-top: 10px;
` `

View File

@@ -17,7 +17,7 @@ import { TouchableOpacity } from "react-native-gesture-handler";
export const AddRecipeButton = () => { export const AddRecipeButton = () => {
let navigation = useNavigation() let navigation = useNavigation()
return ( return (
<WrapperAddRecipe onPress={() => navigation.navigate('AddRecipe', {id: ""})}> <WrapperAddRecipe onPress={() => navigation.navigate('Add a recipe', {id: ""})}>
<IconPlus /> <IconPlus />
</WrapperAddRecipe> </WrapperAddRecipe>
) )
@@ -59,7 +59,7 @@ export const OptionsButtonRecipe = (props) => {
<TouchableOpacity onPress={() => handleRemove()} > <TouchableOpacity onPress={() => handleRemove()} >
<IconRemove /> <IconRemove />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity onPress={() => navigation.navigate("AddRecipe", { id: props.id })} > <TouchableOpacity onPress={() => navigation.navigate("Add a recipe", { id: props.id })} >
<IconEdit /> <IconEdit />
</TouchableOpacity> </TouchableOpacity>
</WrapperOptions> </WrapperOptions>

View File

@@ -36,9 +36,9 @@ const Recipe = ({route, navigation}) => {
return ( return (
<> <>
<ScrollView>
<HeaderPadding /> <HeaderPadding />
{recipe.image != "" && <StyledImage source={{ uri: recipe.image }} />} {recipe.image != "" && <StyledImage source={{ uri: recipe.image }} />}
<ScrollView>
<Wrapper > <Wrapper >
<WrapperRecipe> <WrapperRecipe>
<Title>{recipe.name}</Title> <Title>{recipe.name}</Title>