Main.js
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import styled from "styled-components";
import {useNavigation} from "@react-navigation/native";
import {useSelector} from "react-redux";
const GoToGalleryButton = styled.TouchableOpacity`
width: 60px;
border: 1px;
align-items: center;
justify-content: center;
flex: 2
`;
const GoToSelectOrTakePhotoButton = styled.TouchableOpacity`
position: absolute;
right: 20px;
bottom: 20px;
width: 30px;
height: 30px;
border-radius: 50px;
border: 15px solid green;
`;
const Main = () => {
const navigation = useNavigation();
const goToGallery = () => {
console.log(navigation.navigate);
navigation.navigate('Gallery');
};
const goToSelectOrTakePhoto = () => {
navigation.navigate('SelectOrTakePhotoStackNavigation');
};
const {me} = useSelector(state => state.user);
return (
<>
<View style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center'
}}>
<GoToGalleryButton title={'갤러리로 가보자'} onPress={goToGallery}>
<Text>갤러리로 가보자</Text>
</GoToGalleryButton>
<View style={{
flex: 8,
flexDirection: 'row'
}}>
<Text style={{
width: '100%',
flex: 1,
backgroundColor: 'red'
}}>메인페이지</Text>
<Text style={{
width: '100%',
flex: 1,
backgroundColor: 'grey',
}}>메인페이지2</Text>
<GoToSelectOrTakePhotoButton onPress={goToSelectOrTakePhoto}/>
</View>
</View>
</>
)
};
export default Main;