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
6 changes: 4 additions & 2 deletions Tests/UI/HomeWeatherLayoutTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ final class HomeWeatherLayoutTests: XCTestCase {
}

func testWeatherAvailabilityDistinguishesServerStatesAndUsesSunnyFallback() {
XCTAssertEqual(weather(delta: nil, availability: "UNAVAILABLE", skyStatus: nil).weatherStatusText, "기상 정보 없음")
XCTAssertEqual(weather(delta: nil, availability: "UNAVAILABLE", skyStatus: nil).weatherStatusText, "정보 없음")
XCTAssertEqual(weather(delta: nil, availability: "CACHED", skyStatus: nil).weatherStatusText, "이전 정보")
XCTAssertEqual(weather(delta: nil, availability: "AVAILABLE", skyStatus: nil).weatherStatusText, "날씨 확인 중")
XCTAssertEqual(weather(delta: nil, availability: "AVAILABLE", skyStatus: nil).weatherStatusText, "확인 중")
XCTAssertEqual(weather(delta: nil, availability: nil, skyStatus: nil).weatherStatusText, "정보 없음")
XCTAssertEqual(weather(delta: nil, skyStatus: "CLEAR").weatherStatusText, "맑음")
XCTAssertEqual(weather(delta: nil, skyStatus: "CLOUDY").weatherStatusText, "흐림")
XCTAssertEqual(weather(delta: nil, availability: nil, skyStatus: nil).skyIllustrationAssetName, "WeatherSunny")
}

Expand Down
4 changes: 2 additions & 2 deletions heatguard-iOS/Core/Dashboard/HGDashboardService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ struct HomeWeather: Equatable {
case "SNOW": "눈"
default:
switch availability {
case "UNAVAILABLE": "기상 정보 없음"
case "UNAVAILABLE": "정보 없음"
case "CACHED": "이전 정보"
case "AVAILABLE": "날씨 확인 중"
case "AVAILABLE": "확인 중"
default: "정보 없음"
}
}
Expand Down
14 changes: 8 additions & 6 deletions heatguard-iOS/Presentation/Features/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ struct HomeView: View {
HomeMetric(
symbol: dashboard.weather.skySymbol,
symbolColor: weatherSymbolColor(for: dashboard.weather.skyStatus),
title: "날씨",
title: nil,
value: dashboard.weather.weatherStatusText
)
}
Expand Down Expand Up @@ -876,14 +876,14 @@ private struct HomeMetric: View {
var icon: String?
var symbol: String?
var symbolColor: Color?
let title: String
let title: String?
let value: String

init(
icon: String? = nil,
symbol: String? = nil,
symbolColor: Color? = nil,
title: String,
title: String?,
value: String
) {
self.icon = icon
Expand Down Expand Up @@ -912,9 +912,11 @@ private struct HomeMetric: View {
.background(HGColor.homeMetricIconBackground, in: Circle())

VStack(alignment: .leading, spacing: 2) {
Text(title)
.font(HGFont.regular(10, relativeTo: .caption2))
.foregroundStyle(HGColor.secondaryText)
if let title {
Text(title)
.font(HGFont.regular(10, relativeTo: .caption2))
.foregroundStyle(HGColor.secondaryText)
}

Text(value)
.font(HGFont.bold(14, relativeTo: .caption))
Expand Down
Loading