Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ad Aures
Castopod
Commits
30683b3e
Commit
30683b3e
authored
May 09, 2022
by
Ola Hneini
Browse files
feat: add icons to message blocks
parent
eb9ff522
Pipeline
#5982
passed with stages
in 6 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Views/Components/Alert.php
View file @
30683b3e
...
...
@@ -19,16 +19,24 @@ class Alert extends Component
public
function
render
():
string
{
$variantClasses
=
[
'default'
=>
'text-gray-800 bg-gray-100 border-gray-300'
,
'success'
=>
'text-pine-900 bg-pine-100 border-pine-300'
,
'danger'
=>
'text-red-900 bg-red-100 border-red-300'
,
'warning'
=>
'text-yellow-900 bg-yellow-100 border-yellow-300'
,
$variants
=
[
'success'
=>
[
'class'
=>
'text-pine-900 bg-pine-100 border-pine-300'
,
'glyph'
=>
'check'
,
],
'danger'
=>
[
'class'
=>
'text-red-900 bg-red-100 border-red-300'
,
'glyph'
=>
'close'
,
],
'warning'
=>
[
'class'
=>
'text-yellow-900 bg-yellow-100 border-yellow-300'
,
'glyph'
=>
'alert'
,
],
];
$glyph
=
$this
->
glyph
===
null
?
''
:
'<Icon glyph="'
.
$this
->
glyph
.
'" class="flex-shrink-0 mr-2 text-lg" />'
;
$glyph
=
'<Icon glyph="'
.
(
$this
->
glyph
===
null
?
$variants
[
$this
->
variant
][
'glyph'
]
:
$this
->
glyph
)
.
'" class="flex-shrink-0 mr-2 text-lg" />'
;
$title
=
$this
->
title
===
null
?
''
:
'<div class="font-semibold">'
.
$this
->
title
.
'</div>'
;
$class
=
'inline-flex w-full p-2 text-sm border rounded '
.
$variant
Classe
s
[
$this
->
variant
]
.
' '
.
$this
->
class
;
$class
=
'inline-flex w-full p-2 text-sm border rounded '
.
$variants
[
$this
->
variant
]
[
'class'
]
.
' '
.
$this
->
class
;
unset
(
$this
->
attributes
[
'slot'
]);
unset
(
$this
->
attributes
[
'variant'
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment