aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift')
-rw-r--r--Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift32
1 files changed, 32 insertions, 0 deletions
diff --git a/Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift b/Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift
new file mode 100644
index 0000000..1731e8d
--- /dev/null
+++ b/Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift
@@ -0,0 +1,32 @@
+import SwiftUI
+
+struct EvolutionPickerMenuItem: View {
+
+ @State var isHovered: Bool = false
+
+ let stage: StageType
+ let isSelected: Bool
+
+ var body: some View {
+ HStack(alignment: .center, spacing: Dimensions.Spacing.coziest) {
+ Image(systemName: "checkmark")
+ .opacity(isSelected ? 1.0 : 0.0)
+ .bold(true)
+ Text(Stage.title(stage))
+ .font(isSelected ? .Theme.Body.emphasized : .Theme.Body.regular)
+ .padding(Dimensions.Spacing.cozy)
+ Spacer()
+ }
+ .padding(.horizontal, Dimensions.Spacing.regular)
+ .background(isHovered ? Color.Theme.UI.accent : Color.clear)
+ .cornerRadius(Dimensions.EvolutionPicker.radius)
+ .onHover { hovering in
+ isHovered = hovering
+ }
+ }
+}
+
+#Preview {
+ EvolutionPickerMenuItem(stage: .behavior, isSelected: false)
+ EvolutionPickerMenuItem(stage: .ubiquity, isSelected: true)
+}