File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,20 @@ class Status extends HtmlComponent
1414
1515 public $ offset ;
1616
17+ public $ state ;
18+
1719 public function __construct (
1820 $ color = null ,
1921 $ thickness = null ,
2022 $ style = null ,
2123 $ offset = null ,
24+ $ state = null ,
2225 ) {
2326 $ this ->color = $ color ;
2427 $ this ->thickness = $ thickness ;
2528 $ this ->style = $ style ;
2629 $ this ->offset = $ offset ;
30+ $ this ->state = $ state ;
2731 }
2832
2933 public function render ()
@@ -33,6 +37,7 @@ public function render()
3337 ->thickness ($ this ->thickness )
3438 ->style ($ this ->style )
3539 ->offset ($ this ->offset )
40+ ->state ($ this ->state )
3641 ->render ();
3742 }
3843}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ class Status extends HtmlComponent
1212
1313 public static $ offset ;
1414
15+ public static $ state ;
16+
1517 public static function color ($ value )
1618 {
1719 self ::$ color = $ value ;
@@ -40,15 +42,26 @@ public static function offset($value)
4042 return new static ;
4143 }
4244
45+ public static function state ($ value )
46+ {
47+ self ::$ state = $ value ;
48+
49+ return new static ;
50+ }
51+
4352 public static function process ()
4453 {
4554 $ color = self ::$ color ?? 'green ' ;
4655 $ thickness = self ::$ thickness ?? '2 ' ;
4756 $ style = self ::$ style ?? 'solid ' ;
4857 $ offset = self ::$ offset ?? '2 ' ;
58+ $ state = self ::$ state ?? 'Active ' ;
59+
4960
5061 $ contents = <<< HTML
51- <span class="badge bmx-bg- {$ color } rounded-circle p-2 bmx-pulse bmx-animation-continuous m-1 bmx-outline- {$ color } bmx-outline- {$ thickness } bmx-outline-offset- {$ offset } bmx-outline- {$ style }"></span>
62+ <span class="badge bmx-bg- {$ color } rounded-circle p-2 bmx-pulse bmx-animation-continuous m-1 bmx-outline- {$ color } bmx-outline- {$ thickness } bmx-outline-offset- {$ offset } bmx-outline- {$ style }">
63+ <span class="visually-hidden"> {$ state }</span>
64+ </span>
5265HTML ;
5366
5467 self ::$ html = (string ) $ contents ;
You can’t perform that action at this time.
0 commit comments