diff --git a/src/assets/images/svg/PhotoUploadIcon.svg b/src/assets/images/svg/PhotoUploadIcon.svg
new file mode 100644
index 0000000..646be21
--- /dev/null
+++ b/src/assets/images/svg/PhotoUploadIcon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/components/NewPost.js b/src/components/NewPost.js
index d821d89..eacd69c 100644
--- a/src/components/NewPost.js
+++ b/src/components/NewPost.js
@@ -2,105 +2,162 @@ import React, { useState } from "react";
import { View, Text, StyleSheet, TextInput, TouchableOpacity, Image } from "react-native";
import {launchCamera, launchImageLibrary, CameraOptions, ImagePickerResponse, ImageLibraryOptions, Asset} from 'react-native-image-picker';
import axios from "axios";
+import PhotoUploadIcon from '../assets/images/svg/PhotoUploadIcon.svg';
const NewPost = () => {
+ const [photo, setPhoto] = useState(null);
+ const [text, setText] = useState('');
+ const userId = 'user1';
- const [photo, setPhoto] = useState(null);
- const [text, setText] = useState('');
- const userId = 'user1';
+ const onSelectImage = () => {
+ launchImageLibrary(
+ {
+ mediaType: 'photo',
+ maxWidth: 512,
+ maxHeight: 512,
+ includeBase64: Platform.OS === 'android',
+ },
+ (res) => {
+ console.log(res);
+ if (res.didCancel) return;
+ setPhoto(res);
+ }
+ );
+ };
+ const handleUploadPhoto = () => {
+ const formData = new FormData();
- const onSelectImage = () => {
- launchImageLibrary(
- {
- mediaType: "photo",
- maxWidth: 512,
- maxHeight: 512,
- includeBase64: Platform.OS === 'android',
- },
- (res) => {
- console.log(res);
- if (res.didCancel) return;
- setPhoto(res);
- },
- )
- }
- const handleUploadPhoto = () => {
- const formData = new FormData();
+ formData.append('img', {
+ name: photo.assets[0].fileName,
+ type: photo.assets[0].type,
+ uri: photo.assets[0].uri,
+ });
- formData.append("img", {
- name: photo.assets[0].fileName,
- type: photo.assets[0].type,
- uri: photo.assets[0].uri,
- });
+ formData.append('writeTxt', text);
- formData.append('writeTxt', text);
+ axios
+ .post(`http://52.79.97.196:8080/photobook/write/${userId}`, formData, {
+ headers: {
+ 'Content-Type': 'multipart/form-data',
+ },
+ })
+ .then((response) => {
+ console.log('upload success', response);
+ alert('Upload success!');
+ setPhoto(null);
+ setText('');
+ })
+ .catch((error) => {
+ console.log('upload error', error);
+ alert('Upload failed!');
+ });
+ };
- axios.post(`http://52.79.97.196:8080/photobook/write/${userId}`, formData, {
- headers: {
- 'Content-Type': 'multipart/form-data'
- }
- })
- .then(response => {
- console.log("upload success", response);
- alert("Upload success!");
- setPhoto(null);
- setText('');
- })
- .catch(error => {
- console.log("upload error", error);
- alert("Upload failed!");
- });
- };
- return (
-
- {photo && (
-
- )}
-
- Choose Photo
-
- setText(text)}
- value={text}
- />
-
- Upload Photo
-
-
- );
+ return (
+
+ {photo && (
+
+ )}
+ {!photo && (
+
+
+ 터치해서 사진을 선택해주세요!
+
+ )}
+ setText(text)}
+ value={text}
+ />
+
+ 업로드
+
+
+ );
};
const styles = StyleSheet.create({
- container: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: '#F5FCFF',
- },
- button: {
- backgroundColor: '#ff6200',
- padding: 10,
- borderRadius: 5,
- alignItems: 'center',
- marginTop: 10,
+ container: {
+ flex: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ // backgroundColor: '#F5FCFF',
+ },
+ photo: {
+ width: 300,
+ height: 300,
+ borderRadius: 30,
+ },
+ selectPhotoButton: {
+ flexDirecion: 'row',
+ justifyContent: 'center',
+ alignItems: 'center',
+ width: 300,
+ height: 300,
+ borderRadius: 30,
+ backgroundColor: 'white',
+ shadowColor: '#000',
+ shadowOffset: {
+ width: 0,
+ height: 2,
},
- buttonText: {
- color: '#fff',
- fontSize: 16,
+ shadowOpacity: 0.25,
+ shadowRadius: 3.84,
+ elevation: 5,
+ },
+ photoUploadIcon: {
+ width: 50,
+ height: 50,
+ fill: 'gray',
+ marginBottom: 30,
+ },
+ selectPhotoButtonText: {
+ fontSize: 18,
+ fontWeight: '600',
+ color: 'gray'
+ },
+ input: {
+ width: '90%',
+ height: 150,
+ borderRadius: 15,
+ marginTop: 30,
+ paddingHorizontal: 15,
+ paddingVertical: 5,
+ backgroundColor: '#FFF',
+ shadowColor: '#000',
+ shadowOffset: {
+ width: 0,
+ height: 2,
},
- input: {
- height: 50,
- width: 300,
- borderColor: '#ddd',
- borderWidth: 1,
- marginTop: 10,
- padding: 10,
+ shadowOpacity: 0.25,
+ shadowRadius: 3.84,
+ elevation: 5,
+ },
+ button: {
+ width: 85,
+ backgroundColor: '#F7B599',
+ paddingHorizontal: 10,
+ paddingVertical: 7,
+ borderRadius: 10,
+ alignItems: 'center',
+ marginTop: 30,
+
+ shadowColor: '#000', // 그림자 색상
+ shadowOffset: {
+ width: 0, // 좌우 그림자 위치
+ height: 2, // 상하 그림자 위치
},
+ shadowOpacity: 0.25, // 그림자 투명도
+ shadowRadius: 3.84, // 그림자 반경
+
+ elevation: 3, // Android에만 적용되는 그림자 깊이
+ },
+ buttonText: {
+ color: '#fff',
+ fontSize: 14,
+ },
});
-export default NewPost;
+export default NewPost;
\ No newline at end of file
diff --git a/src/page/AlbumDedetailPage.js b/src/page/AlbumDedetailPage.js
index 04e411a..58ed5f0 100644
--- a/src/page/AlbumDedetailPage.js
+++ b/src/page/AlbumDedetailPage.js
@@ -163,7 +163,7 @@ const styles = StyleSheet.create({
height: 40,
borderWidth: 1,
borderColor: '#ccc',
- borderRadius: 4,
+ borderRadius: 10,
paddingHorizontal: 10,
marginRight: 10,
},
@@ -171,7 +171,7 @@ const styles = StyleSheet.create({
backgroundColor: '#F7B599',
paddingHorizontal: 15,
paddingVertical: 8,
- borderRadius: 4,
+ borderRadius: 10,
},
commentButtonText: {
color: 'white',
diff --git a/src/page/QuizPostPage.js b/src/page/QuizPostPage.js
index e72618f..efabe60 100644
--- a/src/page/QuizPostPage.js
+++ b/src/page/QuizPostPage.js
@@ -1,5 +1,5 @@
import React, { useContext, useState } from "react";
-import { View, TextInput, Button, StyleSheet } from 'react-native';
+import { View, TextInput, Button, StyleSheet, TouchableOpacity, Text } from 'react-native';
import { RadioButton } from 'react-native-paper';
import { UserContext } from "../../App";
@@ -38,33 +38,40 @@ const QuizPostPage = () => {
return (
-
-
+ Quiz
+
+
- {[answer1, answer2, answer3, answer4].map((answer, index) => (
-
- setQuizAns(String(index + 1))}
- />
- {
- if (index === 0) setAnswer1(text);
- else if (index === 1) setAnswer2(text);
- else if (index === 2) setAnswer3(text);
- else if (index === 3) setAnswer4(text);
- }}
- />
-
- ))}
-
+ {[answer1, answer2, answer3, answer4].map((answer, index) => (
+
+ setQuizAns(String(index + 1))}
+ color='#F7B599'
+ />
+ {
+ if (index === 0) setAnswer1(text);
+ else if (index === 1) setAnswer2(text);
+ else if (index === 2) setAnswer3(text);
+ else if (index === 3) setAnswer4(text);
+ }}
+ />
+
+ ))}
+
+ Quiz 만들기
+
);
};
@@ -74,9 +81,34 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
- backgroundColor: '#F5FCFF',
+ backgroundColor:'#f2f2f2',
padding: 20,
},
+ quizTitle: {
+ fontSize: 30,
+ fontWeight: '600',
+ marginBottom: 70,
+ },
+ quizButton: {
+ borderRadius: 20,
+ paddingHorizontal: 30,
+ paddingVertical: 10,
+ marginTop: 30,
+ backgroundColor: '#F7B599',
+
+ shadowColor: '#000',
+ shadowOffset: {
+ width: 0,
+ height: 2,
+ },
+ shadowOpacity: 0.25,
+ shadowRadius: 3.84,
+ elevation: 5,
+ },
+ quizButtonText: {
+ fontSize: 16,
+ fontWeight: '600',
+ },
inputContainer: {
flexDirection: 'row',
alignItems: 'center',
@@ -85,10 +117,21 @@ const styles = StyleSheet.create({
input: {
flex: 1,
height: 40,
- borderColor: 'gray',
- borderWidth: 1,
+ borderRadius: 20,
marginTop: 10,
- padding: 10,
+ marginBottom: 10,
+ paddingHorizontal: 15,
+ paddingVertical: 10,
+ backgroundColor: 'white',
+
+ shadowColor: '#000',
+ shadowOffset: {
+ width: 0,
+ height: 2,
+ },
+ shadowOpacity: 0.25,
+ shadowRadius: 3.84,
+ elevation: 5,
},
});
diff --git a/src/page/navbar/AlbumPage.js b/src/page/navbar/AlbumPage.js
index bead3be..c23870a 100644
--- a/src/page/navbar/AlbumPage.js
+++ b/src/page/navbar/AlbumPage.js
@@ -4,20 +4,25 @@ import { UserContext } from '../../../App'
const Post = ({ item, navigation }) => {
return (
- navigation.navigate('AlbumDetail', { item })}>
-
-
-
-
-
- {item.user_nickname}
-
- {item.photo_txt}
-
-
- {item.write_date}
-
-
+ navigation.navigate('AlbumDetail', { item })}
+ activeOpacity={0.7}
+ >
+
+
+
+
+
+
+ {item.user_nickname}
+
+ {item.photo_txt}
+
+
+
+ {item.write_date}
+
+
);
};
@@ -42,9 +47,11 @@ const AlbumPage = ({navigation}) => {
}, [familyId]);
return (
- 가족엘범
+ 가족 앨범
}
keyExtractor={item => item.photo_id.toString()}
/>
@@ -59,44 +66,62 @@ const AlbumPage = ({navigation}) => {
const styles = StyleSheet.create({
container: {
- padding: 10,
+ width: "100%",
+ paddingBottom: 100,
backgroundColor:'#f2f2f2',
+// backgroundColor: 'red',
},
post: {
+ width: '100%',
+ height: 150,
+ display:'flex',
+ flexDirection:'row',
+// alignItems: 'center',
marginBottom: 20,
+ padding: 15,
+ borderRadius: 20,
borderColor: '#ddd',
- borderWidth: 1,
- borderRadius: 10,
- padding: 5,
backgroundColor:'#fff',
- display:'flex',
- flexDirection:'row',
+// backgroundColor: 'blue',
shadowColor: '#000', // 그림자 색상
shadowOffset: {
width: 0, // 좌우 그림자 위치
- height: 2, // 상하 그림자 위치
+// height: 2, // 상하 그림자 위치
+ height: 2,
},
shadowOpacity: 0.25, // 그림자 투명도
shadowRadius: 3.84, // 그림자 반경
-
+// shadowRadius: 10,
elevation: 5, // Android에만 적용되는 그림자 깊이
},
+ imgContentContainer: {
+ flexDirection: 'row',
+ width: '83%',
+ justifyContent: 'center',
+ alignItems: 'flex-start',
+// backgroundColor: 'coral',
+ },
title: {
fontSize: 24,
fontWeight: 'bold',
textAlign: 'center',
- marginBottom:20,
+ marginBottom:40,
marginTop: 20,
},
+ albumFlatlist: {
+ width: '100%',
+ paddingTop: 10,
+ paddingHorizontal: 10,
+ },
contentContainer: {
flexDirection: 'column',
flex:1,
alignItems: 'start',
justifyContent:'flex-start',
marginBottom: 10,
+// backgroundColor: 'coral',
},
userContainer:{
-
flexDirection: 'row',
justifyContent:'center',
alignItems:'center',
@@ -112,24 +137,28 @@ const styles = StyleSheet.create({
flex: 1,
},
dateContainer: {
+ alignItems: 'center',
justifyContent: 'flex-end',
-
+ width: '17%',
+// backgroundColor: 'cornflowerblue',
},
date: {
- fontSize: 12,
+ fontSize: 10,
color: 'gray',
},
image: {
- width: 100,
- height: 100,
+ width: 120,
+ height: 120,
- borderRadius: 1,
+ marginRight: 10,
+ borderRadius: 10,
borderColor: '#ddd',
borderWidth: 1,
},
text: {
- marginTop: 20,
- fontSize: 16,
+ marginTop: 10,
+ fontSize: 13,
+ fontWeight: 600,
},
addButton: {
zIndex:10,
@@ -140,8 +169,8 @@ const styles = StyleSheet.create({
borderRadius: 30,
alignItems: 'center',
justifyContent: 'center',
- right: 10,
- bottom: 85,
+ right: 15,
+ bottom: 120,
shadowColor: '#000',
shadowOffset: {
width: 0,