Commit 9a694c44 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

clean 및 에러해결

parent 0c95c768
......@@ -80,7 +80,7 @@ const ChartM = ({
< PieChart
data={resDataM}
width={screenWidth}
height={screenHeight / 3}
height={screenHeight *0.3}
chartConfig={chartConfig}
accessor={"total"}
backgroundColor={"#ffffff"}
......@@ -88,7 +88,7 @@ const ChartM = ({
: <Text style={style.infoText}> 지출 내역이 없습니다.</Text>
}
<FlatList
style={{ backgroundColor: "#FFFFFF", height: screenHeight*0.42 }}
style={{ backgroundColor: "#FFFFFF", height: screenHeight*0.51 }}
data={resDataM}
renderItem={renderChart}
keyExtractor={item => item.color}
......@@ -115,7 +115,8 @@ const style = StyleSheet.create({
fontSize: 30,
textAlign: "center",
marginTop: "20%",
fontFamily: 'GowunDodum-Regular'
fontFamily: 'GowunDodum-Regular',
backgroundColor:'#ffffff'
}
});
......
......@@ -71,8 +71,8 @@ function DeptPage({ navigation }) {
<View>
<View style={{ width: '100%', height: '75%' }}>
<TabView value={selectedIndex} onChange={setSelectedIndex} >
<TabView.Item style={{ width: '100%', height: '100%' }}>
{selectedIndex === 0 ?
<View style={{ width: '100%', height: '100%' }}>
<FlatList
data={lend}
renderItem={({ item }) => (
......@@ -81,8 +81,9 @@ function DeptPage({ navigation }) {
</TouchableOpacity>
)}
/>
</TabView.Item>
<TabView.Item style={{ width: '100%', height: '100%' }}>
</View>
:
<View style={{ width: '100%', height: '100%' }}>
<FlatList
data={dept}
renderItem={({ item }) => (
......@@ -91,8 +92,8 @@ function DeptPage({ navigation }) {
</TouchableOpacity>
)}
/>
</TabView.Item>
</TabView>
</View>
}
</View>
<Ionicons
name='add'
......
......@@ -54,7 +54,7 @@ const AssetItem = ({ item }) => {
const getMarkedDates = (weeklyData) => {
if (weeklyData.length === 0) {
return null;
return ([]);
}
const markedData = weeklyData.map(data => {
......@@ -65,8 +65,7 @@ const getMarkedDates = (weeklyData) => {
}
);
})
return markedData
return (markedData)
}
const getDots = (typeArray) => {
......@@ -96,7 +95,6 @@ function MainScreen({ navigation }) {
const [selectedDate, setSelectedDate] = useState(getDateStr())
const [startingDate, setStartingDate] = useState(initialStartingDate)
const [endDate, setEndDate] = useState(initialEndDate)
const [weekMoney, setWeekMoney] = useState({ input: 0, output: 0 })
const [markedDates, setMarkedDates] = useState([])
......@@ -106,16 +104,18 @@ function MainScreen({ navigation }) {
const [totalAssetsMoney, setTotalAssetsMoney] = useState([])
useEffect(() => {
getthisWeekData(initialStartingDate, initialEndDate)
getTotalMoney()
getSingleData()
getthisWeekData(initialStartingDate, initialEndDate);
getTotalMoney();
getSingleData();
}, [isFocused])
const getthisWeekData = async (start, end) => {
const { data, input, output } = await weekApi.getWeeklyData(start, end)
setStartingDate(start)
setWeekMoney({ input: input, output, output })
setTimeout(() => {
setMarkedDates(getMarkedDates(data))
}, 300)
}
const getWeeklyData = async (start, end) => {
......@@ -152,7 +152,7 @@ function MainScreen({ navigation }) {
selectedDate={selectedDate}
startingDate={startingDate}
onWeekChanged={(start, end) => getWeeklyData(start, end)}
onDateSelected={(date) => setSelectedDate(date)}
onDateSelected={(date) => setSelectedDate(getDateStr(date))}
markedDates={markedDates}
/>
<View style={style.weekData}>
......@@ -165,7 +165,7 @@ function MainScreen({ navigation }) {
{
singleMoney.length !== 0 ?
<View>
{singleMoney.length !== 0 && singleMoney.map((item, index) => <DetailItem item={item} key={index} onPress={() => navigation.navigate('UpdatePage', [selectedDate, item])}/>)}
{singleMoney.length !== 0 && singleMoney.map((item, index) => <DetailItem item={item} key={index} onPress={() => navigation.navigate('UpdatePage', [selectedDate, item])} />)}
</View>
: <View style={{ marginTop: 10, marginBottom: 50 }}>
<Text style={{ textAlign: "center", fontSize: 20, fontFamily: 'GowunDodum-Regular' }}>내역이 없습니다.</Text>
......@@ -195,7 +195,7 @@ function MainScreen({ navigation }) {
onClose={() => setOpen(!open)}
>
<SpeedDial.Action
icon={<FontAwesome name={'money'} size={20} color={'#fff'}/>}
icon={<FontAwesome name={'money'} size={20} color={'#fff'} />}
title="부채"
onPress={() => navigation.navigate('DeptPage')}
/>
......
......@@ -51,9 +51,9 @@ const PostMoney = ({ navigation }) => {
useEffect(() => {
let isProper = false
if (selectedIndex === 2) {
isProper = [contents, price, selected_asset_type.value, selected_deposit_asset_type.value, selected_cat.value].every( elem => elem !== '')
isProper = [contents, price, selected_asset_type.value, selected_deposit_asset_type.value, selected_cat.value].every(elem => elem !== '')
} else {
isProper = [contents, price, selected_asset_type.value, selected_cat.value].every( elem => elem !== '')
isProper = [contents, price, selected_asset_type.value, selected_cat.value].every(elem => elem !== '')
}
if (isProper) {
......@@ -121,7 +121,9 @@ const PostMoney = ({ navigation }) => {
}
if (success) {
setTimeout(() => {
navigation.goBack()
}, 500)
}
return (
......@@ -131,7 +133,7 @@ const PostMoney = ({ navigation }) => {
<View style={{ flex: 1 }}>
<View>
<ButtonsForm
onPress={(index) => {setSelectedIndex(index); Keyboard.dismiss();}}
onPress={(index) => { setSelectedIndex(index); Keyboard.dismiss(); }}
selectedIndex={selectedIndex}
group={["수입", "지출", "이동"]} />
<DatePicker
......
......@@ -134,8 +134,11 @@ function updatePage({ navigation, route }) {
}
if (success) {
setTimeout(() => {
navigation.goBack()
}, 500)
}
return (
<TouchableWithoutFeedback onPress={() => {
Keyboard.dismiss();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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