add a new component

pull/7/head
Rayhân HASSOU 1 year ago
parent 81c8f99256
commit 087d9cd7f9

@ -0,0 +1,17 @@
import { Dimensions, Platform, PixelRatio } from 'react-native';
const {
width: SCREEN_WIDTH,
} = Dimensions.get('window');
const scale = SCREEN_WIDTH / 480;
// @ts-ignore
export default function normalize(size) {
const newSize = size * scale
if (Platform.OS === 'ios') {
return Math.round(PixelRatio.roundToNearestPixel(newSize))
} else {
return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 3
}
}

@ -4,6 +4,7 @@ import brochette from '../assets/images/brochette.png';
import Union_left from '../assets/images/Union_left.png';
import Union_right from '../assets/images/Union_right.png';
import background from '../assets/images/Background.png';
import normalize from './Normalize';
interface recipeElementProps {
@ -48,6 +49,7 @@ export default function RecipeElement(props : any) {
);
}
const styles = StyleSheet.create({
button: {
alignItems: 'center',

@ -4,6 +4,7 @@ import brochette from '../assets/images/brochette.png';
import Union_left from '../assets/images/Union_left.png';
import Union_right from '../assets/images/Union_right.png';
import background from '../assets/images/Background.png';
import normalize from './Normalize';
interface recipeElementReduceProps {
@ -29,6 +30,7 @@ export default function RecipeElementReduce(props : any) {
);
}
const styles = StyleSheet.create({
button: {
alignItems: 'center',
@ -54,7 +56,7 @@ const styles = StyleSheet.create({
right: 0,
marginHorizontal: 'auto',
color: '#E3DEC9',
},
title:{
fontSize: 18,

Loading…
Cancel
Save