1
- import { ScrollView , Text } from "react-native" ;
1
+ import {
2
+ ScrollView ,
3
+ Text ,
4
+ Modal ,
5
+ View ,
6
+ Pressable ,
7
+ StyleSheet ,
8
+ } from "react-native" ;
2
9
import RecipeCard from "../components/recipe-components/RecipeCard" ;
3
10
import { Constants } from "../util/constants" ;
4
11
import { useSelector , useDispatch } from "react-redux" ;
@@ -12,6 +19,17 @@ function RecipesScreen() {
12
19
< ScrollView >
13
20
< Text style = { { marginVertical : 20 } } > Recipes Screen</ Text >
14
21
22
+ < Modal animationType = "slide" transparent = { true } visible = { true } >
23
+ < View style = { styles . centeredView } >
24
+ < View style = { styles . modalView } >
25
+ < Text style = { styles . modalText } > This is the MODAL!</ Text >
26
+ < Pressable >
27
+ < Text > Here is a pressable</ Text >
28
+ </ Pressable >
29
+ </ View >
30
+ </ View >
31
+ </ Modal >
32
+
15
33
{ ingredients . map ( ( ingredient ) => (
16
34
< Text > { ingredient } </ Text >
17
35
) ) }
@@ -21,7 +39,7 @@ function RecipesScreen() {
21
39
for ( let i = 0 ; i < drinkIngredients . length ; i ++ ) {
22
40
if ( ingredients . indexOf ( drinkIngredients [ i ] ) < 0 ) {
23
41
return ;
24
- }
42
+ }
25
43
}
26
44
return < RecipeCard > { drink . name } </ RecipeCard > ;
27
45
} ) }
@@ -30,3 +48,32 @@ function RecipesScreen() {
30
48
}
31
49
32
50
export default RecipesScreen ;
51
+
52
+ const styles = StyleSheet . create ( {
53
+ ceneteredView : {
54
+ flex : 1 ,
55
+ justifyContent : 'center' ,
56
+ alignItems : 'center' ,
57
+ marginTop : 22 ,
58
+ } ,
59
+ modalView : {
60
+ margin : 20 ,
61
+ marginTop : 280 ,
62
+ backgroundColor : 'white' ,
63
+ borderRadius : 20 ,
64
+ padding : 35 ,
65
+ alignItems : 'center' ,
66
+ shadowColor : '#000' ,
67
+ shadowOffset : {
68
+ width : 0 ,
69
+ height : 2 ,
70
+ } ,
71
+ shadowOpacity : 0.25 ,
72
+ shadowRadius : 4 ,
73
+ elevation : 5 ,
74
+ } ,
75
+ modalText : {
76
+ color : 'green' ,
77
+ fontSize : 12 ,
78
+ }
79
+ } ) ;
0 commit comments