Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • bottleneck
  • jwt
  • jwtreal
  • logout
  • main
  • master
  • secure
7 results

Target

Select target project
  • festivelo/festivelo_frontend
1 result
Select Git revision
  • bottleneck
  • jwt
  • jwtreal
  • logout
  • main
  • master
  • secure
7 results
Show changes
......@@ -5,10 +5,6 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<link rel="stylesheet" href="%PUBLIC_URL%/reset.css" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
......@@ -26,7 +22,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>FESTIVELO</title>
</head>
<body>
......
public/logo192.png

5.22 KiB

public/logo512.png

9.44 KiB

......@@ -157,23 +157,26 @@ const AddPlace = ({ tripId, day, onBack, onPlaceSelect, tripStartDate, tripEndDa
const currentState = tabStates[activeTab];
if (!currentState.places) return [];
// 검색어가 있을 때는 검색 결과만 반환
if (searchKeyword.trim()) {
return currentState.places;
}
// 검색어가 없을 때만 즐겨찾기와 일반 항목 표시
const currentTypeId = CONTENT_TYPE[activeTab];
const currentAreaCode = getAreaCode(location);
// 현재 탭과 지역에 맞는 즐겨찾기 항목 필터링
const matchingFavorites = favoriteItems.filter(place =>
String(place.type) === currentTypeId &&
place.areaCode === currentAreaCode
);
// 즐겨찾기에 없는 일반 항목들만 필터링
const nonFavoriteItems = currentState.places.filter(place =>
!favorites.has(place.id)
);
// 즐겨찾기 항목을 먼저, 그 다음에 일반 항목들
return [...matchingFavorites, ...nonFavoriteItems];
}, [tabStates[activeTab].places, favoriteItems, activeTab, location, favorites]);
}, [tabStates[activeTab].places, favoriteItems, activeTab, location, favorites, searchKeyword]);
const toggleFavorite = async (place) => {
if (!user) {
......@@ -470,12 +473,10 @@ const AddPlace = ({ tripId, day, onBack, onPlaceSelect, tripStartDate, tripEndDa
e.stopPropagation();
try {
// 현재 day의 plans 정보 가져오기
const tripResponse = await axios.get(`${API_URL}/api/trips/trips/${tripId}`);
const currentTrip = tripResponse.data;
const currentDayPlans = currentTrip.plans[day] || { places: [], route: [] };
// 새로운 place 객체 생성
const newPlace = {
id: place.id,
type: place.type || 12,
......@@ -484,7 +485,6 @@ const AddPlace = ({ tripId, day, onBack, onPlaceSelect, tripStartDate, tripEndDa
coordinates: place.coordinates
};
// 기존 places와 route에 새로운 장소 추가
const updatedPlaces = [...currentDayPlans.places, newPlace];
const updatedRoute = [...currentDayPlans.route, place.id];
const requestData = {
......@@ -493,17 +493,14 @@ const AddPlace = ({ tripId, day, onBack, onPlaceSelect, tripStartDate, tripEndDa
route: updatedRoute
};
console.log(requestData);
const response = await axios.put(
`${API_URL}/api/trips/trips/${tripId}/plans/day`,
requestData
);
if (response.status === 200 || response.status === 201) {
toast.success('장소가 성공으로 추가되었습니다.');
// toast.success('장소가 성공으로 추가되었습니다.');
onSuccess?.();
onBack();
}
} catch (error) {
console.error('장소 추가 실패:', error);
......
......@@ -218,7 +218,7 @@ const MyTrip = ({ trips, onPlaceSelect, onAddPlace, onDirectionSelect, onTripSel
<div className="place-number">{index + 1}</div>
<div className="place-info">
<h5 className="place-name">{place.name}</h5>
<p className="place-location">{place.location}</p>
<p className="place-location">{place.address || place.location}</p>
</div>
<button
className="delete-place-button"
......
......@@ -76,7 +76,7 @@ const MyTripWeather = ({ location }) => {
<div className="weather-container">
<h4 className="weather-title">
{loading ? (
<div className="shimmer-text"></div>
<div className="weather-shimmer-text"></div>
) : (
`${location}의 날씨는?`
)}
......
......@@ -27,8 +27,8 @@ const Home = () => {
const [showDirection, setShowDirection] = useState(false);
const [directionInfo, setDirectionInfo] = useState(null);
const [selectedLocation, setSelectedLocation] = useState({
latitude: 35.1586,
longitude: 129.1603
latitude: 37.2829,
longitude: 127.0435
});
const [ws, setWs] = useState(null);
......@@ -134,7 +134,7 @@ const Home = () => {
setTimeout(() => {
map?.relayout();
}, 200);
}, 500);
};
const handlePlaceSelect = useCallback((place) => {
......@@ -414,7 +414,7 @@ const Home = () => {
await axios.delete(`${API_URL}/api/trips/trips/${tripId}`);
setTrips(prevTrips => prevTrips.filter(trip => trip._id !== tripId));
toast.success('여행이 성공적으로 삭제되었습니다.');
// toast.success('여행이 성공적으로 삭제되었습니다.');
} catch (error) {
console.error('여행 삭제 중 오류 발생:', error);
......
......@@ -76,7 +76,7 @@
text-align: center;
}
@keyframes shimmer {
@keyframes weather-shimmer {
0% {
background-position: -200% 0;
}
......@@ -85,13 +85,13 @@
}
}
.shimmer {
.weather-shimmer {
background: #f6f7f8;
border-radius: 8px;
padding: 15px;
}
.shimmer-text {
.weather-shimmer-text {
height: 16px;
background: linear-gradient(
90deg,
......@@ -100,26 +100,7 @@
#f0f0f0 75%
);
background-size: 200% 100%;
animation: shimmer 2s infinite linear;
animation: weather-shimmer 2s infinite linear;
border-radius: 4px;
margin: 4px 0;
}
.shimmer-circle {
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(
90deg,
#f0f0f0 25%,
#e0e0e0 50%,
#f0f0f0 75%
);
background-size: 200% 100%;
animation: shimmer 2s infinite linear;
margin: 8px auto;
}
.weather-day.shimmer {
background: white;
}
\ No newline at end of file