Skip to content

Commit

Permalink
fix: Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Najeong-Kim committed Aug 22, 2024
1 parent ddcd346 commit eddfd3c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
28 changes: 18 additions & 10 deletions src/pages/discovery-detail/ui/discovery-detail-page.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
'use client';

import { useQuery } from '@tanstack/react-query';
import Image from 'next/image';
import { useState, useCallback } from 'react';
import { toast } from 'sonner';
import blind1 from '@public/blinds/blind_01.png';
import { DiscoveryContentTabList } from '@/widgets/discovery-detail/model/constants';
import DiscoverySummary from '@/widgets/discovery-detail/ui/discovery-summary';
import { Header } from '@/widgets/header/ui';
import { WebcamMap, WebcamSlopList } from '@/widgets/webcam/ui';
import { getVoteText } from '@/features/discovery-detail/lib/getVoteText';
import AppDownloadDialog from '@/features/discovery-detail/ui/app-download-dialog';
import useMapPinch from '@/features/slop/hooks/useMapPinch';
import calculateWebcamPosition from '@/features/slop/lib/calculateWebcamPosition';
import { Discovery, DiscoveryData } from '@/entities/discovery';
import { type Discovery, DiscoveryData } from '@/entities/discovery';
import { discoveryApi } from '@/entities/discovery';
import { usePostVote } from '@/entities/discovery/api/use-post-vote';
import { RESORT_DOMAIN } from '@/entities/slop/model';
import type { Position } from '@/entities/slop/model/model';
import { cn } from '@/shared/lib';
import { discoveryApi } from '@/entities/discovery/index';
import { usePostVote } from '@/entities/discovery/api/use-post-vote';
import { toast } from 'sonner';
import CheckIcon from '@/shared/icons/check';
import { useQuery } from '@tanstack/react-query';
import { getVoteText } from '@/features/discovery-detail/lib/getVoteText';
import { cn } from '@/shared/lib';

const DiscoveryDetailPage = ({ params }: { params: { resortId: string } }) => {
if (typeof window === 'undefined') {
return null;
}

return <DiscoveryDetailPageContent params={params} />;
};

const DiscoveryDetailPageContent = ({ params }: { params: { resortId: string } }) => {
const discovery = DiscoveryData.find(
(discovery) => discovery.id === +params?.resortId
) as Discovery;
const { data: voteData } = useQuery(discoveryApi.discoveryQueries.vote(params.resortId));
const { data: voteData } = useQuery(discoveryApi.discoveryQueries.vote(params?.resortId));
const data = RESORT_DOMAIN[discovery.map as keyof typeof RESORT_DOMAIN];
const [selectedTab, setSelectedTab] = useState('webcam');
const [showAppDownloadDialog, setShowAppDownloadDialog] = useState(true);
const { mutateAsync } = usePostVote(params.resortId);
const { mutateAsync } = usePostVote(params?.resortId);

const [isGood, setIsGood] = useState<boolean>(true);
const [cameraPositions, setCameraPositions] = useState<{
Expand Down Expand Up @@ -62,7 +70,7 @@ const DiscoveryDetailPage = ({ params }: { params: { resortId: string } }) => {
} finally {
toast.success('고마워요! 투표의 결과가 반영되었어요');
}
}, [isGood]);
}, [isGood, mutateAsync]);

if (!discovery) return;

Expand Down
4 changes: 2 additions & 2 deletions src/shared/ui/snow-confetti.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import Particles, { initParticlesEngine } from '@tsparticles/react';
import { loadSnowPreset } from '@tsparticles/preset-snow';
import Particles, { initParticlesEngine } from '@tsparticles/react';
import { useEffect, useState } from 'react';
import { cn } from '../lib';

export const SnowConfetti = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/discovery/ui/discovery-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import WeatherIcon from '@/features/discovery/ui/weather-icon';
import type { Discovery } from '@/entities/discovery';
import { cn } from '@/shared/lib';
import Card from '@/shared/ui/card';
import WeeklyWeather from './weekly-weather';
import { getTargetDateWeekday } from '../lib/getTargetDateWeekday';
import WeeklyWeather from './weekly-weather';

const DiscoveryCard = ({ id, name, slope, weather, weeklyWeather }: Discovery) => {
const router = useRouter();
Expand Down

0 comments on commit eddfd3c

Please sign in to comment.