diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-04 22:45:30 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-04 22:45:30 +0200 |
| commit | e21ead77ffdff206d1ae17e5ce93ea34c4227414 (patch) | |
| tree | 816908ddf90aaf99a6476ab364f8a13c193b99c4 /Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift | |
| parent | c843d34f56c207abcf4b93e424125eea2dc601e0 (diff) | |
Add new fonts and picker style.
Diffstat (limited to 'Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift')
| -rw-r--r-- | Map/Presentation/Base Components/EvolutionPicker/EvolutionPickerMenuItem.swift | 32 |
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) +} |