Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
6c524ba855
commit
49f3fb90a9
@ -83,6 +83,11 @@ struct HistoryView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
||||||
|
if horizontalSizeClass == .regular {
|
||||||
|
Text(String(localized: "History")).styled(.heroBold)
|
||||||
|
.padding(.bottom, Design.Spacing.small)
|
||||||
|
}
|
||||||
|
|
||||||
// Ritual filter picker
|
// Ritual filter picker
|
||||||
ritualPicker
|
ritualPicker
|
||||||
|
|
||||||
@ -106,6 +111,7 @@ struct HistoryView: View {
|
|||||||
.id(refreshToken)
|
.id(refreshToken)
|
||||||
}
|
}
|
||||||
.padding(Design.Spacing.large)
|
.padding(Design.Spacing.large)
|
||||||
|
.adaptiveContentWidth()
|
||||||
}
|
}
|
||||||
.background(LinearGradient(
|
.background(LinearGradient(
|
||||||
colors: [AppSurface.primary, AppSurface.secondary],
|
colors: [AppSurface.primary, AppSurface.secondary],
|
||||||
@ -113,7 +119,7 @@ struct HistoryView: View {
|
|||||||
endPoint: .bottomTrailing
|
endPoint: .bottomTrailing
|
||||||
))
|
))
|
||||||
.navigationTitle(String(localized: "History"))
|
.navigationTitle(String(localized: "History"))
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .primaryAction) {
|
ToolbarItem(placement: .primaryAction) {
|
||||||
if hasMoreHistory || monthsToShow > baseMonthsToShow {
|
if hasMoreHistory || monthsToShow > baseMonthsToShow {
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import UniformTypeIdentifiers
|
|||||||
|
|
||||||
struct InsightsView: View {
|
struct InsightsView: View {
|
||||||
@Bindable var store: RitualStore
|
@Bindable var store: RitualStore
|
||||||
|
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||||
@State private var refreshToken = UUID()
|
@State private var refreshToken = UUID()
|
||||||
@State private var isEditing = false
|
@State private var isEditing = false
|
||||||
@State private var draggingCard: InsightCardType?
|
@State private var draggingCard: InsightCardType?
|
||||||
@ -29,6 +30,11 @@ struct InsightsView: View {
|
|||||||
NavigationStack {
|
NavigationStack {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
||||||
|
if horizontalSizeClass == .regular {
|
||||||
|
Text(String(localized: "Insights")).styled(.heroBold)
|
||||||
|
.padding(.bottom, Design.Spacing.small)
|
||||||
|
}
|
||||||
|
|
||||||
// Grid with drag-and-drop support in edit mode
|
// Grid with drag-and-drop support in edit mode
|
||||||
LazyVGrid(columns: columns, spacing: Design.Spacing.medium) {
|
LazyVGrid(columns: columns, spacing: Design.Spacing.medium) {
|
||||||
ForEach(orderedCards) { card in
|
ForEach(orderedCards) { card in
|
||||||
@ -44,6 +50,7 @@ struct InsightsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(Design.Spacing.large)
|
.padding(Design.Spacing.large)
|
||||||
|
.adaptiveContentWidth()
|
||||||
}
|
}
|
||||||
.background(LinearGradient(
|
.background(LinearGradient(
|
||||||
colors: [AppSurface.primary, AppSurface.secondary],
|
colors: [AppSurface.primary, AppSurface.secondary],
|
||||||
@ -51,7 +58,7 @@ struct InsightsView: View {
|
|||||||
endPoint: .bottomTrailing
|
endPoint: .bottomTrailing
|
||||||
))
|
))
|
||||||
.navigationTitle(String(localized: "Insights"))
|
.navigationTitle(String(localized: "Insights"))
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .primaryAction) {
|
ToolbarItem(placement: .primaryAction) {
|
||||||
Button {
|
Button {
|
||||||
|
|||||||
@ -37,6 +37,11 @@ struct RitualsView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
||||||
|
if horizontalSizeClass == .regular {
|
||||||
|
Text(String(localized: "Rituals")).styled(.heroBold)
|
||||||
|
.padding(.bottom, Design.Spacing.small)
|
||||||
|
}
|
||||||
|
|
||||||
// Segmented picker
|
// Segmented picker
|
||||||
Picker(String(localized: "View"), selection: $selectedTab) {
|
Picker(String(localized: "View"), selection: $selectedTab) {
|
||||||
ForEach(RitualsTab.allCases, id: \.self) { tab in
|
ForEach(RitualsTab.allCases, id: \.self) { tab in
|
||||||
@ -63,7 +68,7 @@ struct RitualsView: View {
|
|||||||
endPoint: .bottomTrailing
|
endPoint: .bottomTrailing
|
||||||
))
|
))
|
||||||
.navigationTitle(String(localized: "Rituals"))
|
.navigationTitle(String(localized: "Rituals"))
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .primaryAction) {
|
ToolbarItem(placement: .primaryAction) {
|
||||||
Menu {
|
Menu {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import Bedrock
|
|||||||
|
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
@Bindable var store: SettingsStore
|
@Bindable var store: SettingsStore
|
||||||
|
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||||
var ritualStore: RitualStore?
|
var ritualStore: RitualStore?
|
||||||
var categoryStore: CategoryStore?
|
var categoryStore: CategoryStore?
|
||||||
|
|
||||||
@ -168,8 +169,8 @@ struct SettingsView: View {
|
|||||||
|
|
||||||
Spacer(minLength: Design.Spacing.xxxLarge)
|
Spacer(minLength: Design.Spacing.xxxLarge)
|
||||||
}
|
}
|
||||||
.padding(.horizontal, Design.Spacing.large)
|
.padding(Design.Spacing.large)
|
||||||
.adaptiveContentWidth(maxWidth: Design.Size.maxContentWidthPortrait)
|
.adaptiveContentWidth()
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
store.refresh()
|
store.refresh()
|
||||||
@ -180,7 +181,7 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
.background(AppSurface.primary)
|
.background(AppSurface.primary)
|
||||||
.navigationTitle(String(localized: "Settings"))
|
.navigationTitle(String(localized: "Settings"))
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,11 @@ struct TodayView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
||||||
|
if horizontalSizeClass == .regular {
|
||||||
|
TodayHeaderView(dateText: store.todayDisplayString)
|
||||||
|
.padding(.bottom, Design.Spacing.small)
|
||||||
|
}
|
||||||
|
|
||||||
if todayRituals.isEmpty {
|
if todayRituals.isEmpty {
|
||||||
if hasRitualsButNotNow {
|
if hasRitualsButNotNow {
|
||||||
// Has active rituals but none for current time of day
|
// Has active rituals but none for current time of day
|
||||||
@ -75,7 +80,7 @@ struct TodayView: View {
|
|||||||
endPoint: .bottomTrailing
|
endPoint: .bottomTrailing
|
||||||
))
|
))
|
||||||
.navigationTitle(String(localized: "Today"))
|
.navigationTitle(String(localized: "Today"))
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(horizontalSizeClass == .regular ? .inline : .large)
|
||||||
.sheet(isPresented: .init(
|
.sheet(isPresented: .init(
|
||||||
get: { showRenewalSheet },
|
get: { showRenewalSheet },
|
||||||
set: { if !$0 { store.dismissRenewalPrompt() } }
|
set: { if !$0 { store.dismissRenewalPrompt() } }
|
||||||
|
|||||||
@ -33,7 +33,6 @@ struct LargeWidgetView: View {
|
|||||||
.background(AppTextColors.primary.opacity(0.2))
|
.background(AppTextColors.primary.opacity(0.2))
|
||||||
|
|
||||||
if entry.nextHabits.isEmpty {
|
if entry.nextHabits.isEmpty {
|
||||||
Spacer()
|
|
||||||
WidgetEmptyStateView(
|
WidgetEmptyStateView(
|
||||||
iconSize: .section,
|
iconSize: .section,
|
||||||
title: String(localized: "No rituals scheduled for \(entry.currentTimeOfDay.lowercased())."),
|
title: String(localized: "No rituals scheduled for \(entry.currentTimeOfDay.lowercased())."),
|
||||||
@ -43,7 +42,6 @@ struct LargeWidgetView: View {
|
|||||||
nextRitual: entry.nextRitualInfo,
|
nextRitual: entry.nextRitualInfo,
|
||||||
isCompact: false
|
isCompact: false
|
||||||
)
|
)
|
||||||
Spacer()
|
|
||||||
} else {
|
} else {
|
||||||
Text(String(localized: "Habits"))
|
Text(String(localized: "Habits"))
|
||||||
.styled(.captionEmphasis, emphasis: .custom(AppTextColors.secondary))
|
.styled(.captionEmphasis, emphasis: .custom(AppTextColors.secondary))
|
||||||
Loading…
Reference in New Issue
Block a user