@@ -39,8 +39,13 @@ class SubHeader < Primer::Component
3939 if icon_only
4040 component = Primer ::Beta ::IconButton . new ( **icon_args )
4141 @left_actions ||= [ ]
42+ @middle_actions ||= [ ]
4243 @right_actions ||= [ ]
43- target_actions = location == :left ? @left_actions : @right_actions
44+ target_actions = case location
45+ when :left then @left_actions
46+ when :middle then @middle_actions
47+ else @right_actions
48+ end
4449 target_actions . push ( { component : component , block : block } )
4550
4651 component
@@ -55,8 +60,13 @@ class SubHeader < Primer::Component
5560 component = Primer ::OpenProject ::SubHeader ::Button . new ( display : DESKTOP_ACTIONS_DISPLAY , **desktop_kwargs )
5661
5762 @left_actions ||= [ ]
63+ @middle_actions ||= [ ]
5864 @right_actions ||= [ ]
59- target_actions = location == :left ? @left_actions : @right_actions
65+ target_actions = case location
66+ when :left then @left_actions
67+ when :middle then @middle_actions
68+ else @right_actions
69+ end
6070 target_actions . push ( { component : component , block : block } )
6171
6272 component
@@ -71,8 +81,13 @@ class SubHeader < Primer::Component
7181 component = Primer ::OpenProject ::SubHeader ::ButtonGroup . new ( **desktop_kwargs )
7282
7383 @left_actions ||= [ ]
84+ @middle_actions ||= [ ]
7485 @right_actions ||= [ ]
75- target_actions = location == :left ? @left_actions : @right_actions
86+ target_actions = case location
87+ when :left then @left_actions
88+ when :middle then @middle_actions
89+ else @right_actions
90+ end
7691 target_actions . push ( { component : component , block : block } )
7792
7893 component
@@ -99,8 +114,13 @@ class SubHeader < Primer::Component
99114 component = Primer ::OpenProject ::SubHeader ::Menu . new ( icon_only : icon_only , display : DESKTOP_ACTIONS_DISPLAY , **desktop_kwargs )
100115
101116 @left_actions ||= [ ]
117+ @middle_actions ||= [ ]
102118 @right_actions ||= [ ]
103- target_actions = location == :left ? @left_actions : @right_actions
119+ target_actions = case location
120+ when :left then @left_actions
121+ when :middle then @middle_actions
122+ else @right_actions
123+ end
104124 target_actions . push ( { component : component , block : block } )
105125
106126 component
0 commit comments