Commit d696e00e authored by YoonDongMin's avatar YoonDongMin
Browse files

0705 아이콘 해결

parent b57c613d
import React, {useState} from 'react';
import {StyleSheet, Text,View, TextInput, Button} from 'react-native';
export default function AddTodo({submitHandler}) {
const [text, setText] = useState('');
const changeHandler = (val) => {
setText(val);
}
return(
<View>
<TextInput
style = {styles.input}
placeholder = 'new todo...'
onChangeText={changeHandler}
/>
<Button onPress= {() =>submitHandler(text)} title = 'add todo' color = 'coral' />
</View>
)
}
const styles = StyleSheet.create({
input: {
marginBottom: 10,
paddingHorizontal: 8,
paddingVertical:6,
borderBottomColor: '#ddd',
borderBottomWidth: 1
}
})
\ No newline at end of file
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
export default function Header() {
return(
<View style={styles.header}>
<Text style = {styles.title}>My Todos</Text>
</View>
)
}
const styles = StyleSheet.create({
header:{
height:80,
paddingTop:38,
backgroundColor: 'coral'
},
title: {
textAlign: 'center',
color: '#fff',
fontSize: 20,
fontWeight: 'bold'
}
});
\ No newline at end of file
import React from 'react';
import {StyleSheet, Text, View} from 'react-native';
export default function Sandbox(){
return (
<View style = {styles.container}>
<Text style = {styles.boxOne}>one</Text>
<Text style = {styles.boxTwo}>two</Text>
<Text style = {styles.boxThree}>three</Text>
<Text style = {styles.boxFour}>four</Text>
</View>
)
}
const styles= StyleSheet.create({
container: {
//flex: 1,
flexDirection: 'row',
justifyContent: 'space-around' ,
alignItems: 'flex-end',
paddingTop: 40,
backgroundColor: '#ddd',
},
boxOne: {
flex:5,
backgroundColor: 'violet',
padding:10,
},
boxTwo: {
flex:1,
backgroundColor: 'gold',
padding:20,
},
boxThree: {
flex:1,
backgroundColor: 'coral',
padding:30,
},
boxFour: {
flex:1,
backgroundColor: 'skyblue',
padding:40,
}
});
\ No newline at end of file
import React from 'react';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
export default function TodoItem({item, pressHandler}) {
return(
<TouchableOpacity onPress= {() => pressHandler(item.key)}>
<View style={styles.item}>
<MaterialIcons name= 'delete' size={18} color= '#333'/>
<Text style = {styles.item}>{item.text}</Text>
</View>
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
item: {
padding:16,
marginTop:16,
borderColor: '#bbb',
borderWidth : 1,
borderStyle: 'd',
borderStyle: 'dashed',
borderRadius: 10
}
})
\ No newline at end of file
import {createStackNavigator} from 'react-navigation-stack';
import {createAppContainer} from 'react-navigation';
import Home from '../screens/home';
import ReviewDetails from '../screens/reviewDetails';
const screens = {
Home:{
screen:Home
},
ReviewDetails:{
screen: ReviewDetails
}
}
const HomeStack = createStackNavigator(screens);
export default createAppContainer(HomeStack);
\ No newline at end of file
import React from 'react';
import {StyleSheet, View, Text} from 'react-native';
export default function About() {
return (
<View style = {styles.container}>
<Text>About Screen</Text>
</View>
)
}
const styles = StyleSheet.create({
container: (
padding: 24
)
});
\ No newline at end of file
import React from 'react';
import {StyleSheet, View, Text} from 'react-native';
export default function Home() {
return (
<View style = {styles.container}>
<Text>Home Screen</Text>
</View>
)
}
const styles = StyleSheet.create({
container: (
padding: 24
)
});
\ No newline at end of file
import React from 'react';
import {StyleSheet, View, Text} from 'react-native';
export default function ReviewDetails() {
return (
<View style = {styles.container}>
<Text>ReviewDetails Screen</Text>
</View>
)
}
const styles = StyleSheet.create({
container: (
padding: 24
)
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment