Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 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
1,390 changes: 113 additions & 1,277 deletions DevLog/Resource/Localizable.xcstrings

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions DevLog/UI/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct HomeView: View {
webPageSection
}
.listStyle(.insetGrouped)
.navigationTitle(String(localized: "home_title"))
.navigationTitle(String(localized: "nav_home"))
.navigationDestination(for: Path.self) { path in
switch path {
case .category(let item):
Expand Down Expand Up @@ -333,7 +333,7 @@ struct HomeView: View {
.foregroundStyle(Color(.label))
}
}
.navigationTitle(String(localized: "home_content_title"))
.navigationTitle(String(localized: "nav_home_content"))
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Expand Down
2 changes: 1 addition & 1 deletion DevLog/UI/Home/TodoManageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct TodoManageView: View {
.listRowInsets(EdgeInsets())
}
.environment(\.editMode, .constant(.active))
.navigationTitle(String(localized: "todo_manage_title"))
.navigationTitle(String(localized: "nav_todo_manage"))
.navigationBarTitleDisplayMode(.inline)
.navigationBarBackButtonHidden()
.sheet(isPresented: Binding(
Expand Down
53 changes: 36 additions & 17 deletions DevLog/UI/Profile/ProfileHeatmapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,51 @@ struct ProfileHeatmapView: View {
6: String(localized: "profile_weekday_fri")
]
let orderedWeekdays = Array(1...7)
let labelFontSize = smallestWeekdayLabelFontSize(
labels: Array(labels.values),
layout: layout
)

VStack(alignment: .leading, spacing: layout.cellSpacing) {
ForEach(orderedWeekdays, id: \.self) { weekday in
Group {
if let label = labels[weekday] {
Text(label)
.font(.caption2)
.foregroundStyle(.secondary)
.frame(
width: layout.cellSize,
height: layout.cellSize,
alignment: .leading
)
} else {
Color.clear
.frame(
width: layout.cellSize,
height: layout.cellSize
)
}
if let label = labels[weekday] {
Text(label)
.font(.system(size: labelFontSize))
.allowsTightening(true)
.foregroundStyle(.secondary)
.frame(
width: layout.cellSize,
height: layout.cellSize,
alignment: .leading
)
} else {
Color.clear
.frame(
width: layout.cellSize,
height: layout.cellSize
)
}
}
}
.padding(.top, layout.weekdayTopPadding)
}

private func smallestWeekdayLabelFontSize(labels: [String], layout: ProfileHeatmapLayout) -> CGFloat {
let captionFont = UIFont.preferredFont(forTextStyle: .caption2)
let availableWidth = max(layout.cellSize, 1)

let fittedSizes = labels.map { label in
let textWidth = max(
(label as NSString).size(withAttributes: [.font: captionFont]).width,
1
)
let widthRatio = availableWidth / textWidth
return captionFont.pointSize * min(widthRatio, 1)
}

return max((fittedSizes.min() ?? captionFont.pointSize).rounded(.down), 1)
}

private var availableWidth: CGFloat {
// ProfileView의 바깥 가로 패딩(16)과 히트맵 카드 내부 패딩(12)을 합한 값
let horizontalPadding: CGFloat = 16 + 12
Expand Down
21 changes: 11 additions & 10 deletions DevLog/UI/Profile/ProfileTrendChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,19 @@ struct ProfileTrendChartView: View {
)
.chartXAxis {
AxisMarks(values: axisWeekIndices) { value in
AxisGridLine(stroke: StrokeStyle(lineWidth: 0.5))
.foregroundStyle(.quaternary)
AxisTick(stroke: StrokeStyle(lineWidth: 0.5))
.foregroundStyle(.quaternary)
AxisValueLabel {
if let weekIndex = value.as(Int.self) {
Text(
String.localizedStringWithFormat(
String(localized: "profile_week_format"),
Int64(weekIndex)
)
)
Text("\(weekIndex)")
.font(.caption2)
.fixedSize()
}
}
if let weekIndex = value.as(Int.self), weekIndex != xDomain.upperBound {
AxisGridLine(stroke: StrokeStyle(lineWidth: 0.5))
.foregroundStyle(.quaternary)
AxisTick(stroke: StrokeStyle(lineWidth: 0.5))
.foregroundStyle(.quaternary)
}
}
}
.chartYAxis {
Expand All @@ -86,6 +83,10 @@ struct ProfileTrendChartView: View {
.clipShape(RoundedRectangle(cornerRadius: 10))
}
.frame(height: chartHeight)

Text(String(localized: "profile_week_axis"))
.font(.caption2)
.foregroundStyle(.secondary)
} else {
VStack(spacing: 6) {
Image(systemName: "chart.line.uptrend.xyaxis")
Expand Down
2 changes: 1 addition & 1 deletion DevLog/UI/PushNotification/PushNotificationListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct PushNotificationListView: View {
}
}
.refreshable { viewModel.send(.fetchNotifications) }
.navigationTitle(String(localized: "push_notifications_title"))
.navigationTitle(String(localized: "nav_push_notifications"))
.alert(
"",
isPresented: Binding(
Expand Down
2 changes: 1 addition & 1 deletion DevLog/UI/Setting/AccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct AccountView: View {
}
.scrollDisabled(true)
.listStyle(.insetGrouped)
.navigationTitle(String(localized: "account_title"))
.navigationTitle(String(localized: "nav_account"))
.onAppear {
viewModel.send(.onAppear)
}
Expand Down
2 changes: 1 addition & 1 deletion DevLog/UI/Setting/PushNotificationSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct PushNotificationSettingsView: View {
.opacity(viewModel.state.pushNotificationEnable ? 1.0 : 0.2)
}
.listStyle(.insetGrouped)
.navigationTitle(String(localized: "push_settings_title"))
.navigationTitle(String(localized: "nav_push_settings"))
.overlay {
if viewModel.state.isLoading {
LoadingView()
Expand Down
2 changes: 1 addition & 1 deletion DevLog/UI/Setting/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct SettingView: View {
Spacer()
}
}
.navigationTitle(String(localized: "settings_title"))
.navigationTitle(String(localized: "nav_settings"))
.navigationBarTitleDisplayMode(.inline)
.navigationDestination(for: Path.self) { path in
switch path {
Expand Down
2 changes: 1 addition & 1 deletion DevLog/UI/Setting/ThemeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct ThemeView: View {
.listStyle(.insetGrouped)
.toolbar {
ToolbarItem(placement: .principal) {
Text(String(localized: "theme_title"))
Text(String(localized: "nav_theme"))
.bold()
}
}
Expand Down
2 changes: 1 addition & 1 deletion DevLog/UI/Today/TodayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct TodayView: View {
}
}
.listStyle(.insetGrouped)
.navigationTitle(String(localized: "today_title"))
.navigationTitle(String(localized: "nav_today"))
.toolbar { toolbarContent }
.navigationDestination(for: Path.self) { path in
switch path {
Expand Down
Binary file added docs/AppStore_Hitmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/AppStore_Home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/AppStore_Markdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/AppStore_Notifications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/AppStore_Today.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/hitmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/markdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/today.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.