Skip to content
Merged
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
16 changes: 1 addition & 15 deletions components/home-screen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
import { CloudOff, RefreshCw } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { AppHeader } from "@/components/app-header";
import { EmptyState } from "@/components/empty-state";
Expand Down Expand Up @@ -79,8 +78,7 @@ export function HomeScreen() {
onLocationClick={() => setNeedsManualInput(true)}
onRefresh={() => void refreshWeather()}
/>
{hasWeatherData && hasWeatherError && <ConnectionNotice onRetry={refreshWeather} isRetrying={summary.isFetching || reports.isFetching || isManualRefreshAnimating} />}
{showLocationError ? <ErrorState message="현재 동네를 불러오지 못했어요." transparent /> : showFullWeatherError ? <ErrorState onRetry={refreshWeather} transparent /> : <>
{showLocationError ? <ErrorState message="현재 동네를 불러오지 못했어요." transparent /> : showFullWeatherError ? <div className="flex min-h-64 flex-col items-center justify-center text-center"><p className="font-extrabold">서버 오류입니다</p><p className="mt-1 text-sm text-[#718594]">관리자에게 문의해 주세요</p></div> : <>
{summary.data
? <WeatherSummary summary={summary.data} />
: isInitialWeatherLoading || (!summary.isError && summary.isPending)
Expand All @@ -101,15 +99,3 @@ export function HomeScreen() {
</div>
);
}

function ConnectionNotice({ onRetry, isRetrying }: { onRetry: () => void; isRetrying: boolean }) {
return (
<div className="mb-4 flex items-center gap-3 rounded-[18px] border-2 border-[#f0dfc8] bg-[#fff9ef] px-4 py-3 text-[#806846]" role="status">
<CloudOff size={18} className="shrink-0" />
<p className="min-w-0 flex-1 text-xs font-bold leading-5">서버 연결이 원활하지 않아 최근 데이터를 표시하고 있어요.</p>
<button type="button" onClick={onRetry} disabled={isRetrying} className="flex size-8 shrink-0 items-center justify-center rounded-xl border-2 border-[#d2e3ec] transition-colors hover:text-[#268fc7] disabled:cursor-wait disabled:opacity-50" aria-label="날씨 다시 불러오기">
<RefreshCw size={15} className={isRetrying ? "animate-spin" : ""} />
</button>
</div>
);
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nalssilog-web",
"version": "0.1.12",
"version": "0.1.13",
"private": true,
"scripts": {
"config:init": "git -c submodule.env-config.update=checkout submodule update --init --checkout env-config && git -C env-config switch main && git -C env-config pull --ff-only origin main && npm run config:sync",
Expand Down