blob: cac1b0815001cf4cb4bf34ad494cd42e0aa8683d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import SwiftUI
struct EvolutionPickerMenuItem: View {
@State var isHovered: Bool = false
let stageType: 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(stageType))
.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(stageType: .behavior, isSelected: false)
EvolutionPickerMenuItem(stageType: .ubiquity, isSelected: true)
}
|