Skip to content
Open

Crew #57

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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
"react-native-bouncy-checkbox": "^4.1.2",
"react-native-calendars": "^1.1307.0",
"react-native-date-picker": "^5.0.7",
"react-native-dropdown-picker": "^5.4.6",
"react-native-dropdown-picker": "5.4.7-beta.1",
"react-native-element-dropdown": "^2.12.2",
"react-native-geocoding": "^0.5.0",
"react-native-geolocation-service": "^5.3.1",
"react-native-gesture-handler": "^2.20.2",
"react-native-gesture-handler": "^2.21.2",
"react-native-google-places-autocomplete": "^2.5.7",
"react-native-image-crop-picker": "^0.41.5",
"react-native-image-picker": "^7.1.2",
Expand Down
3 changes: 2 additions & 1 deletion src/components/ActivitySelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ ActivitySelector.propTypes = {
updateActivityTime: PropTypes.func.isRequired,
};

export default ActivitySelector;
export default ActivitySelector;

29 changes: 20 additions & 9 deletions src/components/Calendars.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ const Calendars = ({ onDayPress, dataSource, fetchMonthlyRecords }) => {

useEffect(() => {
const marks = {};
dataSource.forEach(record => {
const date = record.startTime
? record.startTime.split('T')[0]
: record.date;
marks[date] = {
marked: true,
dotColor: selectedDate === date ? 'white' : 'black',
};
});
if (dataSource) {
dataSource.forEach(record => {
const date = record.startTime
? record.startTime.split('T')[0]
: record.date;
marks[date] = {
marked: true,
dotColor: selectedDate === date ? 'white' : 'black',
};
});
}
marks[selectedDate] = {
selected: true,
selectedColor: '#73D393',
Expand All @@ -37,6 +39,15 @@ const Calendars = ({ onDayPress, dataSource, fetchMonthlyRecords }) => {
setMarkedDates(marks);
}, [dataSource, selectedDate]);

useEffect(() => {
const yearMonth = `${currentMonth.year}-${String(
currentMonth.month,
).padStart(2, '0')}`;
if (fetchMonthlyRecords) {
fetchMonthlyRecords(yearMonth);
}
}, [currentMonth]); // currentMonth가 변경될 때만 호출되도록 설정

const handleDayPress = day => {
const newMarkedDates = { ...markedDates };
if (selectedDate) {
Expand Down
Loading