Skip to content

Commit 0b164b9

Browse files
committed
scaling for device sizes
1 parent f43ef90 commit 0b164b9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/(tabs)/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
Pressable,
1414
Keyboard,
1515
} from 'react-native';
16+
import { scale, verticalScale } from 'react-native-size-matters';
1617

1718
import { supabase } from '~/utils/supabase';
1819

@@ -105,7 +106,7 @@ export default function Home() {
105106
<LottieView
106107
source={require('../../assets/animations/chef.json')}
107108
ref={animation}
108-
style={{ height: 300, width: 300 }}
109+
style={{ height: scale(300), width: scale(300) }}
109110
loop
110111
autoPlay
111112
/>
@@ -115,7 +116,7 @@ export default function Home() {
115116
{recipe ? (
116117
<ScrollView
117118
showsVerticalScrollIndicator={false}
118-
contentContainerStyle={{ paddingBottom: 200 }}>
119+
contentContainerStyle={{ paddingBottom: verticalScale(200) }}>
119120
<FontAwesome
120121
name="star"
121122
size={24}
@@ -133,7 +134,7 @@ export default function Home() {
133134
autoPlay
134135
ref={animation}
135136
source={require('../../assets/animations/recipe.json')}
136-
style={{ width: 300, height: 300 }}
137+
style={{ width: scale(300), height: scale(300) }}
137138
/>
138139
<Text className="text-center text-xl text-white">
139140
Let's start with your ingredients for the best recipe!

0 commit comments

Comments
 (0)