refactor: pass GestureInfo into brick fragment

This commit is contained in:
efim
2023-11-23 14:25:48 +00:00
parent 82a96ea9d7
commit dbae803ead
3 changed files with 19 additions and 25 deletions

View File

@@ -12,8 +12,8 @@ import (
)
type brickState struct {
ColorClass template.CSS
TemplateType string
Gesture rooms.HandGesture
}
type personData struct {
Name string
@@ -184,8 +184,8 @@ func (pData personData) BricksForPerson() []brickState {
}
result[gesture] = brickState{
ColorClass: gesture.GetGestureInfo().Color,
TemplateType: templateType,
Gesture: gesture,
}
}
@@ -198,12 +198,6 @@ func roomTemplatesPreview(
) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
type SingleBrickData struct {
ColorClass template.CSS
Name string
Gesture rooms.HandGesture
}
testPersonData := personData{
Name: "John Doe",
IsRaised: true,
@@ -263,8 +257,8 @@ func roomTemplatesPreview(
}{
DefaultColor: "--expand-color",
ABrick: brickState{
ColorClass: "--expand-color",
TemplateType: "raisedBrick",
Gesture: rooms.Expand,
},
Gestures: rooms.GesturesHighToLow[:],
TestPerson: testPersonData,