@@ -2,8 +2,8 @@ module Shared.Experiments.Impersonation where
2
2
3
3
import Prelude
4
4
import Shared.Availability
5
- import Shared.Experiments.Types
6
5
import Shared.User
6
+ import Shared.Experiments.Types
7
7
8
8
import Client.Common.Privilege as CCP
9
9
import Data.Argonaut (class DecodeJson , class EncodeJson )
@@ -40,29 +40,16 @@ data ExperimentPayload = ImpersonationPayload
40
40
, sender ∷ Boolean
41
41
}
42
42
43
- data ImpersonationSection
44
- = HideSections
45
- | Characters
46
- | HistoricalFigures
47
- | Celebrities
48
43
49
- derive instance Generic ImpersonationSection _
50
44
51
45
derive instance Generic ExperimentPayload _
52
46
53
- derive instance Eq ImpersonationSection
54
-
55
47
instance EncodeJson ExperimentPayload where
56
48
encodeJson = DAEGR .genericEncodeJson
57
49
58
- instance EncodeJson ImpersonationSection where
59
- encodeJson = DAEGR .genericEncodeJson
60
-
61
50
instance DecodeJson ExperimentPayload where
62
51
decodeJson = DADGR .genericDecodeJson
63
52
64
- instance DecodeJson ImpersonationSection where
65
- decodeJson = DADGR .genericDecodeJson
66
53
67
54
instance Show ExperimentPayload where
68
55
show = DGRS .genericShow
@@ -102,12 +89,12 @@ view model = HE.div (HA.class' "impersonation")
102
89
]
103
90
]
104
91
where
105
- header s name = HE .div [ HA .class' " impersonation-header" ] -- , HA.onClick $ ToggleSection s ]
92
+ header s name = HE .div [ HA .class' " impersonation-header" , HA .onClick $ ToggleSection s ]
106
93
[ HE .text name
107
- , HE .span (HA .class' " header-plus" ) " + " -- $ if section == s then "-" else "+"
94
+ , HE .span (HA .class' " header-plus" ) if model. section == s then " -" else " +"
108
95
]
109
96
110
- profiles s = HE .div (HA .class' { hidden: s /= s }) <<< DA .mapWithIndex toProfile -- (HA.class' { hidden: section /= s }) <<< DA.mapWithIndex toProfile
97
+ profiles s = HE .div (HA .class' { hidden: model. section /= s }) <<< DA .mapWithIndex toProfile
111
98
toProfile index p = HE .div [ HA .class' " contact" ] -- , HA.onClick <<< ConfirmImpersonation $ Just p ]
112
99
[ HE .div (HA .class' " avatar-contact-list-div" )
113
100
[ HE .img [ HA .title $ SU .fromJust p.avatar, HA .class' $ " avatar-contact-list" <> SA .avatarColorClass (Just index), HA .src $ SU .fromJust p.avatar ]
0 commit comments