기존)
<Text
style={{
...styles.btnText,
color: !isworking ? 'white' : theme.color,
}}
>
수정)
<Text
style={{
fontSize: 38,
fontWeight: '600',
color: isworking ? 'white' : theme.color,
}}
>
기존)
Alert.alert('Delete To Do', 'Are you sure?', [
{ text: 'Cancel' },
{
text: "I'm Sure",
style: 'destructive',
onPress: () => {
const newTodos = { ...todos };
delete newTodos[key];
setTodos(newTodos);
saveTodo(newTodos);
},
},
]);
수정) Platform.OS === 'web'
if (Platform.OS === 'web') {
const ok = confirm('do you want to delete this todo?')
if (ok) {
const newTodos = { ...todos };
delete newTodos[key];
setTodos(newTodos);
saveTodo(newTodos);
}
}
else {
Alert.alert('Delete To Do', 'Are you sure?', [
{ text: 'Cancel' },
{
text: "I'm Sure",
style: 'destructive',
onPress: () => {
const newTodos = { ...todos };
delete newTodos[key];
setTodos(newTodos);
saveTodo(newTodos);
},
},
]);