Skip to content

Commit

Permalink
Style: eslint 포매터 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
abyss-s committed Aug 1, 2024
1 parent e685ac0 commit aa3a731
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/components/Map/MapUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const MapUser = ({ latitude, longitude, width, height, dogId }) => {
//const dogId = query.get("dogId");
const keyword = query.get("keyword");

// eslint-disable-next-line no-unused-vars
const initialLocation = { latitude, longitude };
// eslint-disable-next-line no-unused-vars
const { mapContainer, map, selectedDog, setSelectedDog, markers } =
Expand Down Expand Up @@ -89,6 +90,7 @@ const MapUser = ({ latitude, longitude, width, height, dogId }) => {
};

MapUser.propTypes = {
dogId: PropTypes.number.isRequired,
latitude: PropTypes.number.isRequired,
longitude: PropTypes.number.isRequired,
width: PropTypes.string,
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/useKakaoMap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useRef, useState, useCallback } from "react";
// eslint-disable-next-line no-unused-vars
import { getCoordinates } from "../apis/geolocation";
import { getAllDogs } from "../apis/getAllDogs";
import { getBoringDogs } from "../apis/getBoringDogs";
Expand All @@ -11,6 +12,7 @@ const useKakaoMap = (appKey, initialLocation, isBoring = false) => {
const [marker, setMarker] = useState(null);
const [dogMarkers, setDogMarkers] = useState([]);
const [selectedDog, setSelectedDog] = useState(null);
// eslint-disable-next-line no-unused-vars
const [positionArr, setPositionArr] = useState([]);

const makeLine = useCallback(
Expand Down
1 change: 1 addition & 0 deletions src/pages/Map/MapStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const MapStatus = () => {
const [walkUserId, setWalkUserId] = useState("");
const [ownerId, setOwnerId] = useState("");
const [socket, setSocket] = useState(null);
// eslint-disable-next-line no-unused-vars
const [roomId, setRoomId] = useState(null);

// ownerId 설정
Expand Down
12 changes: 9 additions & 3 deletions src/pages/Map/MapStatusUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getMarkedTrails } from "../../apis/trail";
import { saveWalkData } from "../../apis/walk";
import { getDistance } from "../../utils/getDistance";
import { getUserInfo } from "../../apis/getUserInfo";
// eslint-disable-next-line no-unused-vars
import { fetchChatRooms } from "../../apis/chatApi";
import authApi from "../../apis/authApi";
import html2canvas from "html2canvas";
Expand Down Expand Up @@ -152,11 +153,13 @@ const MapStatusUser = () => {
const [ownerImage, setOwnerImage] = useState("");
const [walkUserId, setWalkUserId] = useState(0);
const [showInfo, setShowInfo] = useState(false);
// eslint-disable-next-line no-unused-vars
const [roomId, setRoomId] = useState(null);
const [appointmentId, setAppointmentId] = useState(null);
const [walkId, setWalkId] = useState(null);
const previousLocation = useRef(initialLocation);

// eslint-disable-next-line no-unused-vars
const { mapContainer, map, currentLocation, setCurrentLocation } = useUserMap(
process.env.REACT_APP_KAKAO_JAVASCRIPT_KEY,
dogId,
Expand Down Expand Up @@ -269,7 +272,10 @@ const MapStatusUser = () => {
};
setCurrentLocation(newCurrentLocation);

const dist = getDistance(previousLocation.current, newCurrentLocation);
const dist = getDistance(
previousLocation.current,
newCurrentLocation,
);
previousLocation.current = newCurrentLocation;
setDistance((prevDistance) => {
const newDistance = prevDistance + dist;
Expand Down Expand Up @@ -531,8 +537,8 @@ const MapStatusUser = () => {
{walkStage === "during"
? "와 산책중입니다!"
: walkStage === "before"
? "과 산책을 시작합니다."
: "와의 산책이 종료되었습니다."}
? "과 산책을 시작합니다."
: "와의 산책이 종료되었습니다."}
</DogName>
</DogInfo>
<div ref={mapContainer} style={{ width: "100%", height: "300px" }} />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/MyInfo/ReviewReceived.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ReceivedReview = () => {
<ReviewSection>
<TitleWrapper>💌 내가 받은 리뷰</TitleWrapper>
<SectionTitle>산책 후기</SectionTitle>
{walkingReviews.length == 0 ? (
{walkingReviews.length === 0 ? (
<p>아직 작성된 리뷰가 없습니다😢</p>
) : (
walkingReviews.map((review, index) => (
Expand All @@ -70,7 +70,7 @@ const ReceivedReview = () => {
</ReviewSection>
<ReviewSection>
<SectionTitle>사용자 후기</SectionTitle>
{userReviews.length == 0 ? (
{userReviews.length === 0 ? (
<p>아직 작성된 리뷰가 없습니다😢</p>
) : (
userReviews.map((review, index) => (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/MyInfo/ReviewWritten.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const SentReview = () => {
<TitleWrapper>🖋 내가 작성한 후기</TitleWrapper>
<ReviewSection>
<SectionTitle>사용자 후기</SectionTitle>
{userReviews.length == 0 ? (
{userReviews.length === 0 ? (
<p>아직 작성된 리뷰가 없습니다😢</p>
) : (
userReviews.map((review, index) => (
Expand All @@ -70,7 +70,7 @@ const SentReview = () => {
</ReviewSection>
<ReviewSection>
<SectionTitle>산책 후기</SectionTitle>
{walkingReviews.length == 0 ? (
{walkingReviews.length === 0 ? (
<p>아직 작성된 리뷰가 없습니다😢</p>
) : (
walkingReviews.map((review, index) => (
Expand Down

0 comments on commit aa3a731

Please sign in to comment.