Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {

const Stack = createStackNavigator();

const App: () => React$Node = () => {
const App = () => {
const [appUser, setAppUser ] = useState(" "); // 유저 통과
const MainTabComp = useCallback((props) => { return (<MainScreen {...props} setAppUser={setAppUser} />) },[setAppUser]);
const LoginComp = useCallback((props) => { return (<MainScreen {...props} setAppUser={setAppUser} />) },[setAppUser]);
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['react-native-reanimated/plugin'],
};
26,964 changes: 0 additions & 26,964 deletions package-lock.json

This file was deleted.

53 changes: 0 additions & 53 deletions package.json

This file was deleted.

101 changes: 101 additions & 0 deletions src/components/OrderPlaceDropDown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import React, { useState } from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { Dropdown } from 'react-native-element-dropdown';
import AntDesign from 'react-native-vector-icons/AntDesign';
import Ionicons from 'react-native-vector-icons/Ionicons';

const data = [
{ label: 'N1', value: '1' },
{ label: 'N2', value: '2' },
{ label: 'N3', value: '3' },
{ label: 'N4', value: '4' },
{ label: 'N5', value: '5' },
];

const OrderPlaceDropDown = () => {

const [value, setValue] = useState(null);

const renderItem = (item) => {
return (
<View style={styles.item}>
<Text style={styles.textItem}>{item.label}</Text>
{item.value === value && (<Ionicons style={styles.icon} color="black" name="checkmark" size={20}/>)}
</View>
);
};

return (
<Dropdown
style={styles.dropdown}
placeholderStyle={styles.placeholderStyle}
selectedTextStyle={styles.selectedTextStyle}
inputSearchStyle={styles.inputSearchStyle}
iconStyle={styles.iconStyle}
data={data}
search
maxHeight={300}
labelField="label"
valueField="value"
placeholder="건물을 선택해주세요"
searchPlaceholder="검색어를 입력하세요"
value={value}
onChange={item => {
setValue(item.value);
}}
renderLeftIcon={() => (
<Ionicons style={styles.icon} color="black" name="checkmark" size={20} />)}
renderItem={renderItem}
/>
);
};
export default OrderPlaceDropDown;

const styles = StyleSheet.create({
dropdown: {
marginLeft: 16,
marginRight: 16,
marginTop: 16,
height: 50,
width:'90%',
backgroundColor: 'white',
borderRadius: 12,
padding: 12,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.2,
shadowRadius: 1.41,

elevation: 2,
},
icon: {
marginRight: 5,
},
item: {
padding: 17,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
textItem: {
flex: 1,
fontSize: 16,
},
placeholderStyle: {
fontSize: 16,
},
selectedTextStyle: {
fontSize: 16,
},
iconStyle: {
width: 20,
height: 20,
},
inputSearchStyle: {
height: 40,
fontSize: 16,
},
});
101 changes: 101 additions & 0 deletions src/components/PlaceDropDown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import React, { useState } from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { Dropdown } from 'react-native-element-dropdown';
import AntDesign from 'react-native-vector-icons/AntDesign';
import Ionicons from 'react-native-vector-icons/Ionicons';

const data = [
{ label: '투썸 플레이스 카이스트점', value: '1' },
{ label: '파스쿠찌 카이스트점', value: '2' },
{ label: '카페 오가다 카이스트점', value: '3' },
{ label: '주스킹 카이스트점', value: '4' },
{ label: '스무디킹 카이스트점', value: '5' },
];

const PlaceDropDown = () => {

const [value, setValue] = useState(null);

const renderItem = (item) => {
return (
<View style={styles.item}>
<Text style={styles.textItem}>{item.label}</Text>
{item.value === value && (<Ionicons style={styles.icon} color="black" name="checkmark" size={20}/>)}
</View>
);
};

return (
<Dropdown
style={styles.dropdown}
placeholderStyle={styles.placeholderStyle}
selectedTextStyle={styles.selectedTextStyle}
inputSearchStyle={styles.inputSearchStyle}
iconStyle={styles.iconStyle}
data={data}
search
maxHeight={300}
labelField="label"
valueField="value"
placeholder="주문할 장소를 선택해주세요"
searchPlaceholder="검색어를 입력하세요"
value={value}
onChange={item => {
setValue(item.value);
}}
renderLeftIcon={() => (
<Ionicons style={styles.icon} color="black" name="checkmark" size={20} />)}
renderItem={renderItem}
/>
);
};
export default PlaceDropDown;

const styles = StyleSheet.create({
dropdown: {
marginLeft: 16,
marginRight: 16,
marginTop: 16,
height: 50,
width:'90%',
backgroundColor: 'white',
borderRadius: 12,
padding: 12,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.2,
shadowRadius: 1.41,

elevation: 2,
},
icon: {
marginRight: 5,
},
item: {
padding: 17,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
textItem: {
flex: 1,
fontSize: 16,
},
placeholderStyle: {
fontSize: 16,
},
selectedTextStyle: {
fontSize: 16,
},
iconStyle: {
width: 20,
height: 20,
},
inputSearchStyle: {
height: 40,
fontSize: 16,
},
});
3 changes: 0 additions & 3 deletions src/components/main/MainList.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import {useNavigation} from '@react-navigation/native';
import MainListItem from './MainListItem';
import dummy from '../../db/data.json';




const MainList = ({search}) =>{
const navigation = useNavigation();
// const [orderList, setOrderList] = useState([]);
Expand Down
5 changes: 0 additions & 5 deletions src/components/main/MainListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const MainListItem =({item})=>{

const onPress = useCallback((item)=>{
navigation.navigate('OrderListScreen', {item});

}, [navigation, item]);

return(
Expand All @@ -23,22 +22,18 @@ const MainListItem =({item})=>{

<Text style={{fontSize:24}}>5000원</Text>
<View style={{flexDirection:'row', justifyContent:'center'}}>

<View style={styles.innerContainer}>
<Text style={styles.smalltext}>인원</Text>
<Text style={styles.smalltext}>6</Text>
</View>

<View style={styles.innerContainer}>
<Text style={styles.smalltext}>주문</Text>
<Text style={styles.smalltext}>8</Text>
</View>

<View style={styles.innerContainer}>
<Text style={styles.smalltext}>배달비</Text>
<Text style={styles.smalltext}>500원</Text>
</View>

</View>
</View>
</View>
Expand Down
20 changes: 20 additions & 0 deletions src/components/menu/MenuList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React, { useEffect, useState, useCallback } from 'react';
import { View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
import {useNavigation} from '@react-navigation/native';
import {MenuListItem} from './MenuListItem';
import dummy from '../../db/data.json';

const MenuList = ({}) =>{
// const [orderList, setOrderList] = useState([]);

return(
<ScrollView>
<View>
<MenuListItem/>
</View>
</ScrollView>

);
}
export default MenuList;
Loading